-
Notifications
You must be signed in to change notification settings - Fork 53
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
Lower distributed matmul to pipelined algorithm for fine-grained overlap #3606
Open
samnordmann
wants to merge
20
commits into
NVIDIA:main
Choose a base branch
from
samnordmann:overlap/lower_matmul_to_hostir
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Lower distributed matmul to pipelined algorithm for fine-grained overlap #3606
samnordmann
wants to merge
20
commits into
NVIDIA:main
from
samnordmann:overlap/lower_matmul_to_hostir
+201
−17
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
samnordmann
force-pushed
the
overlap/lower_matmul_to_hostir
branch
from
December 18, 2024 08:47
bb867e8
to
b517c2b
Compare
!test |
nsarka
reviewed
Dec 20, 2024
nsarka
reviewed
Dec 20, 2024
nsarka
reviewed
Dec 20, 2024
samnordmann
added a commit
that referenced
this pull request
Dec 23, 2024
# What Make stream synchronization non-blocking from the CPU point of view # Why Needed for achieving overlap in - #3606 before this patch: ![Screenshot 2024-12-18 at 12 08 25](https://github.com/user-attachments/assets/f5c84282-ea85-4cb8-8a60-538cd91cfa1c) after this patch ![Screenshot 2024-12-18 at 12 08 05](https://github.com/user-attachments/assets/25537a5d-3e33-4ff8-baf4-4f013c1ed230) # How Before this patch, the host IR `Synchronize` would call `c10::synchronize()` on the cuda stream, which makes the CPU blocks until stream completion. With this patch, we synchronize the current stream with a given stream through a `cudaEvent` and the API `cudaStreamWaitEvent`.
samnordmann
added a commit
that referenced
this pull request
Dec 23, 2024
# What adds the primitive `GetCurrentStream` to Host Ir stack. # Why needed for - #3606 The idea is that if we want to use multiple stream internally, we need before hand to capture the user stream and to set it back to being the active stream when returning
!test |
nsarka
approved these changes
Dec 23, 2024
!test |
I am not sure what's going on with CI. Probably an infra issue |
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.
Stacked on top of
GetCurrentStream
#3605What
Lower a MatmulOp sharded on the first inner axis into a pipelined AG+GEMM algorithm achieving fine grained overlap.
More precisely, this patch enables lowering the fusion:
to the Host Ir program (obtained from dump, using
NVFUSER_DUMP=host_ir
)The nsight profile shows that we do achieve overlap, in a way that is comparable to the Aten overlap experiments