Skip to content

Commit

Permalink
[BE][PG NCCL] Improve input mismatch error msg (pytorch#107281)
Browse files Browse the repository at this point in the history
Test Plan: CI

Differential Revision: D48363238

Pull Request resolved: pytorch#107281
Approved by: https://github.com/awgu, https://github.com/H-Huang, https://github.com/fegin
  • Loading branch information
rohan-varma authored and summerdo committed Aug 17, 2023
1 parent 231a199 commit 3fa80b3
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions torch/csrc/distributed/c10d/ProcessGroupNCCL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1502,8 +1502,16 @@ std::vector<at::Tensor> flatten_for_scatter_gather(
if (tensor_lists[i].size() != world_size * num_devices) {
TORCH_CHECK(
false,
"Tensor list input to scatter/gather must match number of collective"
" participants");
c10::str(
"Tensor list input to scatter/gather must match number of collective participants ",
"but got ",
tensor_lists[i].size(),
" inputs",
" with world_size ",
world_size,
" and ",
num_devices,
" devices."));
}

// Only check device match for the first tensor in the list; the call to
Expand Down

0 comments on commit 3fa80b3

Please sign in to comment.