Repository navigation
[MLA] Add FlyDSL FP8 prefill attention - #2191
Merged
Merged
Conversation
gbyu-amd
marked this pull request as draft
September 10, 2026 11:04
Contributor
🏷️ CI GuideRuns automatically on every eligible PR before approval:
Heavy model tests:
|
Use runtime softmax scaling, reuse Q quantization across cached chunks, and consume direct FP8 gather output with device descales. Co-authored-by: Guanbao Yu <Guanbao.Yu@amd.com>
gbyu-amd
force-pushed
the
gbyu/fp8-mla-on-pr2170
branch
from
September 14, 2026 16:09
94a8bb8 to
9102979
Compare
gbyu-amd
marked this pull request as ready for review
September 15, 2026 15:26
Read split NoPE/RoPE K directly in fused QKV quantization and use fused dynamic KV quantization when cached gather outputs BF16. Keep both kernels in triton_fused_qkv_quant.py and preserve direct FP8 gather and error propagation. Validate quantization, graph replay, prefill dispatch, and attention output/LSE against the existing paths. GPU tests and Black/Ruff checks pass.
valarLip
approved these changes
Sep 21, 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.
Adds FlyDSL FP8 MLA prefill attention on gfx950. Enable it with
ATOM_USE_FLYDSL_FP8_PREFILL_ATTN=1(default: off).The FP8 path fuses K NoPE/RoPE concatenation with per-tensor QKV quantization. Q is quantized once and reused across cached chunks. Where supported, FlyDSL gather writes FP8 K/V using descales
max(new_token_descale, 1e-6) * 2; these are estimates for cached K/V and larger outliers saturate. BF16 gather outputs use fused K/V dynamic quantization. Both quantizers live inatom/model_ops/triton_fused_qkv_quant.py, and the layer's softmax scale is passed directly to attention.AITER capability checks are cached per layer. If FP8 MHA is unavailable or the device/model configuration is unsupported, ATOM selects BF16 attention before quantization or FP8 gather and logs a warning once per process. This preserves BF16 Q/K/V for the fallback. FP16 activations and synthetic RoPE-padding configurations also use the normal attention path. If only FP8 gather is unsupported, BF16 gather plus dynamic quantization retains FP8 attention. Kernel execution errors propagate without retry.
ATOM tests its own fused QKV/KV kernels and the capability/fallback policy; AITER kernel correctness remains covered in AITER.
Dependencies
Performance — 2026-09-15
Kimi-K3, c64, TP8/DCP8 on 8 gfx950 GPUs; LMCache 192 GiB, chunk size 1024, max sequences 128 and max batched tokens 8192. Launch arguments and recorded non-FP8 environment settings match the baseline selected by
agentx_best_of.csv:agentx-20260911-115504/c64_lmcache_dcp8. The baseline uses older source revisions.Both runs use the full 3,600-second profiling phase and the original 40-second completion grace period; 707 warmup requests are excluded. Metrics come from
profile_export_aiperf.json; TTFT/ITL percentiles were verified againstprofile_export.jsonl.P90 interactivity = 1000 / ITL P90. FP8 completed 3,134 profiling requests with no errors (baseline: 3,049).
The table uses a full repeat with the same-source compiler cache populated; no new FlyDSL cache artifacts were written during profiling.
Tested commits: ATOM
ec5165bc11c895f41566a8bcbc8b885470b11b51, AITER5188a03c3b2955dac21757e14b772148a37da959.Accuracy — 2026-09-15
Full GSM8K after the performance run, using the same FP8 TP8/DCP8 server configuration: 1,319 questions, 5-shot, concurrency 64, temperature 0, top_p 1, max generation tokens 12,288.
Capability and fallback validation — 2026-09-21
ATOM
55108c6c, AITER84028a316(based on main54ac58bab).