[Bug]: 00_load and 02_all_load validate against arange but fill the source with ones/zeros — validation can never pass
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 75/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 領域
- performance, testing
調査の方向性
examples/00_load/load_bench.py の 253 行目 (shmem.ones) と 175 行目 (torch.arange)、および examples/02_all_load/all_load_bench.py の 345 行目 (shmem.zeros) と 213 行目 (torch.arange) を確認してください。修正は、検証参照をソースバッファのフィルと一致させることです:フィルを arange に変更するか、検証を ones/zeros に変更します。--validate を付けて例を実行して不一致を確認し、修正後にテストファイル tests/examples/test_load_bench.py と tests/examples/test_all_load_bench.py を調整して再有効化してください。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
The load/store benchmarks validate their results against a tensor they never
wrote. expected is built with torch.arange(...), but the source buffer is
filled with shmem.ones(...) (00_load) or shmem.zeros(...) (02_all_load), so
the comparison fails by construction regardless of whether the data movement
worked.
This is the underlying cause of #119 — the tests that were skipped citing #119
(tests/examples/test_load_bench.py, tests/examples/test_all_load_bench.py)
are skipped because of this, not because of measurement accuracy.
The two symptoms are independent and both real:
- correctness: validation compares against the wrong reference, so
--validatereports failure no matter what. (this issue) - measurement: bandwidth is inflated because the benchmark doesn't
subtract cached reads / use appropriate cache modifiers. (#119)
Fixing this one does not fix #119; it makes --validate mean something so
that #119 can then be worked on with a trustworthy pass/fail signal.
To Reproduce
$ python examples/00_load/load_bench.py --num_ranks 1 --validate --datatype fp32 \
--buffer_size 536870912 --block_size 1024 --heap_size 4294967296 \
--num_experiments 5 --num_warmup 1
INFO [Iris] [0/1] Max absolute difference: 134217728.0
$ python examples/02_all_load/all_load_bench.py --num_ranks 1 --validate --verbose \
--datatype fp32 --buffer_size_min 268435456 --buffer_size_max 268435456 \
--block_size 1024 --heap_size 4294967296 --num_experiments 3 --num_warmup 1 \
--active_ranks 1
INFO [Iris] [0/1] Max absolute difference: 67108864.0
ERROR [Iris] [0/1] Mismatch at index (2,): C=0.0, expected=2.0
ERROR [Iris] [0/1] Validation failed.
That last line is the giveaway: index 2 contains 0.0 (the buffer was zeroed)
and is compared to 2.0 (the arange reference). The data movement may be
perfect; the reference is simply not what was stored.
Measured on ROCm 7.14 / torch 2.12.0+rocm7.14, RX 9070 XT (gfx1201).
Where
| file | fills source with | validates against |
|---|---|---|
examples/00_load/load_bench.py |
shmem.ones(...) (line 253) |
torch.arange(n_elements,...) (line 175) |
examples/02_all_load/all_load_bench.py |
shmem.zeros(...) (line 345) |
torch.arange(n_elements,...) (line 213) |
Compare examples/01_store/store_bench.py, which is self-consistent: its
kernel stores the index (iris.store(target_buffer + offsets, offsets, ...),
line 43), so validating against arange is correct there. That is presumably
where the arange reference was copied from.
examples/03_all_store/all_store_bench.py stores the same way and is likewise
consistent. So the bug is confined to the two *_load benchmarks.
Expected behavior
--validate passes when the data movement is correct, i.e. the reference
matches what is actually in the source buffer.
Suggested fix
Make the reference match the fill, per example. For 00_load:
source_buffer = shmem.arange(
args["buffer_size"] // element_size_bytes, device="cuda", dtype=dtype
)
(then the existing expected = torch.arange(...) is correct), or alternatively
compare against torch.ones(...) to match the existing fill. Either is a
one-line change; I don't know which the maintainers prefer for a bandwidth
benchmark, which is why I haven't opened a patch.
Consequence worth noting
Because these two examples always fail validation, the two test files covering
them were disabled with pytest.skip(...) citing #119 — so the load and
all-load paths currently have no effective test coverage at all, and their
CI entries report as skipped rather than failed. Fixing the reference is a
prerequisite to re-enabling them.
Related
- #119 — the measurement-accuracy issue these skips cite (separate cause)
- I have a PR open (#555) that fixes a different example's exit code, which had
the same "logs a failure and exits 0" shape. That is why this one stood out:
02_all_loadalso exits 0 despite printingValidation failed.
- 主要言語
- Python
- スター
- 203
- フォーク
- 57
- 平均マージ
- 3日 7時間
- マージ済み PR(30日)
- 31
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ROCm/iris のほかの issue
-
core examples good first issue help wanted iris python
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
bug examples invalid iris
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
iris test
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
SDMA is Triton-only, and no collective uses it対応中かも @ariscript が 18 日前に担当しました。 オープンenhancement gluon help wanted iris
難易度 5/5 1週間以上 初心者へのやさしさ 18/100
ROCm/iris#593 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
all_reduce: every iris.store passes a vectorization hint, none of the iris.load calls do再び着手できるかも @anchit-goel が 14 日前に担当しましたが、オープン中のプルリクエストはありません。 オープンgood first issue help wanted iris
難易度 3/5 半日 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
似ている issue
-
bump patch
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1〜3時間 初心者へのやさしさ 78/100
QuantConnect/Documentation#2838 ·
メンテナーはふだん 1 日以内に返信
-
get_all_subclasses must deduplicate by class identity対応中かも @Gambit-Checkmate が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 15 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
awslabs/route53-dynamic-dns-with-lambda#67 · コメント 1 件 ·