Skip to content

Commit

Permalink
Check all CUDA API calls for errors in test/ (pytorch#74921) (pytorch…
Browse files Browse the repository at this point in the history
…#83954)

Summary: Pull Request resolved: pytorch#74921

Test Plan: Sandcastle

Reviewed By: ezyang, malfet, ngimel

Differential Revision: D35194966

Pull Request resolved: pytorch#83954
Approved by: https://github.com/ezyang
  • Loading branch information
r-barnes authored and pytorchmergebot committed Aug 24, 2022
1 parent a741927 commit 67f0940
Show file tree
Hide file tree
Showing 2 changed files with 436 additions and 387 deletions.
4 changes: 2 additions & 2 deletions test/cpp/c10d/ProcessGroupNCCLTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class NCCLTest : public NCCLTestBase {

// Copy inputs to outputs
for (const auto i : c10::irange(numDevices_)) {
cudaStreamSynchronize(streams_[i].stream());
C10_CUDA_CHECK(cudaStreamSynchronize(streams_[i].stream()));
outputs[i] = tensors_[i].cpu();
}

Expand Down Expand Up @@ -137,7 +137,7 @@ class NCCLTest : public NCCLTestBase {

// Copy inputs to outputs
for (const auto i : c10::irange(numDevices_)) {
cudaStreamSynchronize(streams_[i].stream());
C10_CUDA_CHECK(cudaStreamSynchronize(streams_[i].stream()));
for (auto j = 0; j < worldSize_ * numDevices_; ++j) {
outputs[i][j] = tensor_lists[i][j].cpu();
}
Expand Down
Loading

0 comments on commit 67f0940

Please sign in to comment.