Repository navigation
[FlyDSL] fix(flydsl): stabilize GDN prepare triangular solve - #4952
Merged
Merged
Conversation
Contributor
🏷️ CI GuideRuns automatically on every PR:
Extended tests (opt-in via labels):
PR title tags: |
junna2016
force-pushed
the
xjn_fix_flydsl_k14
branch
2 times, most recently
from
August 24, 2026 06:01
7dbca50 to
94353fd
Compare
huizzhan
self-requested a review
August 24, 2026 07:10
junna2016
force-pushed
the
xjn_fix_flydsl_k14
branch
from
August 24, 2026 12:03
94353fd to
9030876
Compare
junna2016
force-pushed
the
xjn_fix_flydsl_k14
branch
from
August 25, 2026 01:31
9030876 to
a553e67
Compare
valarLip
approved these changes
Aug 25, 2026
huizzhan
added a commit
that referenced
this pull request
Aug 25, 2026
The prepare kernel itself reached mainline through #4598 and was stabilized by #4952, so this branch keeps only the test coverage those PRs did not carry over: the standalone unit tests and the end-to-end use_prepare_flydsl cases. Co-authored-by: Cursor <[email protected]>
1 task done
3 of 4 tasks
apinge
pushed a commit
to apinge/aiter
that referenced
this pull request
Oct 22, 2026
(cherry picked from commit 987203b)
apinge
added a commit
to apinge/aiter
that referenced
this pull request
Oct 22, 2026
Keep the FP32 MFMA diagonal inverse from upstream ROCm#4952. Preserve merge residuals with two BF16 components per FP32 operand and retain the correlated-key regression without relaxing its tolerance. (cherry picked from commit 8e3d2d1d24cc0931b5c62d24da0e5aa277f6b15b)
This was referenced Oct 25, 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
The FlyDSL fused GDN prefill prepare kernel introduced in ROCm/aiter#4598 can become numerically unstable on production Qwen3.5 inputs.
The original diagonal-block inversion repeatedly converted intermediate results from FP32 to BF16. For inputs with highly correlated keys, slow gate decay, and beta values close to one, the accumulated rounding error grows rapidly and produces severely inaccurate
w_barandu_barresults. Downstream GDN stages can consequently produce NaNs.This PR stabilizes the triangular solve while preserving the existing kernel interface and avoiding observable end-to-end performance regression.
Technical Details
g = -1e-3);beta = 0.835).The change is limited to the FlyDSL GDN prefill prepare kernel and does not affect other GDN backends.
Test Plan
Single-kernel benchmark configuration:
gfx942)B=1, T=2048, Hg=16, H=32, K=128, V=128BT=64Test Result
Single-operator accuracy
The following results use captured Qwen3.5-4B layer-0 inputs and compare the FlyDSL fused prepare kernel with the Triton reference.
g_cumsumw_barw_barw_baru_baru_baru_barThe fix removes the numerical explosion and downstream NaNs while closely matching the Triton reference.
Single-kernel performance
The stable solve adds approximately 5.5% latency to the isolated
gdn_prepare_kernel. This kernel-level difference did not produce an observable end-to-end TTFT regression.Model-level validation
Qwen3.5-4B inference was compared against the existing hybrid GDN implementation.
TTFT sanity measurements:
These model-level measurements confirm that the accuracy fix introduces no observable end-to-end performance regression. The small TTFT differences are within normal measurement variance.
All targeted correctness tests, adapter tests, Ruff checks, and Black checks passed.
Submission Checklist