Skip to content

Commit

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

Differential Revision: D48363238

Pull Request resolved: #107281
Approved by: https://github.com/awgu, https://github.com/H-Huang, https://github.com/fegin
  • Loading branch information
rohan-varma authored and pytorchmergebot committed Aug 16, 2023
1 parent ba6fcc4 commit 0434a2c
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 0434a2c

Please sign in to comment.