Skip to content

Commit

Permalink
Fixing the unit test issue(s) in RAFT (#646)
Browse files Browse the repository at this point in the history
The call to `uniform()` is getting executed in `handle.get_stream()` and kernels/operations after `uniform()` are executed in separately created `stream`. This causes synchronization hazard. When default RNG was changed from Philox to PCG, the bug got exposed due to the relative difference in generation speed of PCG and Philox (PCG is faster). Adding a stream synchronization call fixes the issue.

Authors:
  - Vinay Deshpande (https://github.com/vinaydes)
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - Corey J. Nolet (https://github.com/cjnolet)

URL: #646
  • Loading branch information
vinaydes authored May 11, 2022
1 parent 3a431f1 commit 270bf95
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion cpp/test/linalg/divide.cu
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ class DivideTest : public ::testing::TestWithParam<raft::linalg::UnaryOpInputs<T
{
raft::random::RngState r(params.seed);
int len = params.len;
RAFT_CUDA_TRY(cudaStreamCreate(&stream));
uniform(handle, r, in.data(), len, T(-1.0), T(1.0));
naiveDivide(out_ref.data(), in.data(), params.scalar, len, stream);
divideScalar(out.data(), in.data(), params.scalar, len, stream);
Expand Down

0 comments on commit 270bf95

Please sign in to comment.