8000 [a2av] Align length of major dimension in output of 2D a2av by kwen2501 · Pull Request #155172 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update
[ghstack-poisoned]
  • Loading branch information
kwen2501 committed Jun 5, 2025
commit 741b5a80bb0955d24287063601d1bc73261aa07e
13 changes: 11 additions & 2 deletions torch/csrc/distributed/c10d/nvshmem_extension.cu
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,17 @@ at::Tensor nvshmem_all_to_all_vdev_2d(
&& 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");
TORCH_CHECK(split_shape.size() == 2
&& split_shape[0] == 3
&& split_shape[1] % world_size == 0,
"in_out_splits must be 2D with 3 rows, "
"each row must be a multiple of world_size");

// Consistency checks
TORCH_CHECK(input.dtype() == out.dtype()
&& input.stride(0) == out.stride(0),
"input and out must have the same dtype and same stride at dim 0");
TORCH_CHECK(in_out_splits.scalar_type() == at::kLong, "in_out_splits must be int64");

// Number of experts per rank
int ne = split_shape[1] / world_size;
Expand Down
Loading
You are viewing a condensed version of this merge commit. You can view the full changes here.
0