Repository navigation
[DSA] Q8KV8 FP8 Sparse Prefill on GLM-5.3-Flash with BF16 KV Cache - #41790
Conversation
…5.3-Flash) Let --dsa-prefill-backend flashmla_sparse_q8 serve GLM-5.3-Flash on SM90: - accept a bf16 KV cache (q and KV are cast to fp8 per call) and route q8 prefill through the RAGGED top-k transform whatever the pool dtype - gather bf16 prefix KV rows into the fp8 buffer (gather_cast_kv_fp8_pad_paged) - pad kpool top-k rows (index_topk + index_kpool - 1) to a multiple of 128, into a persistent -1-filled buffer reused across layers and forward passes; the pad columns are written once at allocation and are what the kernel's -1 clamp reads - admit q8 prefill in the kpool tail guard, for a bf16 pool only - skip the rope segment statically in the fp8 q-prep and KV concat-cast Triton kernels when qk_rope_head_dim == 0 Combinations q8 cannot serve are rejected at construction rather than mid-forward, so a bad flag fails at launch instead of aborting a server that is already taking traffic: - --enable-mixed-chunk: a mixed batch takes the PAGED top-k transform, which belongs to the bf16 kernel - HiSparse: the q8 route hands top-k to the kernel as ragged ids and never binds the page table HiSparse would translate - a packed fp8 KV store for NoPE models, and an fp8 dtype whose pool is not stored packed - the latter leaves the raw 576-dim layout that the bf16 prefix gather cannot read SPLIT_PREFILL and DLLM_EXTEND batches raise from the forward path rather than at launch. Both are flag-gated (--enable-pdmux, --dllm-algorithm), so a launch-time rejection would be the consistent choice; it is left as a follow-up. --dllm-algorithm additionally cannot select this model class. gather_cast_kv_fp8_pad_paged also asserts unit last-dim stride on the source, matching its sibling, since the gather passes only stride(0) and would otherwise read the wrong elements under a future layout change; it imports its Triton helper lazily so that sglang.kernels does not pull in sglang.srt at import time. No CUDA kernel or wrapper change. fp8-KV behaviour for DeepSeek-V3.2, GLM-5.2 and DeepSeek-V4 is unchanged: the top-k transform predicate differs in exactly one cell (flashmla_sparse_q8 with a non-fp8 pool on an extend batch), the prefix gather and widths are identical, and the ROPE>0 Triton paths trace to the same IR.
…ported yet The launch-time rejection of flashmla_sparse_q8 over a packed fp8 pool on a NoPE model (qk_rope_head_dim=0) gave a reason that no longer holds: the fp8 prefix gather now infers a zero-width rope tail. The rejection stays, because that combination has not been validated through the q8 prefix gather and the KPool tail guard stays closed for fp8 pools; the comment, the error text and the test comment now say it is not supported yet.
…ct#41790 Adds the PR reference the option needs before it is usable from a release, matching the Breakable Cuda Graph option's hint, and notes that the per-layer speedup is the same at TP8's 8 local heads.
The bf16-pool prefix gather delegated to the shared get_mla_kv_buffer kernel, which runs one program per token: 131072 CTAs at a 128k context, each moving 1.5 KB behind a two-deep pointer chase. The fp8 pool already carries the batched form in this file; the bf16 pool never got it. When head_dim == nope_dim the source and destination rows are both one contiguous run, so the gather, the store-cast and the -1-sentinel pad zeroing collapse into a single kernel reusing _GATHER_TOKENS_PER_PROG. Other geometries keep delegating, so the rope path is untouched. Measured on one H200, page_table_1_flattened of 131072 rows, one process, the two versions alternated, median of 200 iterations after 20 warmup: scattered paged table 99.94 us -> 65.38 us (-34.6%) sequential table 99.84 us -> 64.30 us (-35.6%) Raising TOKENS_PER_PROG to 8 gained nothing further, and launching the existing kernel with num_warps=1 -- same access width, same CTA count -- recovered only 4.2%, so CTA count is what binds here, not access width. Output is byte-identical to the previous path for sequential, scattered and duplicated slot ids, and for row counts not divisible by the batch (1, 3, 7, 333, 8189, 8191, 131069, 131071); pad rows are zeroed in every case. In the TP4 shape -- 16 local heads, s_q 4096, kv_len 131072, top-k padded to 2176 -- the gather falls from 82.36 us to 46.23 us per DSA prefill call and the separate pad-zero launch disappears, a 1.8% saving on the whole call. End to end on 4x H200 (12 rows, both run orders averaged) the difference is within noise, -0.16% to +0.27%. Models with a rope tail (d_qk 576) keep the previous path; their timing and outputs are unchanged.
Re-measured on the final code with the same server flags at TP4/EP4 and TP8/EP8: per-layer 1.53-1.72x at 8 and 16 local heads and 1.79-1.98x at 64; end to end on H200 with 1-token outputs, 11.16-12.44% (TP4/EP4) and 5.82-12.06% (TP8/EP8) higher total token throughput, and 8.37-10.97% and 6.06-11.28% lower single-request TTFT at 8,000-120,000 input tokens.
1e78385 to
b288ffe
Compare
…her pairings Bring the cookbook paragraph, the deployment-panel hint, the attention-backend table row and the benchmark-entry comment to the form the neighbouring entries use: one measured clause (H200, prefill-only requests), the build requirement stated the way the other options state it, and no per-configuration detail.
BBuf
left a comment
There was a problem hiding this comment.
The long-context accuracy results are useful, but they come from an earlier revision. Could we rerun the targeted kernel/routing tests and one accuracy regression on the current head, covering prefix reuse with sparse prefill actually active? Please record the commit and software versions; there is no need to repeat the full performance matrix.
| ) | ||
| q_rope = q_rope.split([256, rope], dim=-1)[1] | ||
| dst = torch.zeros(tokens + 3, 64, NOPE + rope, dtype=FP8, device="cuda") | ||
| _bytes(dst[:, :heads]).fill_(0x7F) |
There was a problem hiding this comment.
Non-blocking: for heads=8, _bytes(dst[:, :heads]) calls contiguous(), so fill_ poisons a copy. Could we poison the original destination buffer directly?
There was a problem hiding this comment.
Done in 8523daa: the poison now writes through dst[:, :heads].view(torch.uint8) in place, since _bytes() copied the strided slice for heads < 64. The test still passes.
For heads < 64 the destination slice is strided, so _bytes() copied it and the 0x7F fill landed on the copy. View the slice as uint8 in place instead.
@BBuf Thanks for the review. I merged current main into the branch and re-ran everything on the new head 73bc199 (main d62b9c2). The only change since your approval besides the main merge is the test fix for your comment (8523daa, test-only). Software: torch 2.14.1+cu130 (CUDA 13.0), Triton 3.8.0, FlashInfer 0.7.0.post1, sglang-kernel 0.4.9, 8x H200. Targeted kernel / routing tests ( Accuracy with prefix reuse and the sparse prefill active. GLM-5.3-Flash with CI's H200 flags (
As you suggested, I did not re-run the performance matrix. Could you take another look and re-approve when you have a moment? |
|
/rerun-failed-ci |
* [diffusion] perf: pipeline MiniMax-H3's Ulysses exchange against cuDNN SDPA on Blackwell (sgl-project#43373) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] fix: fail MiniMax-H3 quality="high" closed on substituted DiT weights (sgl-project#34978) Co-authored-by: Claude Opus 5 <[email protected]> * [diffusion] Z-Image: autotune the shared transformer block at both token scales (sgl-project#35755) * [DSv4.1] Initialize the full-to-SWA mapping for request-window pools (sgl-project#43165) * [Dsv4.1] Add DeepSeek V4.1 DSPARK TP and DP EP accuracy coverage (sgl-project#43478) * [Refactor][TCPCG] Retire backend selection and configuration (3/9) (sgl-project#42287) * [CI] Remove the GLM-5.3-Flash PTX KDA prefill nightly test (sgl-project#43470) Co-authored-by: Mohammad Angkad <[email protected]> * Clamp default decode CUDA graph max_bs to max_running_requests (sgl-project#43172) * [Model Loader] Add InstantTensor loader support (sgl-project#40453) * [CI] Fix Python 3.10 failure in prefill complete integration test (sgl-project#43505) * [diffusion] fix: keep a LoRA unmerged under merge_mode auto when merging would round its update away (sgl-project#43385) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [AMD] Resolving bug in per batch size graph capture due to multiple capture runs per batch size (sgl-project#39840) Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Cursor <[email protected]> Co-authored-by: HAI <[email protected]> * [AMD][CI] Drop removed tp_rank/tp_size kwargs from small-M FP8 proj test (sgl-project#43318) * [AMD] Add an opt-in AITER CK blockscale GEMM for gfx942 block-FP8 linears (sgl-project#41071) Signed-off-by: siliangchen-amd <[email protected] * [CI] Drop CPU tests with no bug-catching signal and run Rust workspace tests in their own workflow (sgl-project#43503) * [rust-server] preserve PD routing in chat and completions (sgl-project#42989) Signed-off-by: Sage Ahrac <[email protected]> * [AMD][CI] Cap pyarrow below 26 for lmms-eval (sgl-project#43547) * [Rust] Upgrade sglang-radix-tree to PyO3 0.29 (sgl-project#42807) Co-authored-by: colleen-tml <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [CI] Fix EAGLE3 CUDA parity prefill chunk alignment (sgl-project#43538) * [diffusion] perf: pipeline every USPAttention Ulysses path's exchange over the copy engine (sgl-project#43521) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] perf: run head_dim-128 QK-norm + RoPE two rows per warp for every RoPE layout (sgl-project#43508) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [Responses] Fix max_output_tokens overestimate on multimodal requests (sgl-project#35524) * [HiSparse] Avoid host synchronization in eager backup (sgl-project#41446) * [MemCache] refactor: require an anchored lock receipt for non-root releases (sgl-project#41452) * [HiCache] Add staged write-back for the page-unified KV cache layout (sgl-project#39606) * [kv-shard 3/4] Enable Control Plane C (sgl-project#40102) * [Docs] Document Qwen3-4B/8B H200 mixed-chunk latency tradeoffs (sgl-project#43551) * [Docs] Let the Qwen3 B300 recipe use the default attention backend (sgl-project#43554) * [HiCache] Keep protected cgroup page cache charged in host budgets (sgl-project#42788) Co-authored-by: Ke Bao <[email protected]> * [Scheduler] Use committed length in spec mamba track boundary check (sgl-project#43029) Co-authored-by: Ke Bao <[email protected]> Co-authored-by: Shuwen Wang <[email protected]> * [Refactor] Record what a bound stage path does instead of reading it back (sgl-project#43453) * [Fix] Keep residual rows and sums consistent across appends and pipeline handoffs (sgl-project#43454) * [Refactor] Make residual read and update capabilities explicit and checked (sgl-project#43455) * [Refactor] Decide input-scattered eligibility and stage rejections in one place (sgl-project#43456) * [Refactor] Bind a layer stack in one pass over each stage's data flow (sgl-project#43457) * [Refactor] Decide an exit's fixed facts when the stage is built (sgl-project#43458) * [Refactor] Declare pipeline neighbours from a shared declaration function (sgl-project#43459) * [Refactor] Declare every model's stages from a shared function and drop the meta-device neighbour build (sgl-project#43460) * [CI] Fix Kimi-Linear DCP PD test startup (sgl-project#43598) Co-authored-by: Mohammad Angkad <[email protected]> * [Model] Keep gpt-oss router logits batch-invariant under deterministic inference (sgl-project#43624) * [Dsv4.1] Mega-mhc integration (sgl-project#42808) Co-authored-by: Yuwei An <[email protected]> Co-authored-by: kpham-sgl <[email protected]> * [diffusion] fix: accept request-level profiling on the image API (sgl-project#43573) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] feat: declare regional compile regions for flux (sgl-project#43575) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] feat: bind each GPU worker to its GPU's NUMA node (sgl-project#43565) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] feat: warn instead of disabling on unvalidated models for BCG(sgl-project#43568) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] feat: keep the TP all-reduce inside the graph (sgl-project#43602) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] fix: keep exported buffers out of expandable segments for IPC all-to-all(sgl-project#43584) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] fix: skip QKV packing while layers are offloaded (sgl-project#43576) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] perf: add the dynamic LoRA delta inside the second GEMM (sgl-project#43501) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] CI: skip the LTX-2 RMSNorm-modulation guard test off the CUDA platform (sgl-project#43574) Co-authored-by: Mick <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] fix: skip inductor's saved multi-kernel pick for torch.compile (Z-Image warm starts crash or hang) (sgl-project#43601) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] comfyui: fail early instead of silently dropping features in SGLD integrated mode (sgl-project#43495) Co-authored-by: OnePunchMonk <[email protected]> * [Fix] Reserve remaining tokens for ignore_eos requests during prefill admission (sgl-project#43564) * [DSA] Support TileLang FP8 KV cache on CUDA (sgl-project#42957) Co-authored-by: Xiaoyu Zhang <[email protected]> * fix: wait for HiCache load-back before hybrid MLA KV reads (sgl-project#38217) Co-authored-by: zhouzechun <[email protected]> Co-authored-by: alphabetc1 <[email protected]> * [diffusion] fix: keep the overlay probe from stalling cached startup (sgl-project#43590) * [diffusion] fix: serve whole graphs after offload-during-compile (sgl-project#43631) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] Support LLaDA-Image BF16 generation and editing (sgl-project#37907) * [PD][HiCache] Fold the decode restore outcome into the MIN-reduced KV poll (sgl-project#43562) Co-authored-by: Kevin Flansburg <[email protected]> * [diffusion] perf: keep Qwen-Image-2.1 and Ulysses graphs whole (sgl-project#43586) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] perf: keep Cosmos3's fused kernels in the graph (sgl-project#43577) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] fix: Qwen-Image BCG prompt padding misses every graph and attends the pad (sgl-project#43632) Co-authored-by: Mick <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] fix: replay Qwen-Image-2.1 BCG graphs across prompt lengths (sgl-project#43633) Co-authored-by: Mick <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] perf: run the attention section eager under torch.compile for MiniMax-H3 (sgl-project#43634) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [1/N][DSv41] Enable DP attention with MegaMoE (sgl-project#43228) * [diffusion] comfyui: consolidate FluxAdapter correctness fixes (sgl-project#43490) Co-authored-by: niehen6174 <[email protected]> * [diffusion] comfyui: consolidate executor conditioning-cache fixes (sgl-project#43492) Co-authored-by: niehen6174 <[email protected]> * [Scheduler] Keep waiting-prefix LRU refresh consistent across TP ranks (sgl-project#43479) * [Perf] Fuse BF16 writes to native HND KV cache storage (sgl-project#43237) Co-authored-by: Claude Opus 5.5 <[email protected]> * [diffusion] Don't report video jobs completed after their outputs are deleted (sgl-project#43084) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Xiaoyu Zhang <[email protected]> * [GDN] Fix CuTe DSL decode to read the [N, HV, V, K] state layout (sgl-project#43332) Co-authored-by: Xiaoyu Zhang <[email protected]> * [KDA] Support Helion MTP verification and harden prefill, decode (sgl-project#42857) * [AMD]Qwen add Sparse attention to capturing hip graphs (sgl-project#43383) * [Spec] Allow Qwen3.5 backends to opt into packed target verification (sgl-project#43037) * [qwen 3.8 next] Fuse QSA prefill KV gathering and dtype conversion (sgl-project#41933) * [Scheduler] Requeue preempted requests when admission admits nothing (sgl-project#43298) * [Test] Do not hang scripted-runtime teardown when the server died (sgl-project#43285) * [KV canary] Expect sweep counters on the target runner only (sgl-project#43286) * [Scheduler] Hold back decode rows on a mixed step when they do not fit the KV pool (sgl-project#43290) * [Sampler] Sort only the max(top_k) leading columns in the torch sampler (sgl-project#43346) * [Scheduler] Keep a DP-converted decode batch as the running batch (sgl-project#43283) * [kvevents] fix missing topics in replayed kv events (sgl-project#43386) Signed-off-by: Sage Ahrac <[email protected]> * [DeepSeek-V4.1] Use num_stages=1 for the hc_mix stats partial kernel (sgl-project#43070) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Yuan Luo <[email protected]> * [VLM] fix: repair multimodal VMM lease cleanup and source-stream ordering (sgl-project#43475) Co-authored-by: Mick Qian <[email protected]> * [Diffusion] Add ModelOpt FP8 checkpoint quantization for Pi0.5 (sgl-project#43062) Co-authored-by: Mick Qian <[email protected]> * fix: default Inkling to fa4 on Hopper (sgl-project#35292) * [BugFix][DP] Prevent health checks from perturbing user request routing (sgl-project#35721) Signed-off-by: Phoenix3334 <[email protected]> * [Unified Radix] Invalidate lazy Mamba checkpoints before in-place tracking (sgl-project#43567) * [diffusion] perf: encode LTX video/audio through the shared bounded MP4 path (sgl-project#43656) Co-authored-by: Mick Qian <[email protected]> * [HiCache] Keep storage workers alive on backend exceptions (sgl-project#43550) * Build Mamba host pools from device buffer infos (sgl-project#43596) * Share MLA host capacity initialization (sgl-project#43595) * Preserve serialized page dtype in NIXL copy fallback (sgl-project#43593) * [diffusion] fix: select VSA-H3 for FastH3 when no transformer backend is given (sgl-project#43690) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [KV Events] Publish LoRA adapter names and namespaced block hashes (sgl-project#42455) Signed-off-by: Banruo Liu <[email protected]> Co-authored-by: Shangming Cai <[email protected]> * [DSpark] Run every markov head through one step interface (sgl-project#43620) * [DSpark] Add `MarkovSampleStep`, one op for a markov draft step's add and token pick (sgl-project#43621) * [DSpark] Draft the eager markov block through `MarkovSampleStep` (sgl-project#43622) * [DSpark] Run the same markov block in the draft graph tail; drop `SGLANG_DSPARK_FOLDED_SAMPLING` (sgl-project#43668) * [DSpark] Merge the draft TP sync sites into `dspark-draft` (sgl-project#43669) * [DSpark] Add `SGLANG_DSPARK_USE_GREEDY_DRAFT`, an argmax draft accepted as one-hot (sgl-project#43670) * [DSpark] Apply `SGLANG_SIMULATE_ACC_LEN` inside the accept instead of switching paths (sgl-project#43623) * [diffusion] fix: shard Qwen-Image adaLN modulation and text FFN under TP (sgl-project#43691) * [diffusion] perf: layerwise offload for the LTX-2.5 Gemma-4 text encoder (sgl-project#43683) * [diffusion] perf: split and batch LTX-2.3 one-stage guidance passes under CFG parallel (sgl-project#43684) Co-authored-by: Mick Qian <[email protected]> * [Fix] Initialize BF16 GEMM dispatch in the one-batch benchmark (sgl-project#43702) * Fix Mistral-native format detection when the Hub is unreachable (sgl-project#43446) * [MoE] Skip block-padding rows in the TMA down activation and quant (sgl-project#42212) * [MemCache] Split the SWA mapping move out of locked-full recovery as `RecoverEvictedSWA` (sgl-project#43721) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: Jialin <[email protected]> * [Rust] Lock hyper 1.12.0 and want 0.3.2 in the rust workspace (sgl-project#43724) Co-authored-by: hanminglu <[email protected]> Co-authored-by: shodoco <[email protected]> * [MemCache] Add shared component size and path APIs to the tree core interface (sgl-project#43722) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: Jialin <[email protected]> * [CI] Fix TestQwenImageModulationCache after Qwen-Image modulation sharding (sgl-project#43747) Co-authored-by: Claude Opus 5.5 <[email protected]> * [Bugfix] Preserve available host memory for integrated MUSA devices (sgl-project#43398) Signed-off-by: Xucheng Zhou <[email protected]> * [Tokenizer] Require fastokens>=0.3.2 and include it in the all extra (sgl-project#43104) * [AMD][V4.1][*/N] Fix DP attention + TP MoE decode NaN and support bounded replay (sgl-project#43077) Co-authored-by: wunhuang <[email protected]> Co-authored-by: HAI <[email protected]> * Support kv cache sharding for DSA indexer (sgl-project#40925) * [AMD][MORI] Add MORI EP V2 support (sgl-project#40666) * [PD] Retract transferred decode requests on a retract pause (sgl-project#43757) * [DSV4.1] Reduce eager Engram extend preparation (sgl-project#42159) Co-authored-by: Shangming Cai <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [Test] Re-anchor the VLM flashinfer throughput floor (sgl-project#43762) Co-authored-by: Mohammad Angkad <[email protected]> * [Fix] scheduler: stop latching batch_is_full when nothing can run (sgl-project#41872) Co-authored-by: hnyls2002 <[email protected]> Co-authored-by: Liangsheng Yin <[email protected]> * [RL] Return a failed weight update when the cache flush is refused (sgl-project#43758) * [CI] Skip eval retries in the PD transfer-failure test (sgl-project#43769) * docs: sync LMSYS SGLang blog cards (sgl-project#43462) Co-authored-by: sglang-bot <[email protected]> * [Deps] Bump FlashInfer to 0.7.1 (sgl-project#43494) Co-authored-by: Mohammad Angkad <[email protected]> * [XPU CI] Optimize PR CI per-file timeouts and fail hanging tests fast (sgl-project#42048) * [Fix] Adapt to transformers 5.18 / 5.19 changes (sgl-project#43688) Co-authored-by: Mohammad Angkad <[email protected]> * [diffusion][xpu] FLUX.2: enable the bit-exact Triton SwiGLU on XPU (sgl-project#41940) Co-authored-by: Claude Opus 5 <[email protected]> Co-authored-by: Mick Qian <[email protected]> * docs: clarify prefill CP terminology and simplify wording (sgl-project#43787) * [Fix] Link cuda_ipc JIT against CUDA driver stubs dir (sgl-project#43764) * [Perf] Route BF16 mixed-batch decode tails through decode attention (sgl-project#43238) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Xiaoyu Zhang <[email protected]> * [PD] Poison the deferred abort ack when a Mooncake send fails (sgl-project#43719) Co-authored-by: Claude Fable 5.1 <[email protected]> * [HiCache] Support Mamba in buffer-only host memory mode (sgl-project#36345) * [HiCache] Preserve all MTP KV and recurrent state (sgl-project#40223) Co-authored-by: alphabetc1 <[email protected]> Co-authored-by: Shuwen Wang <[email protected]> * [CI] Move tests that do not need GB300 off the per-PR GB300 suite (sgl-project#43784) Co-authored-by: Mohammad Angkad <[email protected]> * Capture KV host transfer buffers (sgl-project#43711) * Keep NIXL Mamba checkpoint keys separate by TP rank (sgl-project#43594) * [XPU] Support decode context parallelism (DCP) on Intel XPU (sgl-project#34355) Co-authored-by: Siju Samuel <[email protected]> * [BCG][DSV4-Flash][CP] Support DeepSeek V4 prefill with interleave CP and breakable CUDA graphs (sgl-project#38603) * [DSV4.1][PD][1/N] Support prefill node use cp parallel strategy (sgl-project#40323) * [Docs] Update GLM-5.3-Flash playground: B300 default, CP8, EP and PD (sgl-project#43802) * [Docs] Cookbook: refresh SemiAnalysis AgentX launches (GLM-5.2 B300, DeepSeek-V4.1 GB300) (sgl-project#43799) Co-authored-by: Claude Opus 5.5 <[email protected]> * [NPU] Stabilize HiCache and registered CI tests (sgl-project#43308) * [sgl-router] Serve the Anthropic Messages API on /v1/messages (sgl-project#42316) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> * [Fix] Make tokenizer request-state initialization atomic (sgl-project#41911) Co-authored-by: Cheng Wan <[email protected]> * [XPU] Upgrade XPU backend to PyTorch 2.14 (sgl-project#42003) Co-authored-by: Ashwini Rathi <[email protected]> Co-authored-by: Y <[email protected]> Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]> * [PD][Spec] Give a PD decode's first EAGLE draft step a proposal distribution (sgl-project#41783) Co-authored-by: Shangming Cai <[email protected]> * [Fix] Adapt NPU Qwen-VL processor patch to transformers 5.19 resize() signature change (sgl-project#43309) * [NPU] Diffusion CI fixes (sgl-project#43210) * [diffusion] chore: bind worker CPUs to the GPU's NUMA node when memory policy is not permitted (sgl-project#43756) Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [CI][Diffusion] Add caching for npu GT images in CI (sgl-project#37426) Co-authored-by: Артем Савкин <[email protected]> * [QSA] Bound the decode indexer's work by the context length (sgl-project#43463) Co-authored-by: luoyuan.luo <[email protected]> * Prebuild fixup_zero_kv JIT module at TRTLLM-MLA backend init (sgl-project#37525) Co-authored-by: Claude Fable 5 <[email protected]> * [Unified Cache] Abort requests whose external linker load fails instead of crashing the scheduler (sgl-project#40896) * [DSpark] Share draft params, logits dtype, confidence and the accept tail between graph and eager (sgl-project#43790) * [DFlash] Decide the Domino candidate pool in one place and apply simulated acceptance inside the accept (sgl-project#43791) * Fix autograd retention in CUDA graph capture tail hooks (sgl-project#43854) * [ROCm] Eliminate HiCache migration stalls and use exact-size host allocations (sgl-project#42553) Signed-off-by: JohnQinAMD <[email protected]> Co-authored-by: JohnQinAMD <[email protected]> * [AMD] Keep the FP4 varctx schedule test off AITER's 2048-row compile (sgl-project#41793) * [AMD] Add flydsl mxfp8 dense gemm kernel for dpsk v4.1 prefill (sgl-project#43803) * [AMD] Fix test_compact_attention_hip.py CI (sgl-project#43836) * [AMD] [Docker] Update MoRI to v1.2.4 (sgl-project#43834) * [Kernel] Expose bundled FlashMLA MegaAttention kernels and APIs (sgl-project#43918) * [DeepSeek-V4.1] Admit the NIXL transfer backend for DSpark PD (sgl-project#43734) * [AMD] Recalibrate test_quark_mxfp4 GSM8K thresholds to observed MI355X noise (sgl-project#41980) * [DSV4][CP] Write low-ratio page indices when CP prefill runs paged attention (sgl-project#43935) * [Build][CI] Drop Python 3.10: require Python 3.11+ and run CUDA CI on Python 3.12 (sgl-project#43021) Co-authored-by: Mohammad Angkad <[email protected]> Co-authored-by: Mohammad Miadh Angkad <[email protected]> * [DeepSeek-V4.1] mHC: drop seam_open, narrow precomputed stats in take_rows (sgl-project#43833) Co-authored-by: Claude Opus 5.5 <[email protected]> * [DSv4.1] Reduce sparse-prefill workspace padding (sgl-project#43921) * [HiCache] Avoid full-store scans for uncached file prefix lookups (sgl-project#42077) Signed-off-by: apex-mochen <[email protected]> Co-authored-by: apex-mochen <[email protected]> Co-authored-by: Zhiqiang Xie <[email protected]> * [Fix] Preserve HTTP errors for non-streaming /v1/messages (sgl-project#43796) Co-authored-by: Xinyuan Tong <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> * [DSv4.1] Temporarily disable B300 PD/CP accuracy test (sgl-project#43948) * [PD] Recompute retracted DeepSeek-V4 requests on prefill instead of crashing decode (sgl-project#43936) * [Fix] Account for captured inputs in DeepGEMM masked workspace budget (sgl-project#43563) * [AMD] Update v4 amd cookbook 1012 (sgl-project#43962) * [CI] Remove Mistral Small 4 e2e test (sgl-project#43973) Co-authored-by: Mohammad Angkad <[email protected]> * Reuse Hugging Face LFM2-MoE configuration (sgl-project#43939) Co-authored-by: Codex <[email protected]> * fix(openai): honor tool_choice=none in DeepSeek encoders (sgl-project#43006) Co-authored-by: ai-jz <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> * [diffusion] comfyui: run MiniMax H3, FastH3 and VDN in SGLD integrated mode (sgl-project#43504) * [diffusion] fix: keep MiniMax-H3 VAE fused norms off ROCm (sgl-project#43350) * [diffusion] fix: avoid redundant LoRA scaling while preserving exact numerics (sgl-project#43028) Co-authored-by: Mick Qian <[email protected]> * tokenizer perf optimization (sgl-project#39771) Co-authored-by: BBuf <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> * [diffusion] perf: implement paint_use_remesh (decimate to 40k faces before UV unwrap) for Hunyuan3D (sgl-project#42770) Co-authored-by: Mick Qian <[email protected]> * [AMD][Kimi-K3] Use public FlyDSL APIs in KDA decode kernels (sgl-project#43968) Co-authored-by: wunhuang <[email protected]> * [AMD] Fix Flux2 kv-gather abort on non-contiguous K/V (sgl-project#43793) Co-authored-by: Mick Qian <[email protected]> * [AMD] Fuse prefill index-Q RoPE fake-quant and fp4 quantize kernels in DSV4.1 (sgl-project#42911) * [AMD][DI][CI] dsv4pro-fp8 2p1d-ep16-mtp: raise prefill mem fraction for MORI EP v2 memory (sgl-project#43944) * [router] Fix power_of_two with --dp-aware (sgl-project#42027) * [ROCm][Spec] Route NGRAM tree reconstruction to the JIT kernel on HIP (sgl-project#43328) Co-authored-by: Cursor <[email protected]> Co-authored-by: Thomas Wang <[email protected]> * [PD] Support heterogeneous TP for hybrid SWA KV transfer (sgl-project#40909) * [Diffusion] Speed up LTX-2 guidance and video output (sgl-project#43667) * [AMD][PD] enable mori transfer for PD decode DCP (sgl-project#37358) Signed-off-by: inkcherry <[email protected]> Co-authored-by: Duyi-Wang <[email protected]> Co-authored-by: HAI <[email protected]> Co-authored-by: Shangming Cai <[email protected]> * [Docs] Cookbook: refresh SemiAnalysis AgentX launches (DeepSeek-V4.1 GB200/GB300, GLM-5.2 FP8 B300) (sgl-project#43983) Co-authored-by: Claude Opus 5.5 <[email protected]> * [PD][NIXL] Fix staging buffer startup by accepting slot_layer_ids (sgl-project#43723) Co-authored-by: Po-Han Huang (NVIDIA) <[email protected]> * [router] power_of_two: in-flight request load for --dp-aware decode (sgl-project#43483) * [Perf] Enable fast-math for JIT activations on Blackwell (sgl-project#43236) Co-authored-by: Claude Opus 5.5 <[email protected]> * [NVIDIA][MegaMoE] Fix the default spec decoding moe backend when the target model uses flashinfer megamoe (sgl-project#40772) Co-authored-by: Po-Han Huang (NVIDIA) <[email protected]> * [HiCache][PD] Allow DSA index-K elision under HiCache and disaggregation (sgl-project#41769) Co-authored-by: Anish Shanbhag <[email protected]> * [CI] Use sgl-eval for GLM-5.3-Flash GSM8K tests (sgl-project#43975) Co-authored-by: Mohammad Angkad <[email protected]> * [FlashInfer] Add startup autotuning for MegaMoE (sgl-project#43789) * [Perf] Compact GDN causal-conv grids for skewed prefill batches (sgl-project#43570) * [AMD][CI] Run test_tracing.py in the extra tier, matching CUDA (sgl-project#43928) Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]> * Fix EVS for NemotronH_Omni_Reasoning_V3 (sgl-project#42933) Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Po-Han Huang (NVIDIA) <[email protected]> * fix(multimodal): convert grayscale tensors to RGB in PIL backend (sgl-project#42127) Co-authored-by: 周云昊 <[email protected]> * [diffusion] comfyui: run Qwen-Image 2.1 in SGLD integrated mode (sgl-project#43581) * [diffusion] feat: add configurable reference image resizing for MiniMax H3 Ref2VA (sgl-project#35839) Co-authored-by: Mick Qian <[email protected]> * Fix/compressed tensors nvfp4 hopper (sgl-project#40022) Co-authored-by: Claude Opus 5 <[email protected]> * [NPU] [DOC] update kimi k3 cookbook and supported features on NPU (sgl-project#44052) * [DSA] Q8KV8 FP8 Sparse Prefill on GLM-5.3-Flash with BF16 KV Cache (sgl-project#41790) Co-authored-by: Xiaoyu Zhang <[email protected]> * [CI] Run test_pi05_modelopt_fp8_cuda in the kernel-unit lane (sgl-project#44055) Co-authored-by: Claude Opus 5.5 <[email protected]> * fix(openai): omit absent tool_calls from chat responses (sgl-project#43027) Co-authored-by: ai-jz <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> * Skip fully-masked KV tiles in sliding-window extend attention (sgl-project#39769) Co-authored-by: Cursor <[email protected]> * fix(openai): keep chat stream created timestamp stable (sgl-project#43026) Co-authored-by: ai-jz <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> * fix(openai): preserve zero cached tokens when cache reporting is enabled (sgl-project#43005) Co-authored-by: ai-jz <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> * [AMD][DI][CI] glm52 2p1d-ep16: capture CUDA graph on decode (eager decode is too slow) (sgl-project#43977) * [AMD][DI][CI] kimik26 2p1d-ep16: capture CUDA graph on decode (eager decode is slow) (sgl-project#43985) * [perf] [multi-lora] remove empty CTAs from fused LoRA expand and add split-K to shrink (sgl-project#41951) Co-authored-by: Yanbin Jiang <[email protected]> * Rainj me/rust bench (sgl-project#43950) * [Observability] Report per-request storage prefetch and staging waits in meta_info (sgl-project#43946) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: xiezhq-hermann <[email protected]> * [lora] Support LoRA for the NemotronH_Nano_VL_V2 model family (sgl-project#39798) Co-authored-by: Claude Opus 5 (1M context) <[email protected]> Co-authored-by: Po-Han Huang <[email protected]> Co-authored-by: Yanbin Jiang <[email protected]> * [Rust] Refuse an unsupported multimodal model before the Rust listener binds (sgl-project#43925) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: shodoco <[email protected]> * [Core] Keep request priority within the signed 64-bit range in radix caches (sgl-project#43920) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: qandrew <[email protected]> * [DCP] Decode context parallelism for DSA (GLM-5.2 / GLM-5.3) with MTP (sgl-project#43735) Co-authored-by: vincentzed <[email protected]> * [HiCache] Block-group pool hits, caller-owned load destinations, allocation-target FULL eviction (sgl-project#43868) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: xiezhq-hermann <[email protected]> * [Rust] Let an embedding package wrap the frontend HTTP app (sgl-project#43924) Co-authored-by: hanminglu <[email protected]> Co-authored-by: shodoco <[email protected]> * [Core] Add request-level customized_info keys and mark Full prefill capture batches (sgl-project#43772) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: jiayisuse <[email protected]> * [HiCache] Extract the buffer-mode prefetch and load-back lifecycle into pipeline operations (sgl-project#43870) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: xiezhq-hermann <[email protected]> * [unified memory pool] Prefer SWA reclaim quotas with a HiCache storage backend or on PD decode (sgl-project#43919) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: ZYHowell <[email protected]> * [Rust] Serve any `model` name on the OpenAI chat and completions routes (sgl-project#43923) Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: shodoco <[email protected]> * docs: add MiniCPM-V 4.7 cookbook (sgl-project#43829) * [Feature] Add Aaronson-Gumbel text watermarking (sgl-project#37577) Co-authored-by: Nihar Patel <[email protected]> * [HiSparse] Add speculative decoding support with multi-step KV cache swapping (sgl-project#37771) * [gRPC] Move runtime.v1 bindings to tonic 0.14, report OpenAI status codes, return text on request (sgl-project#42673) Co-authored-by: Kan Wu <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> * [DeepSeek-V4.1] Run decoder SWA bounded replay inside the breakable prefill CUDA graph (sgl-project#43736) * fix(benchmark): request token IDs when counting OpenAI prompts (sgl-project#34511) Co-authored-by: Zijie Xia <[email protected]> * Mark FP32 redux asm volatile (sgl-project#44137) * [Score] Send stacked GPU embedding overrides through a CUDA IPC pool (sgl-project#39730) Co-authored-by: Sundara Raman Ramachandran <[email protected]> Co-authored-by: hnyls2002 <[email protected]> * [Feature] Return output top logprobs as flat base64 arrays on request (sgl-project#42890) Co-authored-by: Claude Opus 5.5 <[email protected]> * [DSV4.1] Support decoder SWA bounded replay with CUDA DP attention (sgl-project#43812) * GLM5.2 DSA Indexer Fallback (sgl-project#32947) Co-authored-by: Shu Wang <[email protected]> Co-authored-by: Po-Han Huang (NVIDIA) <[email protected]> * [Fix] Work around a CPython fork deadlock in the CPU preprocess pool (sgl-project#44143) * [DSV4.1] Skip Mega mHC fusion on 0-row (DP-idle) batches (sgl-project#43993) Co-authored-by: Claude Opus 5.5 <[email protected]> * [Chore] release: Cherry-pick [Disagg] Return prompt routed experts from the PD prefill server to release/v0.5.22 (sgl-project#44002) (sgl-project#44212) Co-authored-by: William Arnold <[email protected]> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: ishandhanani <[email protected]> * [Chore] release: Cherry-pick [CI] glm5.2: Temporarily disable PD HiSparse+MTP B300 test to release/v0.5.22 (sgl-project#44192) (sgl-project#44214) Co-authored-by: Mohammad Miadh Angkad <[email protected]> Co-authored-by: Mohammad Angkad <[email protected]> * [XPU] Fix FP8 KV cache support for ModelOpt quantized models (e.g. Llama-3.3-70B-FP8) * [XPU] Add MXFP4 W4A16 MoE inference support for Intel Xe2 (GPT-OSS) Enable MXFP4 quantized inference on XPU using the native Xe2 SYCL fused_experts kernel (sgl-kernel-xpu PR#184). - quantization/__init__.py: register mxfp4 quantization method for XPU - quantization/fp4_utils.py: broaden flashinfer import exception to avoid crash on XPU where flashinfer is unavailable - quantization/mxfp4.py: - align intermediate size to 64 for XPU (create_weights) - skip CPU dequant on XPU; leave weights as packed uint8 in VRAM (process_weights_after_loading) - add XPU dispatch in apply(): call sgl_kernel.fused_experts with use_mxfp4_w4a16=True; convert UE8M0 uint8 scales to float32 via exp2(uint8 - 127); default gemm1_alpha=1.702 / gemm1_limit=7.0 to select activation_type=2 (ACT_SWIGLU_GPT_OSS, interleaved weight layout required by GPT-OSS MXFP4 checkpoints) - models/gpt_oss.py: replace hardcoded .cuda() with .to(get_device()) in weight loading to support XPU * [XPU] Improvement for fp4 and fp8 Optimize FP8 KV cache: lazy mirror buffer to avoid full cast per step Fix MXFP4 MoE: read activation/gemm1 params from model config instead of GPT-OSS hardcoded values * Remove WA for FP8 KV cache * Add analyze support for XPU * [Intel][XPU] Allow mamba extra_buffer radix cache strategy on XPU (#9) Co-authored-by: root <[email protected]> --------- Signed-off-by: siliangchen-amd <[email protected] Signed-off-by: Sage Ahrac <[email protected]> Signed-off-by: Phoenix3334 <[email protected]> Signed-off-by: Banruo Liu <[email protected]> Signed-off-by: Xucheng Zhou <[email protected]> Signed-off-by: JohnQinAMD <[email protected]> Signed-off-by: apex-mochen <[email protected]> Signed-off-by: inkcherry <[email protected]> Co-authored-by: Mick <[email protected]> Co-authored-by: Mick Qian <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Raymond Huang <[email protected]> Co-authored-by: Frederik Gossen <[email protected]> Co-authored-by: YAMY <[email protected]> Co-authored-by: Yuwei An <[email protected]> Co-authored-by: Mohammad Miadh Angkad <[email protected]> Co-authored-by: Mohammad Angkad <[email protected]> Co-authored-by: cctry <[email protected]> Co-authored-by: tao <[email protected]> Co-authored-by: Richard Wang <[email protected]> Co-authored-by: mohbasit <[email protected]> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Cursor <[email protected]> Co-authored-by: HAI <[email protected]> Co-authored-by: chuyeh <[email protected]> Co-authored-by: siliangchen-amd <[email protected]> Co-authored-by: Liangsheng Yin <[email protected]> Co-authored-by: Sage <[email protected]> Co-authored-by: Bingxu Chen <[email protected]> Co-authored-by: colleen-tml <[email protected]> Co-authored-by: colleen-tml <[email protected]> Co-authored-by: Shuwen Wang <[email protected]> Co-authored-by: hhy-seven <[email protected]> Co-authored-by: huangtingwei <[email protected]> Co-authored-by: Shunkangz <[email protected]> Co-authored-by: Xiaoyu Zhang <[email protected]> Co-authored-by: Ke Bao <[email protected]> Co-authored-by: Khoa Pham <[email protected]> Co-authored-by: Cheng Wan <[email protected]> Co-authored-by: Yuwei An <[email protected]> Co-authored-by: Mick <[email protected]> Co-authored-by: WenhaoZhang <[email protected]> Co-authored-by: OnePunchMonk <[email protected]> Co-authored-by: Jzz1943 <[email protected]> Co-authored-by: LoCinder <[email protected]> Co-authored-by: zhouzechun <[email protected]> Co-authored-by: alphabetc1 <[email protected]> Co-authored-by: Shangming Cai <[email protected]> Co-authored-by: Kevin Flansburg <[email protected]> Co-authored-by: Avaya Aggarwal <[email protected]> Co-authored-by: niehen6174 <[email protected]> Co-authored-by: Chunan Zeng <[email protected]> Co-authored-by: SunskyXH <[email protected]> Co-authored-by: Nikolai <[email protected]> Co-authored-by: paulzhang-tm <[email protected]> Co-authored-by: Qiaolin Yu <[email protected]> Co-authored-by: jiaqiang-dot-liu <[email protected]> Co-authored-by: Ziyi Xu <[email protected]> Co-authored-by: Yuan Luo <[email protected]> Co-authored-by: trebladev <[email protected]> Co-authored-by: FeiHong Guo <[email protected]> Co-authored-by: Banruo Liu <[email protected]> Co-authored-by: Alison Shao <[email protected]> Co-authored-by: WangHemeng <[email protected]> Co-authored-by: metamergebot <[email protected]> Co-authored-by: Hanming Lu <[email protected]> Co-authored-by: Jialin <[email protected]> Co-authored-by: hanminglu <[email protected]> Co-authored-by: shodoco <[email protected]> Co-authored-by: Po-Han Huang (NVIDIA) <[email protected]> Co-authored-by: adenzhou1350 <[email protected]> Co-authored-by: weireweire <[email protected]> Co-authored-by: kk <[email protected]> Co-authored-by: wunhuang <[email protected]> Co-authored-by: ChengYM <[email protected]> Co-authored-by: Yufeng He <[email protected]> Co-authored-by: hnyls2002 <[email protected]> Co-authored-by: sglang-bot <[email protected]> Co-authored-by: sglang-bot <[email protected]> Co-authored-by: ashwini rathi <[email protected]> Co-authored-by: Yihao Wang <[email protected]> Co-authored-by: Baizhou Zhang <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> Co-authored-by: Anupa Sajikumar <[email protected]> Co-authored-by: Siju Samuel <[email protected]> Co-authored-by: BingjiaWang <[email protected]> Co-authored-by: Jinyan Yi <[email protected]> Co-authored-by: ybyang <[email protected]> Co-authored-by: C <[email protected]> Co-authored-by: Pavan Sivaram Girijala <[email protected]> Co-authored-by: Ashwini Rathi <[email protected]> Co-authored-by: Sasha Sidorov <[email protected]> Co-authored-by: ming_wang <[email protected]> Co-authored-by: Артем Савкин <[email protected]> Co-authored-by: Alexandr <[email protected]> Co-authored-by: Yuan Luo <[email protected]> Co-authored-by: luoyuan.luo <[email protected]> Co-authored-by: Sam Shleifer <[email protected]> Co-authored-by: ix-48 <[email protected]> Co-authored-by: Zhang, Jiejing <[email protected]> Co-authored-by: JohnQinAMD <[email protected]> Co-authored-by: Michael <[email protected]> Co-authored-by: Thomas Wang <[email protected]> Co-authored-by: Duyi-Wang <[email protected]> Co-authored-by: Yizheng Jiao <[email protected]> Co-authored-by: dingdangmao <[email protected]> Co-authored-by: apex-mochen <[email protected]> Co-authored-by: Zhiqiang Xie <[email protected]> Co-authored-by: Vegetog <[email protected]> Co-authored-by: Xinyuan Tong <[email protected]> Co-authored-by: Piotr Mazurek <[email protected]> Co-authored-by: Codex <[email protected]> Co-authored-by: ai-jz <[email protected]> Co-authored-by: ai-jz <[email protected]> Co-authored-by: Bingoo <[email protected]> Co-authored-by: jacky.cheng <[email protected]> Co-authored-by: Xinyi Song <[email protected]> Co-authored-by: Zhaoyi Li <[email protected]> Co-authored-by: AMD-yanfeiwang <[email protected]> Co-authored-by: Jimmy Shong <[email protected]> Co-authored-by: inkcherry <[email protected]> Co-authored-by: Michal Shalev <[email protected]> Co-authored-by: AMD-yanfeiwang <[email protected]> Co-authored-by: Shu Wang <[email protected]> Co-authored-by: Anish Shanbhag <[email protected]> Co-authored-by: Ziang Li <[email protected]> Co-authored-by: elvischenv <[email protected]> Co-authored-by: Yunhao Zhou <[email protected]> Co-authored-by: 周云昊 <[email protected]> Co-authored-by: LittleNyima <[email protected]> Co-authored-by: jlqibm <[email protected]> Co-authored-by: amote-i <[email protected]> Co-authored-by: Ho-Ren (Jack) Chuang <[email protected]> Co-authored-by: Kailash Ranganathan <[email protected]> Co-authored-by: Yanbin Jiang <[email protected]> Co-authored-by: Rain Jiang <[email protected]> Co-authored-by: xiezhq-hermann <[email protected]> Co-authored-by: Po-Han Huang <[email protected]> Co-authored-by: qandrew <[email protected]> Co-authored-by: vincentzed <[email protected]> Co-authored-by: jiayisuse <[email protected]> Co-authored-by: ZYHowell <[email protected]> Co-authored-by: Nihar Patel <[email protected]> Co-authored-by: Kan Wu <[email protected]> Co-authored-by: Kan Wu <[email protected]> Co-authored-by: Jiaqi Li <[email protected]> Co-authored-by: Zijie Xia <[email protected]> Co-authored-by: Andrew Briand <[email protected]> Co-authored-by: Chuanrui Zhu <[email protected]> Co-authored-by: Sundara Raman Ramachandran <[email protected]> Co-authored-by: HEJIAN SANG <[email protected]> Co-authored-by: Shu Wang <[email protected]> Co-authored-by: shyeh25 <[email protected]> Co-authored-by: Kangyan-Zhou <[email protected]> Co-authored-by: William Arnold <[email protected]> Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: ishandhanani <[email protected]> Co-authored-by: Spurthi Lokeshappa <[email protected]> Co-authored-by: root <[email protected]>
One-line summary:
flashmla_sparse_q8now serves GLM-5.3-Flash on Hopper (SM90): per DSA layer the sparse prefill is 1.53-1.72x faster than tilelang, which on a prefill-dominated workload is +11.16% to +12.44% total token throughput at 3.5k-120k input and 8.37% to 10.97% lower single-request TTFT at 8k-120k at TP4/EP4 (+5.82% to +12.06% and 6.06% to 11.28% lower at TP8/EP8), with no gsm8k few-shot count (1319 questions each) where q8 scores lower than base.TL;DR
flashmla_sparse_q8at all. Launching with it on H200 failed at backend construction (fp8-KV-only guard); relaxing that alone still fails on the KPool tail guard, the 2051-wide KPool top-k (kernel needs a multiple of 128), and zero-length RoPE in the Triton q-prep kernel.--chunked-prefill-sizerows (71.3 MB at 8192); no new flags or environment variables.Motivation
On Hopper, GLM-5.3-Flash (
Glm5NextForConditionalGeneration) runs with a bf16 KV cache (--kv-cache-dtype autoresolves to bfloat16 on SM90), so its DSA prefill computes in BF16. On SM90, FP8 doubles the peak tensor-core throughput of BF16 and halves the bytes moved per operand; that is why this series added an FP8 sparse prefill,--dsa-prefill-backend flashmla_sparse_q8, for DeepSeek-V3.2 (#30514) and extended it to GLM-5.2 (#31888).That backend could not run on GLM-5.3-Flash at all, because three properties of the model each block it:
fp8_e4m3KV cache, but this model is served from a bf16 cache on Hopper.qk_rope_head_dim=0). The fused fp8 q-prep Triton kernel buildstl.arange(0, ROPE)and fails to compile at ROPE=0, as does the KV concat-cast kernel behind the opt-inSGLANG_ENABLE_DSA_Q8KV8_KV_CAT_FUSION.index_kpool=4). The KPool indexer appends up toindex_kpool - 1tail tokens to every top-k row, so rows areindex_topk + index_kpool - 1 = 2051wide, but the kernel walks top-k in pairs of 64-wide blocks and needstopk % 128 == 0, and the KPool tail guard did not admit q8.Modifications
None of the three needs a change to the SM90 attention kernel:
d_qk=512is already one of its two supported widths (512 and 576),d_v=512andh_kv=1match, and padding the local heads to 64 (from 16 at TP4 or 8 at TP8) already satisfies its contract. The fixes sit around the kernel:dsa_backend.py,dequant_k_cache.py). The q8 kernel only needs q and KV in fp8 at call time, so the validator now accepts a bf16 pool, q8 extend batches take the RAGGED top-k transform whatever the pool dtype, and prefix rows are gathered by slot and cast to fp8 per call (gather_cast_kv_fp8_pad_paged: on NoPE rows one vectorized Triton kernel that also zeroes the pad band, otherwise the existing MLA gather; bit-identical to the non-prefix cast). This mirrors an existing path in the opposite direction:flashmla_sparsealready dequantizes an fp8 cache to bf16 on a prefix hit (dequantize_k_cache_paged).cache_ops.py,dequant_k_cache.py). Both Triton kernels skip the rope segment behind a staticif ROPE > 0:, so output with ROPE>0 is byte-identical to before.dsa_backend.py,dsa_backend_kpool.py). Top-k is padded with -1 to 2176 (output-invariant), and the KPool tail guard admits q8 prefill over a bf16 pool; an fp8 pool keeps the guard, since gathering packed fp8 rows through KPool tail columns is untested.Also included:
dsa_backend.py). At launch, q8 prefill rejects--enable-mixed-chunk, HiSparse, an fp8 dtype whose pool is not stored packed, and (not supported yet) an fp8 pool on a NoPE model; these previously failed mid-forward. At run time, a non-RAGGED q8 batch that carries top-k indices raises instead of silently running the bf16 kernel.(rows, 2176)int32 buffer per attention backend that runs q8 prefill (one per GPU here), at most--chunked-prefill-sizerows (71.3 MB at 8192). It is filled with -1 once and reused across DSA layers and forward passes; each call copies in only the 2051 real columns.GLM-5.3-Flash.mdxand its config) gains a HopperBF16 + Q8 sparse prefilloption, listed afterBF16 + TileLangso the Hopper default does not change, with its own empty benchmark entries so it does not show the BF16 + TileLang numbers;attention_backend.mdxdrops the stalerequires --kv-cache-dtype fp8_e4m3.Usage
Opt-in only: without
--dsa-prefill-backend flashmla_sparse_q8, no default and no other backend changes.Hardware scope. SM90 only (the kernel is SM90-gated).
Short prefills. Batches whose longest KV length is at most
SGLANG_DSA_PREFILL_DENSE_ATTN_KV_LEN_THRESHOLD(2048 by default) can take the dense MHA path instead, where both backends are identical. The decision is made per batch and has further conditions (for example, the batch's total KV length must fit the MHA chunk capacity), so under concurrency short requests can still reach the sparse path.Experimental Results
Setup. All numbers are from H200 GPUs. Both sizes run the server flags in Usage, so the two sizes compare directly (
--context-length 131072covers the 120k-input rows), and base differs only in--dsa-prefill-backend tilelang:--tp-size 4 --ep-size 4.--tp-size 8 --ep-size 8.Software: torch 2.13.0 (CUDA 13.0), FlashInfer 0.7.0.post1, sglang-kernel 0.4.8, Triton 3.7.1. The workload uses 1-token outputs, so the throughput rows are prefill-dominated. Each version runs first in half of the repetitions, both servers restart every time, and the improvement averages the two orders. The accuracy runs used different server flags, the same for base and q8 (TP4 without expert parallelism, the default MoE backends,
--mem-fraction-static 0.80, the default--max-prefill-tokens, overlap scheduling and shared-experts fusion on; LongBench-v2 also--context-length 180224and--reasoning-parser glm45), an earlier software image and an earlier revision of this PR's code.Benchmark commands
Performance Benchmark
Per DSA layer (single H200; times only the sparse prefill attention call, through the real backend code paths with synthetic indices and values;
do_benchmedian per call; q8 time includes top-k padding, fp8 q-prep and the bf16 prefix gather-cast; speedup = tilelang / q8, higher = this PR better; ms columns at 16 heads; the 32k and 64k kv_len rows are omitted and fall in between):All columns come from one run on this PR's final code with the software listed in Setup. q8 pads the local heads to 64 and tilelang pads them to 16, so 8 and 16 heads cost the same in each backend; at 64 heads (all of the model's heads on one GPU) tilelang's work grows while q8's does not. Only 11 of the model's 45 layers are DSA (the other 34 are KDA linear-attention layers, which this PR does not touch), so the end-to-end gain is much smaller than the per-layer gain.
End to end (improvement of q8 over tilelang, + = this PR better; for TTFT, the percentage by which it is lower):
Spread across repetitions (1σ): throughput ±0.07-1.18 percentage points at TP4/EP4, and at TP8/EP8 ±0.32-1.42 from 8k up and ±3.15 at 3.5k; TTFT at 8k-120k ±0.23-0.49 at TP4/EP4 up to 64k, ±3.40 at 120k, and ±0.26-2.78 at TP8/EP8. Three entries (TP8/EP8 throughput at 3.5k, TP4/EP4 throughput at 32k and TTFT at 120k) include one repetition well away from the other three; with the median of the repetitions instead of the mean, the ranges are +11.12% to +12.21% (TP4/EP4) and +4.60% to +12.03% (TP8/EP8) for throughput, and 9.34% to 10.90% and 6.64% to 11.10% lower TTFT at 8k-120k. At 3.5k the TTFT difference is small (+0.86% ±3.27 at TP4/EP4, +1.91% ±1.47 at TP8/EP8) and varies between runs, so the TTFT claim covers 8k-120k only.
Absolute numbers by configuration (medians, base → q8; the improvement above averages the two run orders, so it is not the ratio of these medians):
Divided by GPU count, TP4/EP4's q8 throughput is 1.60-1.68x TP8/EP8's, while TP8/EP8's q8 single-request TTFT is 15-20% lower from 8k up. Two TP4/EP4 servers were not run side by side on 8 GPUs, and TP8/EP8's larger KV capacity matters more with longer outputs.
Where the time goes (TP8/EP8, torch profiler, kernel time per GPU, averaged over the 8 GPUs and taking the median over server sessions, on a short separate test with 16,000-token requests rather than the benchmark rows): the sparse MLA prefill is 30.7% of tilelang's total kernel time, and this PR's kernel runs it 1.72x faster (256.1 → 149.0 ms), which alone cuts the total by 12.8%. The q8 preparation it adds (top-k padding, fp8 q-prep and the bf16 prefix gather-cast, 3.6 ms) costs 0.4%, the tensor concatenation that only the tilelang path runs (8.6 ms) saves 1.0%, and the fused MoE kernel (
deep_gemmmega-MoE, which also carries the expert-parallel exchange) grows by 2.8% (190.1 → 213.5 ms). The total kernel time falls 10.6% (834.4 → 745.8 ms).Correctness and Accuracy Tests
The accuracy runs used TP4 without expert parallelism (flags under Setup) and an earlier revision of this PR's code. This PR's later changes (where the padded top-k ids are stored, message text, launch-time checks, a pad-buffer width check that is a no-op at this model's top-k width, and the vectorized gather with bit-identical output) do not touch the numerics.
gsm8k (all 1319 test questions at every shot count, few-shot examples from the train split, temperature 0, completion API, 2 repetitions; σ is the spread across them):
K=5 stays below the 2048-token dense threshold, where both configurations take the identical MHA path, so its −0.0057 is a pure server-to-server offset; the last column subtracts it. No shot count shows q8 scoring lower than base. The largest difference, q8 0.0136 higher at K=60, varies widely between the two repetitions (+0.0224 and +0.0049), so no gain is claimed. Both configurations score lower at longer contexts (0.92 at K=5, 0.31 at K=120), partly because of the completion API (on a separate base server with the same flags, K=120 scores 0.566 with the chat API and 0.324 with the completion API), so only the differences are claimed.
Kernel engagement and numerics. A profiler capture on the LongBench-v2 q8 server shows 132 q8 kernel calls. For gsm8k, a separate profiled run at 4k and 16k context on an earlier commit shows 44 in q8 and none in base; the sweep itself was not profiled. q and KV are cast to fp8_e4m3 with scalar-1.0 scales; the largest magnitude seen in real GLM-5.3-Flash prefills is 13.9 (q; KV at most 5.2), 32x below the ±448 limit, so no rescaling is needed.
LongBench-v2, where every prompt is longer than 2,048 tokens, so every request takes the sparse prefill path (thinking on, temperature 0.6, top-p 0.95, max-tokens 16,384, the 2,300-147,000-token subset selected with GLM-5.3-Flash's tokenizer, 336 questions, exact letter match; 2 repetitions):
No way of scoring shows a difference beyond about ±0.027, the binomial standard error of one run's score at 336 questions (−0.002 on the 255 questions answered in all four runs). About 15% of responses reach the 16,384-token cap while still reasoning and count as wrong in both configurations, so the claim is the difference, not the absolute score.
Tests
test/registered/unit/layers/attention/test_dsa_q8kv8_bf16_prefill_routing.py(CPU, 24 cases): which top-k layout each prefill backend, KV dtype and batch type gets; which configurations q8 accepts and which it rejects at launch; the top-k padding and its buffer reuse; and the KPool tail guard for bf16 and fp8 pools.test/registered/kernels/ops/attention/test_q8kv8_dsa_nope_bf16_prefill.py(1 GPU, 16 cases): the fp8 q-prep, KV cast and bf16 prefix gather kernels, with and without a rope part, match a plain torch cast byte for byte; and the q8 path on this model's shape (NoPE, bf16 pool, 2051-wide top-k) gives the same output with and without a cached prefix, is unaffected by the padding, and matches a torch reference.test_sparse_mla_q8kv8_prefill_sm90.pyandtest_q8kv8_sparse_prefill_backend.pyare unchanged and pass.Future work
Checklist
CI States
Latest PR Test (Base): ✅ Run #38215276474
Latest PR Test (Extra): ❌ Run #38215275710
Latest PR Test (AMD ROCm 10): ❌ Run #38215275905