Conversation
415eb56 to
bf5d422
Compare
|
Hi @yizhang2077, I’ve rebased this PR onto the latest The focused GDN/kernel regression suite passes ( As independent evidence, #36548 reports that applying this beta fix reduced DFlash C8 wrong answers from 111/304 to 37/304 under the same seeds. This supports the fix as a meaningful isolated correction, while it still does not claim to resolve all remaining Qwen3.8/DFlash correctness issues. Could you take a look when you have a chance and help kick off CI? Thanks! |
bf5d422 to
ede0919
Compare
|
Hi @BBuf, could you take a look at this focused GDN kernel fix? I’ve rebased it onto the current It aligns target-verify BF16 beta semantics with packed decode and includes a model-free bitwise regression. The PR is currently blocked at the Would appreciate your help with review / CI when convenient. Thanks! |
|
Hi @hnyls2002, could you help take a look at this focused GDN target-verify fix when convenient? It aligns BF16 beta semantics between packed decode and target verify and includes a model-free bitwise regression. The branch is rebased and focused tests are clean; the PR is still blocked at the Would appreciate help routing/reviewing or enabling CI. Thanks! |
Motivation
The Triton GDN packed-decode and speculative target-verify paths currently use
different precision semantics for
beta = sigmoid(b)whenbis BF16:As a result, identical Q/K/V, gating inputs, and initial recurrent state can
produce different recurrent output and state. This is particularly relevant to
speculative verification because the recurrent state persists across decode
steps.
Modification
activation-dtype rounding semantics.
both recurrent output and FP32 state.
The normal packed-decode kernel is unchanged.
Regression
The new test uses deterministic BF16 inputs with one sequence/head and
production
K=V=128head dimensions.b=-0.5makes the BF16 betamaterialization observable without random inputs or a model checkpoint.
On current
mainbefore the fix, three runs fail consistently:After the fix, packed decode and T=1 target verify are bitwise equal for both
the BF16 output and updated/intermediate FP32 state.
As an additional development-only check, a real captured Qwen3.8 recurrent
transition changed from:
to zero differences for both tensors. The capture is not part of the test or
this commit.
Validation
test_fused_verify_triton_gdn.py: 13 passedtest_gdn_noncontiguous_stride.py: 8 passedtest_kda_kernels.py: 14 passed, 3 subtests passedgit diff --checkLocal kernel validation used an NVIDIA GeForce RTX 4090 with PyTorch
2.11.0+cu130 and Triton 3.6.0.
Scope
This PR intentionally addresses only the isolated GDN beta precision mismatch.
It does not claim to resolve all Qwen3.8 or speculative-decode numerical
divergence, and it does not close #35150.
Related
Related: #35150, #35541, #34734.
The related open PRs also identified the beta alignment. This PR keeps the
change intentionally minimal, narrows it to GDN target verify, and adds focused
packed-decode-vs-target-verify regression coverage on current main.
CI States
Latest PR Test (Base): ❌ Run #34223952622
Latest PR Test (Extra): ❌ Run #34223952289
Latest PR Test (AMD ROCm 7.2): ❌ Run #34223952653