-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add manually mem gc python api #8482
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* add asan * add asan * rm uesless * rm useless * split prob with shrink logic * add gc in graph init and add debug log * add check * fix null str devict or allocator * revert asan merge * rm debug log * adress comment
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
…nc/oneflow into Add_manually_mem_gc_python_api
strint
reviewed
Jul 1, 2022
Static analysis with clang failed. PR label automerge has been removed |
strint
reviewed
Jul 1, 2022
CI failed when running job: Build cpu. PR label automerge has been removed |
Speed stats:
|
View latest API docs preview at: https://staging.oneflow.info/docs/Oneflow-Inc/oneflow/pr/8482/ |
Speed stats:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is done:
在测试中增加 oneflow gpu mem 变化的验证,依赖pynvml
,在ci容器里安装。#8452 的后续,其中,在 C++ 层 VM Sync + GC 的有效性已经得到验证(graph上)。
Test:
脚本:
观察三次显存变化如下:
Torch:
Oneflow:
当脚本执行结束,再次查看 nvidia-smi,固定的显存 used 才释放。
下面是多次执行申请释放的完整例子:
当不加 oneflow.cuda.empty_cache() 时,GPU Memory Usage 为 3011 MiB。
使用 oneflow.cuda.empty_cache() 时,GPU Memory Usage 为 1675 MiB。