Repository navigation
test(moe): grant one bf16 ulp only at rounding ties in the ds_fp4 transcription check - #668
Open
void-mckenzie wants to merge 1 commit into
Open
void-mckenzie wants to merge 1 commit into
void-mckenzie wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
Closes #649.
The transcription check rounds each route's output to bf16 before the fp32 sum. On
sm_120 the kernel's accumulation order puts token 1 / route 2 / column 493 of the
seeded inputs at -97.75000x, 1e-5 past the bf16 tie between -97.5 and -98.0, while
the torch reference lands 1e-5 short of it: the same value rounds to -98.0 on one
side and -97.5 on the other. The four routes cancel to -4.5, so the one-ulp (0.5)
difference exceeds the allowed 0.11 (atol + rtol*|sum| with the flat 2e-2).
reference()now also returns a per-element tie budget: the largest bf16 ulp amongroutes whose raw output sits within 0.1 ulp of a rounding tie, which is the only
place a ~1e-5 relative difference in the fp32 accumulation can change the rounded
result.
_assert_closewidensatol + rtol*|want|by that budget, so every elementaway from a tie keeps exactly the 2e-2 check. The grouped-prefill, cpu-executor and
inactive-routes tests compare the same sum and go through the same helper.
Tested on RTX 5090 (sm_120), driver 580.95.05, torch 2.11.0+cu130, python 3.10.19;
synthetic banks, no checkpoint:
1 / 3072 elements, abs 0.5 at (1, 493) - identical to the issue