-
Notifications
You must be signed in to change notification settings - Fork 26.7k
[a2av] 2D all-to-all-vdev #155058
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
Closed
Closed
[a2av] 2D all-to-all-vdev #155058
Changes from 1 commit
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update
[ghstack-poisoned]
- Loading branch information
commit cc1537fef122f9c0279534c1f4ac1d39afcbaff8
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -337,8 +337,10 @@ __global__ void exchangeSplitAndOffset_2d(int64_t* in_out_splits, int mype, int | |
| int e = tid % ne; | ||
| // This does a transpose from rank-major order to expert-major order | ||
| int dst_offset = e * npes + mype; | ||
| auto split_val = input_splits[tid]; | ||
| CUDA_KERNEL_ASSERT(split_val >= 0); | ||
| nvshmem_int64_p(source_offsets + dst_offset, peer_offsets[tid], peer); | ||
| nvshmem_int64_p(output_splits + dst_offset, input_splits[tid], peer); | ||
| nvshmem_int64_p(output_splits + dst_offset, split_val, peer); | ||
| } | ||
| // This barrier ensures that all remote PEs see the updated values | ||
| nvshmemx_barrier_all_block(); | ||
|
|
@@ -420,6 +422,10 @@ at::Tensor nvshmem_all_to_all_vdev_2d( | |
| int64_t* splits_ptr = (int64_t*)(splits_hdl->get_buffer_ptrs()[rank]); | ||
|
|
||
| auto split_shape = in_out_splits.sizes(); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I still don't see a check for
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry added. |
||
| TORCH_CHECK(in_out_splits.is_contiguous() | ||
| && input.is_contiguous() | ||
| && out.is_contiguous(), | ||
| "input, out and in_out_splits must be contiguous"); | ||
| TORCH_CHECK(split_shape.size() == 2 && split_shape[0] == 3, "in_out_splits must be 2D with 3 rows"); | ||
| TORCH_CHECK(split_shape[1] % world_size == 0, "Each row of in_out_splits must be a multiple of world_size"); | ||
| // Number of experts per rank | ||
|
|
||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here would also make sense to check that there are no negative numbers in splits, and that sum of splits is less than input size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a negative check.