[ROCm] Fix flaky forward-tolerance in backward adagrad ROCm test - #165
Open
avbokovoy wants to merge 1 commit into
Open
[ROCm] Fix flaky forward-tolerance in backward adagrad ROCm test#165avbokovoy wants to merge 1 commit into
avbokovoy wants to merge 1 commit into
Conversation
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.
Problem
test_backward_adagrad_rocm_fallback_kernel flakily failed with a forward output mismatch (e.g. fp32 weights + bf16 output, [127, 960]). The forward-check tolerance derived rtol/atol from weights_precision only, so fp32 weights forced the tight rtol=1e-4, tol=1e-2 even when the output was bf16 — below one bf16 ULP at the output magnitudes (~16–22). A correct kernel that bounded a single element the other way (exactly 1 ULP) tripped the assertion.
Fix
In backward_adagrad_common.py, only use the tight fp32 tolerance when both weights and output are fp32; otherwise use the relaxed 1e-2. Repro loop goes 16/40 -> 0/40 failures; the fp32/fp32 tight path is unchanged.