Conversation
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
/rerun-test test_dsv32_indexer_fusion.py |
Contributor
|
Collaborator
Author
|
/rerun-test test_dsv32_indexer_fusion.py |
Contributor
|
Results for 🚀 |
Collaborator
Author
|
/rerun-test test_dsv32_indexer_fusion.py |
Contributor
|
Results for 🚀 |
kpham-sgl
approved these changes
Aug 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
test/registered/kernels/ops/attention/test_dsv32_indexer_fusion.py::test_k_norm_rope_matches_referenceis flaky inbase-b/1-gpu-largeat roughly a 1% rate. A recent instance:The kernel is correct; the test's tolerance model is not.
The test compares a bf16 kernel output against an fp32 reference with a purely absolute tolerance:
bf16 keeps 8 significand bits, so its quantization step is relative: for outputs in
[16, 32)one ulp is0.125and half an ulp is0.0625, which already exceedsatol=0.06. The single fp32 → bf16 rounding at the end offused_k_indexer_norm_ropecan therefore break the assertion on its own, with no numerical error in the kernel at all.The test reaches those magnitudes routinely:
cos/sinhere arerandn(not real cosines bounded by 1) and the LayerNormgamma/betaarerandnas well, so outputs reach|v| ~ 30.Two further points made this show up as a random CI failure rather than a deterministic one:
_make_inputs()uses a seeded generator, butkey/weight/biaswere drawn from the global RNG, so every CI run used different inputs.atol=0.06is used for the second bf16 comparison intest_indexer_uses_replaced_rope_cache_for_fused_kernels, which passes today only because its inputs happen to be seeded.The tolerance has been this way since the test was introduced in #27705; this is not a recent regression.
Modifications
rtol = 2**-7(2x margin over the2**-8pure-rounding bound) plusatol = 1e-3for values driven near zero by cancellation.key/weight/biasintest_k_norm_rope_matches_referencewith the same generator convention the rest of the module already uses, so a failure is reproducible.No kernel or runtime code is touched.
Accuracy Tests
Measured on an H200, replaying the exact test body.
Reproduction of the flake with the current tolerance (400 draws, unseeded inputs, as CI runs it today):
The last line is the point: across 400 draws, no element ever deviated from the fp32 reference by more than half a bf16 ulp, so the whole discrepancy is representation, not kernel error.
The new tolerance (2000 draws, unseeded inputs):
The check never came closer than 2x to failing, and the seed the test now pins sits at the same margin.
The test file itself, run 10 consecutive times on an H200:
Speed Tests and Profiling
Not applicable — test-only change.
Checklist
🤖 Generated with Claude Code
CI States
Latest PR Test (Base): ❌ Run #32810657006
Latest PR Test (Extra): ❌ Run #32810656786
Latest PR Test (AMD ROCm 7.2): ❌ Run #32810656953