Repository navigation
[None][feat] Muse Spark Open modeling_v2 TEP target: mid-high-concurrency optimizations for GB300 - #20770
Merged
Tabrizian merged 13 commits intoOct 22, 2026
Conversation
…hortest-prefill-first context admission Add two context admission policies to KVCacheV2Scheduler for decode-heavy aggregated serving. Both are off by default; with neither set, scheduling is unchanged. - TRTLLM_SCHED_PREFILL_DECODE_INTERVAL=N admits new context requests on at most one scheduling pass in N while generation requests are running, so a stream of long prefills does not stall every decode step. An admission the executor did not run is withdrawn and retried on the next pass, and every context request keeps aging while it waits. - TRTLLM_SCHED_SHORTEST_PREFILL_FIRST=1 tries pending first-chunk context requests in order of their uncached prompt length. A request that has waited TRTLLM_SCHED_SPF_MAX_WAIT_PASSES passes (default 128) without context tokens goes first, and prefills that have already started are protected from preemption by a later first chunk. The interval is not meant to be combined with batch_wait. Signed-off-by: Xiao Wang <[email protected]>
…d huge-page collapse at startup The host tier is anonymous memory advised for transparent huge pages. Where its huge-page faults fall back to base pages, the kernel later collapses and migrates those ranges while the server runs, and whatever touches them waits. Two opt-in helpers move that work to startup. Both are off by default, need no privileges, and log and ignore failures. - TRTLLM_KV_HOST_TIER_DROP_PAGE_CACHE=1: before the KV cache managers are built, drop this node's page cache of the checkpoint and draft-model files (posix_fadvise DONTNEED), so the host tier is allocated from memory the cache no longer holds. - TRTLLM_KV_HOST_TIER_COLLAPSE=1: after KV cache manager v2 has created its host tier, collapse the new mappings into huge pages (madvise MADV_COLLAPSE). Signed-off-by: Xiao Wang <[email protected]>
…arge batches MUSESPARK_OPEN_LARGE_FINALIZE_SPARSE=1 (default off) finalizes MoE batches of 160 tokens or more with a kernel that visits only the expert slots local to the rank, instead of the whole top-k tile of every token. Above one wave of programs the tile kernel's working set dominates; the sparse kernel loads and normalizes only the local rows. The result is rounding-different from the tile kernel (slot-order sum), within the documented tolerance. Signed-off-by: Xiao Wang <[email protected]>
…p and PDL norm-gate at sm103 TEP4 - multi_request_prep_append: one kernel that applies the QK norm and RoPE to every row of a multi-request decode step and appends its keys and values to the paged FP8 cache, replacing the built-in preprocess on those steps. It can also issue the o_proj weight's L2 prefetch. - preattn_prep launches a 16-row program per head above 512 rows and serves context steps. - rmsnorm_gate_pdl: the attention norm-gate as a PDL-launched Triton kernel so the output projection can launch behind it; norm_gate gains the matching entry points. Signed-off-by: Xiao Wang <[email protected]>
…ecode attention at sm103 TEP4 - multi_request_split_kv: a CuTe DSL decode FMHA for steps of two or more requests on the full-attention layers. It takes the served E4M3 Q and the device FMHA scales, splits each request's KV over CTAs by its length, and combines the partials with a chunk and warp count that follow the batch size. Single-request steps keep the 8-row kernel. - decode_kv_splits: an over-subscribed KV split for the built-in decode FMHA on steps of 9..64 requests. Signed-off-by: Xiao Wang <[email protected]>
…n and wide projection gathers at sm103 TEP4 - batch_dense_gemms: on multi-request decode steps, the o_proj L2 prefetch issued from the decode prep, the PDL norm-gate up to 128 rows, and the QKV projection through flashinfer's TGV GEMM at the row counts where cuBLAS's pick does not split K. - wide_projection_gathers: split-K QKV and pool/unpool slice GEMMs on 9..32-row decode steps, with the weight load issued before the dependency wait. - dense_gemms / dense_gemm / projection_gathers: the tables and entry points these paths use. Signed-off-by: Xiao Wang <[email protected]>
… projection publish and MoE all-reduce at sm103 TEP4 - post_attn_hop_wide: the post-attention all-reduce hop for 9..1024-row decode steps, one-shot up to 24 rows and two-shot above, refused before its collective build when the group cannot agree on the transport. - projection_publish: the pool / unpool slices published from the GEMM epilogue on 33..448-row decode steps, with an FP4-quantizing publish; it refuses an uncertified cuBLAS producer or an unbuildable transport. - wide_moe_allreduce: the MoE output all-reduce of 129..1024-row decode steps on the MNNVL two-shot, widening the built-in router/pool overlap on its armed steps. Signed-off-by: Xiao Wang <[email protected]>
…nalize and hot expert copies at sm103 TEP4 - router_gemm: router logits of 9..512-row decode steps as a BF16x3 split-K CuTe GEMM with a tree sum of the split partials. - finalize_two_shot: the fused expert finalize + two-shot all-reduce of 72..512-row decode steps. - hot_replicas / hot_replica_assign: per-step placement of hot NVFP4 expert copies from census tables of served routing, so the busiest rank touches fewer experts; the wide window reuses the owner window's GEMM tactics. - early_expert_ids, moe_prologue, pool_into_route: the hooks these paths use. Signed-off-by: Xiao Wang <[email protected]>
…context steps at sm103 TEP4 context_sequence_parallel shards context steps of 1024 rows or more (4608 or more when eager) across the TP ranks: every row is embedded before sharding, the NVFP4 expert input is gathered, the BF16 finalize follows the built-in finalize's dispatch, and the MNNVL all-reduce workspace is grown before CUDA graph capture. Signed-off-by: Xiao Wang <[email protected]>
…fter paths at sm103 TEP4 - Drafter window attention and the split sampler for block decodes of up to 128 requests (1024 rows), with a geometry table per row count. - wide_draft_topk / draft_rank_topk: each rank's own top-k keys exchanged for draft steps from 33 rows. - ctx_window_compact / drafter_window_compact: in-place compaction of the drafter's windowed context arena. - context_kv_fork and verify_fold over the windowed drafter arena; dflash accept and context KV commit for multi-request steps; the head sampler library is named by its sources' digest. Signed-off-by: Xiao Wang <[email protected]>
… to 128 requests on the multi-request paths Route the sm103 TEP4 target's decode steps of 2..128 requests (up to 1024 rows) and its large context steps through the multi-request fast paths: dispatch arms each path on its row band, the layer and attention forwards call them, and the composition and dispatch tests list each sm103-TEP4-only path once. Smaller TP sizes and single-request steps keep their existing compositions. Signed-off-by: Xiao Wang <[email protected]>
…rives The target's entries ship without op-level tests, so their CELLS lists certified nothing and failed the claims gate that requires every declared cell list to be driven by a test. Signed-off-by: Xiao Wang <[email protected]>
- api_stability: add musespark to the serve CLI reference choices of --reasoning_parser and --tool_parser. - chat_tokenization: do not resolve the model type for rendering; the renderer does not read it, and resolving it loaded the checkpoint config even with the Harmony adapter disabled. - test_kv_cache_v2_scheduler: give the connector mock capacity_only=False, as on main, so prepare_resources drives the connector hooks. - test_ragged_spec_sampler: give the spec metadata stub rng_accept_slot. Signed-off-by: Xiao Wang <[email protected]>
xwang233
requested review from
a team,
Wanli-Jiang,
WeiHaocheng and
litaotju
as code owners
October 21, 2026 20:25
Collaborator
Author
|
/bot run |
Collaborator
|
PR_Github #79687 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #79687 [ run ] completed with state
|
Collaborator
|
[by Claude Code] @eopXD Could you review this PR? Thanks! |
1 task done
This was referenced Oct 22, 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.
Description
Extends the Muse Spark Open modeling_v2 TEP target (added in c9e4756 on this branch) from the low-latency points to mid-high concurrency on GB300 (sm103) at TEP4. The changes come as 11 feature commits on top of this branch, plus 2 commits that fix unit tests failing on this branch.
The modeling_v2 target, at TEP4 on sm103. These paths are always on inside the target and selected by GPU architecture and tensor-parallel size; TEP8 and the single-request decode step are unchanged.
Shared paths: opt-in, off by default. With the variable unset, behaviour is unchanged.
KVCacheV2Scheduler:TRTLLM_SCHED_PREFILL_DECODE_INTERVAL: admits new context requests on one pass in N while decoding;TRTLLM_SCHED_SHORTEST_PREFILL_FIRST(andTRTLLM_SCHED_SPF_MAX_WAIT_PASSES): shortest uncached prefill first, with aging.TRTLLM_KV_HOST_TIER_DROP_PAGE_CACHE: drops the checkpoint and drafter page cache at startup;TRTLLM_KV_HOST_TIER_COLLAPSE: collapses host-tier mappings into huge pages.MUSESPARK_OPEN_LARGE_FINALIZE_SPARSEturns on a sparse-slot expert finalize for large batches.Measured gains of the shared-path opt-ins. Muse Spark Open on GB300 at TEP4, AgentX traces. x = p10 per-user output throughput, y = total throughput per GPU.
KVCacheV2Scheduler), measured together on a 256k-token AgentX trace with a running-batch cap, one-hour runs:Unit-test fixes for this branch.
CELLSlists. No op-level test drives them, so they certified nothing and failedtest_modeling_v2_claims.py::test_every_entry_with_cells_has_a_test_that_drives_them.api_stability:musesparkis added to the serve CLI reference choices of--reasoning_parserand--tool_parser. This is the same change as [None][test] Add musespark parsers to the trtllm-serve CLI stability reference #20761; the two merge cleanly in either order.chat_tokenization: the model type is no longer resolved for rendering. The renderer does not read it, and resolving it loaded the checkpoint config even with the Harmony adapter disabled (test_router.py::test_gpt_oss_router_respects_disable_harmony_adapter).test_kv_cache_v2_scheduler.py: the connector mock getscapacity_only=False, as onmain.test_ragged_spec_sampler.py: the spec metadata stub getsrng_accept_slot.Tests. In line with c9e4756, the modeling_v2 target is covered by the e2e accuracy test rather than unit tests. The shared-path changes have unit tests.
Test Coverage
accuracy/modeling_v2/test_musespark_open.py::TestModelingV2MuseSparkOpenNvfp4Tep4::test_dflash2_gsm8k_and_acceptance(on this branch,l0_gb300_multi_gpus.yml): GSM8K and mean acceptance length undermodeling_v2="require"at TEP4.tests/unittest/_torch/executor/kv_cache/test_kv_cache_v2_scheduler.py;tests/unittest/_torch/executor/kv_cache/test_host_tier_memory.py;tests/unittest/_torch/modeling/test_musespark_open_finalize_dispatch.py;tests/unittest/_torch/modeling/test_musespark_open_moe_finalize.py.PR Checklist
GitHub Bot Help
To see a list of available CI bot commands, please comment
/bot help.🤖 Generated with Claude Code