-
Notifications
You must be signed in to change notification settings - Fork 230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Race condition when computing mean!
of large arrays?
#929
Comments
The fact that using julia> using Statistics
julia> using CUDA
julia> N = 512;
julia> a = ones(N, N, N) |> CuArray;
julia> A = zeros(1, 1, N) |> CuArray;
julia> CUDA.@sync mean!(A, a)
1×1×512 CuArray{Float64, 3}:
[:, :, 1] =
1.0
[:, :, 2] =
1.0
[:, :, 3] =
1.0
...
[:, :, 510] =
1.0
[:, :, 511] =
1.0
[:, :, 512] =
1.0 |
Does this reproduce outside of the REPL? See #837; the REPL evaluates output on a different task, and we should already synchronize automatically there. EDIT: never mind, another silly mistake. Fix incoming. |
Thanks @maleadt! Didn't realize this was a REPL issue. We're experiencing some bad output in CliMA/LESbrary.jl#118 where we're computing I'll try to reproduce outside of the REPL and open a new issue if we can reproduce with just CUDA.jl. |
With the REPL fixed you should be able to investigate from there again (presumably that's a little easier, too). |
I don't fully understand the PR but could #933 be related or help? |
Nope, that only affects that specific NVML method, which CI calls (and hence it fixes a CI issue). |
Describe the bug
When calling
mean!
on a large array, it seems to return early as some entries of the result are still storing the sum while others are still zero. I expected it to return an array full of ones.To reproduce
The Minimal Working Example (MWE) for this bug:
Manifest.toml
Version info
Details on Julia:
Details on CUDA:
Additional context
X-Ref: CliMA/LESbrary.jl#118
The text was updated successfully, but these errors were encountered: