Skip to content

Commit

Permalink
[BE] Improve input mismatch error msg
Browse files Browse the repository at this point in the history
Test Plan: CI

Differential Revision: D48363238

fbshipit-source-id: 4740853d31b4c87915766a79749902d46409ac53
  • Loading branch information
rohan-varma authored and facebook-github-bot committed Aug 16, 2023
1 parent 35cca79 commit a17af5f
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 a17af5f

Please sign in to comment.