Skip to content
Closed
Changes from all commits
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
8 changes: 2 additions & 6 deletions torch/lib/c10d/ProcessGroupNCCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -624,13 +624,9 @@ std::vector<at::Tensor> flatten_for_scatter_gather(
}

for (const auto& t : tensor_lists[i]) {
if (t.sizes() != other[i].sizes()) {
if (t.numel() != other[i].numel()) {
throw std::runtime_error(
"All tensor operands to scatter/gather must have the same size");
}
if (t.strides() != other[i].strides()) {
throw std::runtime_error(
"All tensor operands to scatter/gather must have the same layout (strides)");
"All tensor operands to scatter/gather must have the same number of elements");
}
}
// Flatten the tensors (from all ranks) into a single big tensor.
Expand Down