Repository navigation
[AMD][Qwen3.8] Route GDN decode, MTP verify and prefill front end through aiter FlyDSL kernels on gfx942 - #111
Merged
Conversation
…lyDSL kernels on gfx942 Decode: new FlyDSLGDNKernel keeps TritonGDNKernel's interface (packed_decode is a drop-in) and also serves the existing fused decode projection/Conv1D protocol: Qwen3_5GatedDeltaNet hands in (projected_qkvz, projected_ba) and gets (core_attn_out, z) back from one aiter fused_qkvzba_conv1d_gated_delta_rule_decode_flydsl launch, which replaces the b/a copies, q/k/v cat, causal_conv1d_update, packed recurrence and z copy. GDNKernelDispatcher wraps the Triton decode kernel with it on gfx942 when aiter provides the kernels. Prefill: flydsl_gdn_prefill_front replaces cat + causal_conv1d_fwd + qkv split + 2x l2norm; the gated norm reads z as a strided view (no copy). Both are taken only when the layer/cache contract matches (K=V=128, bf16 conv, fp32 SSM state, no replayssm/MIS/state tracking); otherwise the Triton path runs unchanged.
packed_decode now falls back to Triton unless activations are bf16, A_log is fp32, dt_bias is bf16/fp32, the scale is 128^-0.5 and HV is a multiple of H. The per-layer gate also requires num_q_heads == num_k_heads. Adds an fp16 packed_decode case that must match Triton exactly.
- qwen3_5: the FlyDSL prefill path joins the existing projection dispatch and reuses the common norm/out_proj tail with the strided-z option instead of duplicating it; the forward-mode checks move into its gate. - gdn_backend: one per-layer gate (supports_flydsl) instead of a gate plus an alias; drop prefill checks implied by the aiter prefill metadata. - gdn_flydsl: drop an attribute only read from the verify kernel.
…gate Address review on sgl-project#111: - decode and prefill share log_flydsl_path (lru_cache) instead of a kernel flag plus a module global. - the prefill front-end gate says which conditions come from the aiter chunked prefill and which from forward_extend; drop the extend-kernel isinstance check, implied by the aiter prefill metadata.
…kend aiter FlyDSL decode was switched on implicitly under the triton decode backend, with no way to turn it off. Make it explicit, like the prefill side: - --linear-attn-decode-backend accepts aiter and selects the FlyDSL decode kernel (Triton fallback when unavailable); triton is plain Triton again. - the prefill front end follows --linear-attn-prefill-backend aiter only, no longer tied to the decode backend. - evaluation launch script: --linear-attn-decode-backend aiter. - test: the decode backend flag selects the kernel.
…kend aiter Chain verify (topk 1) hands the in_proj outputs to the aiter FlyDSL verify kernel on gfx942; tree verify, ReplaySSM and other GPUs stay on Triton. The Qwen3.8 launch script selects it.
yicyang
marked this pull request as ready for review
November 20, 2026 04:03
apinge
approved these changes
Nov 20, 2026
Collaborator
Author
|
PR #111 routes Qwen3.8 GDN decode, MTP verify and the prefill front end through aiter FlyDSL kernels on gfx942. Both runs use the same Qwen4 MI308X CI workflow (
Takeaways
|
sammysun0711
approved these changes
Nov 20, 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.
On gfx942, Qwen3.8-Flash-Next GDN (linear attention) decode, MTP target verify and prefill now run on aiter FlyDSL kernels (apinge/aiter#11).
How to enable
On by default in
evaluation/launch_qwen38_flash_next_fp8_mi308x_pure_tp_4_or_8_or_2.sh. For other launches, use the existing flags (no new env vars):LINEAR_ATTN_PREFILL_BACKEND=tritonturns the prefill part off.GDN kernel dispatcher: decode=FlyDSLGDNKernel, ..., verify=FlyDSLGDNKernelandGDN: using aiter FlyDSL decode / target verify / prefill front end ....Design
FlyDSLGDNKernelsits behindGDNKernelDispatcherand reuses the existing fused proj/conv protocol (the model hands(projected_qkvz, projected_ba)to the backend, which returns(core_attn_out, z)).Decode
Per layer, TP2, bs 8, from a serving torch profile:
.contiguous()fused_qkvzba_conv1d_gated_delta_rule_decode_flydsl, 1 kernel, 15.9 uscat(q, k, v)CatArrayBatchedCopy, 6.2 us_causal_conv1d_update_kernel, 5.8 usfused_recurrent_gated_delta_rule_packed_decode_kernel, 26.2 us_layer_norm_fwd_1pass_kernel, 5.5 usDecode step: GDN kernels go from 2.17 to 0.77 ms, and step time from 15.35 to 13.81 ms (-10%).
MTP target verify
Per layer, TP2, bs 8, 4 draft tokens, from a serving torch profile (EAGLE 3/1/4):
cat(q, k, v)fused_qkvzba_conv1d_gated_delta_rule_verify_flydsl, 1 kernel, 28.6 us_causal_conv1d_update_kernel, 5.4 usfused_sigmoid_gating_delta_rule_update_kernel, 34.1 usMTP cycle (draft + verify): GDN verify kernels go from 2.15 to 1.03 ms, and cycle time from 23.67 to 22.39 ms (-5.4%). The recurrence steps run at the write bandwidth (each step writes a 64 KB fp32 state per head); accept length is unchanged.
Prefill
Per prefill step (36 layers), TP2, 8 x 12000-token requests:
cat(q, k, v)CatArrayBatchedCopy, 12.4 msflydsl_gdn_prefill_front, 1 kernel, 13.6 ms_causal_conv1d_fwd_kernel, 22.8 msfused_qkv_split_gdn_prefill_kernel, 5.0 msl2norm_fwd_kernelx2, 3.8 mschunk_fwd_kernel_o_opt_vk(BK=32, BV=64), 25.6 msfused_gdn_gating_kernelPrefill step: 836 to 787 ms (-5.9%).
E2E
Setup:
launch_qwen38_flash_next_fp8_mi308x_pure_tp_4_or_8_or_2.sh(SP + SDMA, MTP off), 12000 in / 350 out.With MTP on (the launch script as is:
MTP=1, EAGLE 3/1/4), TP2, interleaved runs (base 2, Triton-verify 4, this PR 4):A second, later set on the same node (slower overall, base 3 / others 2 runs) gives the same picture: QPS +5.8% / +5.4% vs base, verify alone +2.1% / +1.5%. Accept length is unchanged (3.46 base, 3.49 Triton verify, 3.50 PR).
Accuracy:
test/registered/attention/test_gdn_flydsl_gfx942.py, vs the Triton chain (decode, verify, prefill front end): conv caches and intermediate conv windows are bit-exact, SSM and intermediate states are within 1e-5. Inputs the kernels cannot read (e.g. fp16) fall back to Triton bit-exactly.Trace (Before)
Prefill
Decode
MTP verify
Trace (After)
Prefill
Decode
MTP verify