Repository navigation
[None][perf] Muse Spark Open modeling_v2 TEP target: Vera Rubin low-latency levers and trtllm::fp4_block_scale_moe_prerouted - #21580
Merged
Tabrizian merged 4 commits intoNov 5, 2026
Conversation
…oE FC1/FC2 on caller-built routing tables
The FP4 block-scale MoE op builds its routing tables (expanded->permuted and permuted->token maps,
per-CTA expert and row limit, CTA and padded-row counts) with its routing kernel before FC1. A
placement kernel that already knows the step's routing can write those tables itself and skip that
kernel; the Muse Spark Open modeling_v2 TEP target does so at TEP4 (the wide half-window
pool_direct_route) and TEP8 (ring_buddy_assign).
- run_fp4_block_scale_moe_prerouted: run_fp4_block_scale_moe_runner's pre-routed-ids path (E2m1,
do_finalize=false), statement for statement, on the caller's tables instead of the routing
kernel's. Returns {gemm2_output, topk_weights, expanded_idx_to_permuted_idx}; a slot's row holds
the stock op's bits for it.
- FP4BlockScaleMoERunner.run_moe_prerouted: run_moe's tile and config choice, its [-1, -1]
fallback and its fine-grained runner choice, applied to the prerouted call.
get_default_config and get_valid_configs_for_tile expose the fallback config and every config of
a pinned tile.
- Free ops trtllm::fp4_block_scale_moe_prerouted / fp4_block_scale_moe_default_config /
fp4_block_scale_moe_valid_configs_for_tile, through one runner per activation type.
- test_modeling_v2_fp4_block_scale_moe_prerouted.py: every slot's FC2 row bitwise equal to the
stock op's at the target's geometries (64 local experts at 9..64 rows, 96 at 16..32, top 8),
through each op's own expanded->permuted table; listed on l0_gb300_musespark.
Signed-off-by: Iman Tabrizian <[email protected]>
…atency levers The sm107 low-latency fast paths of the TEP target, each a lever of the per-deployment resolver (levers.RULES, dispatch.FAST_PATHS), served only by the two sm107 compositions. Nothing is served on sm103, which resolves as before. Rule: a lever of decode steps is on under auto while max_batch_size is at most 8 (__MAX_BATCH), the region it was measured in; above that every one of them is off, so the high- and mid-concurrency selections are unchanged. Numeric levers also need their accuracy gate (sm107 TEP4 / TEP8, generation or aggregated servers of up to 8 requests); an unhinted disaggregated server passes none, so set MUSESPARK_OPEN_LEVER__ROLE. baseline still selects exactly the previous composition. - Dense GEMMs: splitk_pool_split8, splitk_frontier_tables (TP4); tep8_wide64_splitk, tep8_publish_splitk, tep8_drafter_wide_gemms, tep8_fc_shard_wide (TP8); weight_prefetch_after_join, next_qkv_prefetch_skip, wide_norm_gate_pdl. - Attention: swa_one_cluster_block, swa_prep_split, swa_eight_requests, full_attention_fold_multi, split_kv_deep_rings. - Experts and routing: prerouted_experts (on trtllm::fp4_block_scale_moe_prerouted); bf16_half_window (TP4); tep8_ring_buddy_wide, tep8_ring_buddy_pdl, tep8_tile_placement, tep8_router_push, tep8_router_prewait (TP8). - Communication: finalize_entry_trigger, hop_entry_trigger; tep8_finalize_transport_64, tep8_early_multicast_hop, tep8_direct_hop, tep8_publish_join, tep8_pool_programmatic_fork, tep8_wide_projection_gathers (TP8). - Step and drafter: step_commit_v2; drafter_kv_glue (the context-K/V side chain in two launches over a worker-owned arena; it yields to drafter_kv_side_chain over a dense one); drafter_kv_fork_before_head. - Context: context_sp_extra_parts (TP4, __PARTS): the router input and the expert all-gather of large context steps on the row shard; on context servers, and on aggregated ones up to 8 requests. - vocab_parallel_head gets a rule: on sm107 up to max_batch_size 8 (151 MiB of fabric buffers per TP4 rank), __MIN_ROWS 8 on sm107 (one verify block) and 16 elsewhere. The sm107 TEP8 composition also serves nine TP4 paths; their upstream rule leaves them out of baseline there. Settings: the kernel modules that read these levers keep module-level settings with the previous defaults and a keyword-only configure(); lever_settings.apply(plan, sm) calls them once, from the model constructor right after dispatch.compose and before any installer, and imports a module only when one of its settings differs from its default. On sm107 the split-K kernels always build their conflict-free mailbox, their reduce-scatter epilogue for split-K 8 and their deeper stages in oversized shared memory (each writes the same bits as the build it replaces). The certified TP8 split-K producer key carries the reformatted device code's md5 (its AST is the certified one's). The target reads no other environment variable: the switches these levers replace are in levers.RETIRED, so setting one raises naming its lever. The host-only lever test pins every region's table with the new levers, the baseline composition, the replays (which turn the new levers off) and the new rules. Signed-off-by: Iman Tabrizian <[email protected]>
… KV by default TRTLLM_DISAGG_GEN_PREFETCH_REQUESTS now defaults to 1 (0 turns it off): a disaggregated generation worker admits one generation-only request beyond max_batch_size, so its KV lands while the batch decodes (pair it with the gen router's max_inflight_per_server at max_batch_size + 1). Where prefetch does not apply (no transceiver, attention DP, PP, hybrid or MRoPE pools, KV cache manager V1, TLLM_DISAGG_GEN_PRIORITIZE_FIRST_TOKEN=1) it resolves to 0 and warns only if the variable was set. The unit tests follow the new default; a test that builds a disaggregated engine on KV cache manager V2 and pins its seat count may need TRTLLM_DISAGG_GEN_PREFETCH_REQUESTS=0. Signed-off-by: Iman Tabrizian <[email protected]>
… security bandit's B324 flags splitk_gemm._device_code_md5's hashlib.md5 as a weak hash for security, which fails the pre-commit workflow. It is a fingerprint of the kernel source that keys the certified TP8 split-K producers, not a security hash: pass usedforsecurity=False, which leaves the digest unchanged. Signed-off-by: Iman Tabrizian <[email protected]>
Member
Author
|
/bot run --disable-fail-fast |
Collaborator
|
PR_Github #82357 [ run ] triggered by Bot. Commit: |
Collaborator
|
PR_Github #82357 [ run ] completed with state |
Tabrizian
force-pushed
the
user/itabrizian/musespark-vr-frontier-pr
branch
from
November 4, 2026 22:25
701519a to
f419e0a
Compare
Tabrizian
marked this pull request as ready for review
November 5, 2026 18:40
Tabrizian
requested review from
a team,
Wanli-Jiang,
WeiHaocheng and
litaotju
as code owners
November 5, 2026 18:40
Tabrizian
requested review from
Barry-Delaney,
brnguyen2,
dpitman-nvda,
weiminwang-nv and
zhaoyangwang-nvidia
November 5, 2026 18:40
1 task done
5 tasks done
pcastonguay
added a commit
to pcastonguay/TensorRT-LLM
that referenced
this pull request
Nov 9, 2026
…t-in MUSESPARK_OPEN_SM103_TEP8_F11=1 NVIDIA#21754 split the shared MuseSparkOpen tree: the tip sm_103__tep has no F11 composition, and the tip sm_107__tep is hard-wired to sm107 (capability asserts, 107a builds, sm107-only tactic tables) and reads its switches through the lever resolver only. Re-deriving every GB300 table and gate inside sm_107__tep cannot be validated without GB300 parity runs, so this commit adds the GB300-validated F11 tree as its own target instead. - New target muse_spark_open_816b_a42b_nvfp4__sm_103__tep8: the F11 tree on sm103 with its GB300 enablement, package path and class name rewritten (ModelingV2MuseSparkOpen816bA42bNvfp4Sm103Tep8). - routing.py: sm103 at TP8 with MUSESPARK_OPEN_SM103_TEP8_F11=1 returns this target. Unset (the default), sm103 routes to the tip sm_103__tep exactly as before. - Env names: every switch of the tree (MUSESPARK_OPEN_SM103_TEP8_*, MUSESPARK_OPEN_TEP8_*, TRTLLM_MUSESPARK_*, MUSESPARK_OPEN_LEVER_*) is read by the same code as in the tree, sm107_defaults.SM103_TEP8_DEFAULTS included. No mapping layer. - The ctx role (TEP4) and every other deployment never route here. - Tests: the GB300 F11 CPU test and the split-K device test, on the new path. - Shared-module compatibility vs the tip (checked statically): every name the tree imports exists; the few tensorrt_llm imports that differ do so by added parameters or removed fields it does not use; trtllm::fp4_block_scale_moe_prerouted has the same schema on the tip (NVIDIA#21580). Signed-off-by: Patrice Castonguay <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
pcastonguay
added a commit
to pcastonguay/TensorRT-LLM
that referenced
this pull request
Nov 9, 2026
…t-in MUSESPARK_OPEN_SM103_TEP8_F11=1 NVIDIA#21754 split the shared MuseSparkOpen tree: the tip sm_103__tep has no F11 composition, and the tip sm_107__tep is hard-wired to sm107 (capability asserts, 107a builds, sm107-only tactic tables) and reads its switches through the lever resolver only. Re-deriving every GB300 table and gate inside sm_107__tep cannot be validated without GB300 parity runs, so this commit adds the GB300-validated F11 tree as its own target instead. - New target muse_spark_open_816b_a42b_nvfp4__sm_103__tep8: the F11 tree on sm103 with its GB300 enablement, package path and class name rewritten (ModelingV2MuseSparkOpen816bA42bNvfp4Sm103Tep8). - routing.py: sm103 at TP8 with MUSESPARK_OPEN_SM103_TEP8_F11=1 returns this target. Unset (the default), sm103 routes to the tip sm_103__tep exactly as before. - Env names: every switch of the tree (MUSESPARK_OPEN_SM103_TEP8_*, MUSESPARK_OPEN_TEP8_*, TRTLLM_MUSESPARK_*, MUSESPARK_OPEN_LEVER_*) is read by the same code as in the tree, sm107_defaults.SM103_TEP8_DEFAULTS included. No mapping layer. - The ctx role (TEP4) and every other deployment never route here. - Tests: the GB300 F11 CPU test and the split-K device test, on the new path. - Shared-module compatibility vs the tip (checked statically): every name the tree imports exists; the few tensorrt_llm imports that differ do so by added parameters or removed fields it does not use; trtllm::fp4_block_scale_moe_prerouted has the same schema on the tip (NVIDIA#21580). Signed-off-by: Patrice Castonguay <[email protected]> Co-Authored-By: Claude Opus 5.5 <[email protected]>
Tabrizian
added a commit
to Tabrizian/TensorRT-LLM
that referenced
this pull request
Nov 10, 2026
…become dispatch levers Ports the MuseSpark GB300 decode kernel stack onto feat/musespark-open-agentx and replaces the environment switches it carried with dispatch levers. EVERY LEVER IS DEFAULT OFF. This is the port; it changes no behaviour until a lever is knobbed on. Proved rather than asserted: a verifier rebuilds FAST_PATHS, DEPENDS_ON and both compositions by AST and resolves them with an EMPTY environment -- the resolved path sets are identical to the base at all ten deployments (44 paths at TEP8, 54/53 at TEP4), and each lever is then shown to turn on by its own knob. WHAT IS IN. 18 of the 25 patches in the source set: staged-router-gemm, moe-expert-balance (2), decode-g1 (parts 1-5), decode-kernel-stack (3), kernel-stack-2 (parts 1-5), tep8-decode-stack-v2, and context-fmha-v2. decode-g1/6 is omitted as 100% redundant -- 51daa26 (NVIDIA#21364) is already in the base and git apply --reverse of its hunk succeeds. The rest are not kernel changes (http-keep-alive, context-kv-retire-v2, torch-memory-reserve), already upstream (serving-stats-off-loop, merged as NVIDIA#21907), not free (context-scheduler-aging buys x +7.9..9.0% with y -1.0..-1.2%), or inapplicable (router-held-placement: the GB300 e2e point is all-agg, so there is no router to configure). Substantial redundancy was found and dropped rather than re-landed: NVIDIA#21377 and NVIDIA#21580 had already built the widened TP8 finalize transport and left it pinned at TP8_MAX_TOKENS = 16, so that layer collapses to a reader that unpins it. NOT LANDED, reported rather than approximated. kernel-stack-2/4's three gathers.py hunks need a TP8 kernel table (TP8_WIDE_KERNELS / WIDE_KERNELS_BY_SM_TP) that appears in the patches only as context -- it is in no patch and no public commit. decode-kernel-stack/3's eight EARLY_LOADS hunks have no host class, because NVIDIA#21754 moved SwaBlockMultiAttention out of the sm103 tree. THREE DEFECTS THIS PORT INTRODUCED, each found by running the code after static checks passed: 1. weights._ring_buddy_row_cap called max_rows_for with two arguments against a one-argument signature, on the unconditional replicated_experts install path. Every TP8 deployment would have raised TypeError at load_weights. 2. moe_prologue declared _wide_direct: bool as a class attribute, shadowing projection_gathers' transport object (default None) through the MRO. Every 8-row decode step raised AttributeError("'bool' object has no attribute 'is_armed'") at warmup, inside attention_output_into_hop, which is served by default at TP8. 3. pool_into_route called _wide_router_shard with four arguments against five. Latent, behind a default-off lever. THIRD-PARTY LICENSING. multi_instance_context_kernel.py derives from the CUTLASS CuTe DSL Blackwell FMHA example (v4.8.0) and declares that derivation with the full BSD-3-Clause notice in-file, matching 51 existing files in this repository and the sm107 sibling added in 736cfdc. CUTLASS is already attributed in ATTRIBUTIONS-Python.md and both per-arch CPP files, so no attribution file changes. MEASURED. With every lever off the branch is indistinguishable from its base on GB300 TEP8 decode (11.67 vs 11.93 ms at bs3, 12.26 vs 12.28 at bs4), which is a correctness result -- the port does not disturb the default path -- and says nothing about what the levers are worth. Non-bitwise levers still need their acceptance, drift and step-time gates before any of them ships on by default. Signed-off-by: Iman Tabrizian <[email protected]>
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.
@coderabbitai summary
Description
This PR brings the Vera Rubin (sm107) low-latency fast paths of the Muse Spark Open modeling_v2 TEP target onto the
per-deployment lever resolver of #21377, which it follows. It is 3 commits:
trtllm::fp4_block_scale_moe_prerouted(C++ op + 1-GPU unit test). FP4 block-scale MoE FC1 / FC2 on routingtables the caller already built, with the stock op's tile, config and runner choice. The target's expert placement
kernels write those tables while they balance the replicated experts, so the stock routing kernel is skipped. The
test checks that every (token, slot) FC2 row is bitwise the stock op's at the target's geometries.
_experimental/modeling_v2/models/musespark_open/...__tep).TRTLLM_DISAGG_GEN_PREFETCH_REQUESTSdefaultsto 1 instead of 0;
0turns it off.The levers
Every new fast path is a lever in
levers.RULES/dispatch.FAST_PATHSwith originLL, served only by the twosm107 compositions. Nothing new is served on sm103, which resolves as before; the host test pins this.
No new environment variable. Each lever has the usual
MUSESPARK_OPEN_LEVER_<NAME>=auto|on|offknob. The switchesthey replace are added to
levers.RETIRED, so setting one raises an error naming its lever.Rule.
autoa decode lever is on for servers withmax_batch_sizeup to 8 (__MAX_BATCH), the region it wasmeasured in. Above that every one of them is off, so the high- and mid-concurrency selections of [None][feat] Muse Spark Open modeling_v2 TEP target: a per-deployment lever resolver and the Vera Rubin high-concurrency, mid-concurrency and low-latency fast paths #21377 are
unchanged.
requests. An unhinted disaggregated server passes no gate, so disaggregated servers should set
MUSESPARK_OPEN_LEVER__ROLE.baselinestill selects exactly the previous composition. The new levers are off under it, and so are the nineTP4 paths that the sm107 TEP8 composition now also serves (they get an
upstreamrule whose baseline leaves them outthere).
Settings.
configure.lever_settings.apply(plan, sm)calls eachconfigureonce, from the model constructor, right afterdispatch.composeand before any installer. It imports a module only when one of that module's settings differsfrom its default. Off sm107 it does nothing.
splitk_pool_split8,splitk_frontier_tables(TP4);tep8_wide64_splitk,tep8_publish_splitk,tep8_drafter_wide_gemms,tep8_fc_shard_wide(TP8);weight_prefetch_after_join,next_qkv_prefetch_skip,wide_norm_gate_pdlswa_one_cluster_block,swa_prep_split,swa_eight_requests,full_attention_fold_multi,split_kv_deep_ringsprerouted_experts(on the new op);bf16_half_window(TP4);tep8_ring_buddy_wide,tep8_ring_buddy_pdl,tep8_tile_placement,tep8_router_push,tep8_router_prewait(TP8)finalize_entry_trigger,hop_entry_trigger;tep8_finalize_transport_64,tep8_early_multicast_hop,tep8_direct_hop,tep8_publish_join,tep8_pool_programmatic_fork,tep8_wide_projection_gathers(TP8)step_commit_v2;drafter_kv_glue, the context-K/V side chain in two launches over a worker-owned arena (it yields todrafter_kv_side_chainover a dense one);drafter_kv_fork_before_headcontext_sp_extra_parts(TP4;__PARTSfromrouter_input,ce_gather,shard_routing): on context servers, and on aggregated servers of up to 8 requestsAlso:
vocab_parallel_headgets a rule. On sm107 it is on up tomax_batch_size8; its fabric buffers take 151 MiBper TP4 rank.
__MIN_ROWSis 8 on sm107 (one verify block; sm107 serves nolm_head_inbox) and 16 elsewhere. sm103is unchanged.
epilogue for split-K 8, and their deeper stages in oversized shared memory. Each writes the same bits as the build
it replaces.
identical to the certified build's.
Deployment note. At the deployments where these levers are on, some of #21377's own bitwise levers are on as
well (on the aggregated TEP4 server below: the cooperative head fold, incremental block offsets and the
execution-stream step loop). The validation below runs those combinations.
Test Coverage
tests/unittest/.../musespark_open/...__tep/test_modeling_v2_levers.py(host only, 245 pass). It covers:auto: the low-latency levers are added up to 8 requests, and nothing changes above;baseline, still the previous composition on every key;context lever.
tests/unittest/_torch/modeling_v2/moe/test_modeling_v2_fp4_block_scale_moe_prerouted.py(1 GPU), added tol0_gb300_musespark.tests/unittest/_torch/executor/test_disagg_gen_prefetch.pyfollows the new default.Validation on Vera Rubin. The evals the tree was validated with before the port: SPEED-Bench acceptance length
(80 rows, concurrency 1, rejection sampling) and GSM8K (1319, 5-shot, greedy), no forced acceptance. Every lever is
at
auto; no lever knob is set.max_batch_size4max_batch_size8),__ROLEset on bothThe disaggregated run is still to come; until then this stays a draft.
PR Checklist
Please review the following before submitting your PR:
PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.
PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.
Test cases are provided for new code paths (see test instructions)
If PR introduces API changes, an appropriate PR label is added - either
api-compatibleorapi-breaking. Forapi-breaking, includeBREAKINGin the PR title.Any new dependencies have been scanned for license and vulnerabilities
CODEOWNERS updated if ownership changes
Documentation updated as needed
Update tava architecture diagram if there is a significant design change in PR.
The reviewers assigned automatically/manually are appropriate for the PR.
Please check this after reviewing the above items as appropriate for this PR.