Reductions with CUDA are sometimes wrong
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 18/100
- issue の種類
- バグ
- 明瞭さ
- 説明が足りない
- 活発さ
- 停滞
- 技術スタック
- julia
調査の方向性
ソースファイルもテストも指定されていません。reproducer の MPI.Reduce! 呼び出しから開始し、一覧にある MPI と CUDA のバージョンおよびコミットを比較しながら、CUDA デバイスデータとの相互作用を調査してください。削減結果が正しくない原因を再現可能な形で特定し、検証済みの修正を確認できれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Starting mid December, sometimes, some of my MPI reductions produce wrong results when I am working with CUDA (and only when working with CUDA).
I came to this conclusion via printf-debugging:
println("PRE", mypid, " ", Array(remapper._interpolated_values)[end, end, end, 1]); flush(stdout)
MPI.Barrier(remapper.comms_ctx.mpicomm)
MPI.Reduce!(remapper._interpolated_values[:, :, :, 1], dest, +, mpicomm)
MPI.Barrier(remapper.comms_ctx.mpicomm)
println("POST", mypid, " ", Array(dest)[end, end, end]); flush(stdout)
that produces:
PRE1 0.0
PRE2 500.0
POST1 249.99999999999997
POST2 0.0
The value 249.99999999999997 is wrong and it should be 500 (0.0 + 500.0 = 500.0). I tried forcing CUDA.synchronize and/or CUDA.sync, and sometimes results change (for example, I can get 450.0 instead of 250). Note also that 250 could be the correct value for another point.
The code above is embedded in a more complex test case, and I can reproduce the problem reliably when running in a relatively isolated environment. When I work interactively or when I change the test, the test becomes very flaky and extremely hard to reproduce. To ensure consistent results, I have to clean the depot.
I initially thought it was a buggy MPI implementation, but it seems that this problem also appears in production on a different machine (with simulations that run for multiple days). On that machine, the same test never triggers the bug (as checked by running the test 100 times)
Considering the bug is hard to reproduce, this is what I think I concluded:
- With CUDA 5.6, MPI 0.20.21 is fine MPI 0.20.22 is not (build)
- With CUDA 5.6, commit aac9688e6961bc7e3aeeba7600f5e7d0b10596a3 is not fine (build) but commit 9584ac8775bfd674eee74cb4b1c8dbe130a246ec is fine (build)
- Adding
localin front of datatype as suggested on Slack does not fix the issue (build) - With CUDA 5.5, MPI 0.20.22 is fine (build)
- Both Julia 1.10 and Julia 1.11 have the problem
- 主要言語
- Julia
- スター
- 441
- フォーク
- 129
- 平均マージ
- 50分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
JuliaParallel/MPI.jl のほかの issue
-
Use `@ccall gc_safe=true` for blocking calls対応中かも @giordano が 129 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
JuliaParallel/MPI.jl#954 · コメント 6 件 ·
-
documentation
難易度 1/5 1時間未満 初心者へのやさしさ 65/100
JuliaParallel/MPI.jl#920 · コメント 1 件 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 68/100
JuliaParallel/MPI.jl#745 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
JuliaParallel/MPI.jl#977 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
JuliaParallel/MPI.jl#951 ·
JuliaParallel/MPI.jl の issue をすべて見る
似ている issue
-
docs
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
-
path: splitext treats directory references and leading dots as extensions対応中かも @Hiten0305l が今日担当しました。 オープン
難易度 2/5 半日 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
JuliaRegistries/RegistryCI.jl#758 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JuliaParallel/Hwloc.jl#93 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信