[GLM-5.3] Fuse unquantized KDA projections with attention TP - #39350
Draft
HanHan009527 wants to merge 3 commits into
Draft
HanHan009527 wants to merge 3 commits into
HanHan009527 wants to merge 3 commits into
Conversation
Combine per-prefix eligibility with attention-TP sharding. Preserve original projections for LoRA and class-sensitive quantization configs, and move the CUDA regression to the kernel suite. Adapt the per-prefix eligibility design from linkedlist771 in sgl-project#38254; limit probing to native Fp8Config rather than extending it to class-sensitive configurations.
…m53-bf16-attention-tp
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
GLM KDA projection fusion is disabled when a checkpoint has a quantization config or when attention TP differs from global TP. The GLM-5.3-Flash native FP8 checkpoint keeps the KDA attention projections in BF16, so the global quantization gate excludes otherwise eligible projections. DP attention also needs the fused projections to use the attention group's rank and size.
This draft adapts the per-prefix eligibility design from linkedlist771's #38254 and extends it to attention-TP sharding. The changes overlap directly: #38254 addresses precision eligibility while retaining the TP-equality gate. If it lands first, this branch should be rebased and the overlapping eligibility changes reconciled, retaining the additional attention-TP support and applicable safeguards/tests.
Modifications
Fp8Config; other nonempty configs retain the original projections because a genericLinearBaseprobe cannot represent class-sensitive matching.Accuracy Tests
Measured on clean wheels from baseline
12771786f23190b1845db33366eba09cb5eacf41and candidatea5fe51d52e3b4cf50b0890fb7215625336829a12, with installed source hashes checked. These results compare those fixed commits, not the current moving main branch.This remains a draft: long-context quality differences and the transport error below are unresolved.
Speed Tests and Profiling
Full-model A/B on 2 × 8 H20, P TP8/EP8/PP1 and D TP8/EP8/DP8/PP1. Both roles use Triton / no MoE A2A, Mooncake PD, TileLang BF16 KV, and no MTP or MegaMoE. Prefill CUDA Graph is disabled; decode uses full CUDA Graph with global maximum batch size 128. Both arms use identical launch commands and dependencies.
Every formal request has 65,536 input and 1,536 output tokens. Cold points flush cache and use distinct inputs; warm points use a shared prefilled prefix. Request-set hashes, actual token counts, SSE completion/usage, native cache counters, all P TP/D DP rank coverage, and at least 8 GiB free memory per GPU were checked.
The candidate C128 result is one unchanged replay after the first attempt completed 511/512 requests with one router-to-prefill HTTP 502. The replay completed 512/512; the original failure is retained and its connection-error cause remains unknown. These are observed gains for the complete patch in this configuration, not an isolated attribution to attention-TP support or a universal/statistically established speedup. No deep kernel profiling was performed.
Checklist
CI States
Latest PR Test (Base): ❌ Run #34954199239
Latest PR Test (Extra): ❌ Run #34954199252
Latest PR Test (AMD ROCm 10): ❌ Run #34954199225