skip storing window buffer tensor if in graph mode#1004
Closed
tianfengfrank wants to merge 1 commit intomainfrom
Closed
skip storing window buffer tensor if in graph mode#1004tianfengfrank wants to merge 1 commit intomainfrom
tianfengfrank wants to merge 1 commit intomainfrom
Conversation
Contributor
|
@tianfengfrank has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95841874. |
Summary: In CUDA graph capture mode, the window object no longer holds a reference to the registered tensor (buf_tensor_), allowing the physical memory buffer to be reused. The same physical buffer is still retrieved when the window is used since the NCCL window registration (commWindowRegister) already tracks it independently (as discussed with siyengar). Changes: - TorchCommWindowNCCLX.cpp: Skip buf_tensor_ storage when getGraphCaptureMode() is true, with a TC_LOG(WARNING) to note get_tensor() will return nullopt. - TorchCommWindow.hpp: Updated get_tensor() comment to document possible nullopt in graph capture mode. - TorchCommWindowNCCLXTest.cpp: Added two unit tests with mocked CUDA stream capture to verify buf_tensor_ is skipped in graph mode and stored in normal mode. Reviewed By: siyengar Differential Revision: D95841874
2f8cba4 to
72bb1a3
Compare
Contributor
|
This pull request has been merged in 808b79a. |
This file contains hidden or 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
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.
Summary:
In CUDA graph capture mode, the window object no longer holds a reference to the registered tensor (buf_tensor_), allowing the physical memory buffer to be reused. The same physical buffer is still retrieved when the window is used since the NCCL window registration (commWindowRegister) already tracks it independently (as discussed with siyengar).
Changes:
Differential Revision: D95841874