Skip to content

[None][feat] Muse Spark Open modeling_v2 TEP target: mid-high-concurrency optimizations for Vera Rubin - #20844

Merged
Tabrizian merged 9 commits into
NVIDIA:feat/musespark-open-agentxfrom
xwang233:mso-hcvr/agentx-tep
Oct 23, 2026
Merged

Tabrizian merged 9 commits into
NVIDIA:feat/musespark-open-agentxfrom
xwang233:mso-hcvr/agentx-tep

Conversation

@xwang233

Copy link
Copy Markdown
Collaborator

Description

This PR extends the Muse Spark Open modeling_v2 TEP target to mid-high concurrency on Vera Rubin (sm107, R200) at TEP4. It ports the GB300 mid-high-concurrency paths (#20770) to sm107 and adds the sm107 paths for steps of two to four requests. The changes are 9 commits:

  • 7 inside the Staircase target;
  • 1 small modeling_v2 router addition;
  • 1 opt-in change to a shared attention backend.

The modeling_v2 target at TEP4 on sm107. These paths are always on inside the target and selected by GPU architecture and tensor-parallel size. (sm103, TP4), (sm103, TP8) and (sm107, TP8) serve the same paths as before. Each path owns a row band, so exactly one implementation arms per op and row count.

  • Steps of two to four requests (9..32 rows):
    • wide sliding-window and full attention;
    • split-K dense projections with sm107 tables;
    • a sharded router GEMM;
    • a TP4 post-attention transport;
    • wide persistent experts;
    • half-window expert placement, behind a capacity gate at small max_batch_size;
    • a drafter FC inbox.
  • Multi-request decode steps (five to 128 requests), ported from sm103:
    • the page-split multi-request FMHA; its CTAs per KV-head pair follow the device SM count;
    • decode prep with the K/V append folded in.
  • Collectives:
    • the multi-request post-attention hop, which starts one row above the 32-row TP4 transport;
    • a two-shot MoE all-reduce;
    • a two-shot expert finalize, with its own row floor on sm107;
    • projection publish, certified for 212 SMs.
  • GEMMs and experts:
    • the multi-request router GEMM, with CTA and split counts from the device SM count (unchanged on sm103);
    • the batched dense-GEMM PDL chain; the QKV TGV tactic rows are keyed by device capability and are empty on sm107, where cuBLAS keeps the QKV projection;
    • hot expert replicas above max_batch_size 8, which yield to the half-window placement when both would arm.
  • Large context steps: sequence-parallel prefill (with an sm107 eager-row threshold) and the one-launch context prep.
  • DFlash drafter:
    • a windowed context arena, with the context-K/V fork and verify fold over it;
    • multi-request window attention (geometry tables per SM count);
    • draft top-k exchange and the wide split verify sampler.

modeling_v2 router. modeling_v2_resolve records the engine's max_batch_size for the target it returns (resolved_max_batch_size). It is not a routing input; the target reads it to size or leave out capacity-gated paths.

Shared path: opt-in, off by default. With the variable unset, behaviour is unchanged.

  • trtllm-gen FMHA: TRTLLM_GEN_DECODE_SEQS_PER_LAUNCH=N launches unwindowed decode attention in groups of at most N sequences, so each sequence gets more KV splits at large batches.

Measured gains. All on Vera Rubin, TEP4, AgentX traces on the 1M-token corpus, with forced draft acceptance. x = p10 per-user output throughput; y = total throughput per GPU.

Comparison Concurrency x y
Whole PR vs the 2..4-request paths alone (same runtime settings, two runs on different nodes; TTFT p90 −33…−52 % from c16 to c64) 16 +11 % +1 %
20 +17 % +5 %
32 +28 % +9 %
48 +31 % +12 %
64 +22 % +17 %
8 about equal about equal
Multi-request FMHA alone 32 +18 % +4 %
48 +12 % +3.5 %
Sequence-parallel prefill alone (TTFT −9…−22 %) 32 +10 % +3 %
48 +7 % +3 %
Router GEMM + dense-GEMM chain + hot replicas 32 +3 % +1 %
48 +6 % +2.5 %
Collectives 32 and 48 up to +1 % up to +1 %
Drafter paths 16 +6 % about equal
32 +3 % +1 %
Grouped decode (opt-in), measured without the multi-request FMHA 32 +11 % +3 %
  • Every per-path row is an A/B against the 2..4-request composition with the same runtime settings.
  • Grouped decode is inert once the multi-request FMHA serves the step, so the measured configurations leave it unset.
  • TEP8 single-request decode: no regression beyond node-to-node variation.

Accuracy. GSM8K at TEP4 with natural acceptance, at 16 and 32 concurrent requests, is within run-to-run variation of the control (paired McNemar p > 0.2), and so is the mean acceptance length.

Validation. The tree of this PR was validated as an integration branch on R200. That branch differs from this PR only in comments, strings, formatting, and the op CELLS lists and target unit tests, which this branch does not carry. On that branch:

  • the target's unit tests pass on 1, 4 and 8 GPUs, apart from failures that also occur without these changes;
  • the 8-rank bit-exact TEP8 composition checks pass.

Test Coverage

  • accuracy/modeling_v2/test_musespark_open.py (on this branch): GSM8K and mean acceptance length under modeling_v2="require". As in [None][feat] Muse Spark Open modeling_v2 TEP target: mid-high-concurrency optimizations for GB300 #20770, the modeling_v2 target is covered by the e2e accuracy test rather than unit tests.
  • Unit tests of the shared-path changes:
    • tests/unittest/_torch/attention/test_flashinfer_trtllm_gen_fmha.py: decode launch grouping;
    • tests/unittest/_torch/modeling_v2/test_modeling_v2_routing.py: the resolver records max_batch_size and it never changes the routing decision.

PR Checklist

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

🤖 Generated with Claude Code

@yuxianq

yuxianq commented Oct 22, 2026 •

Copy link
Copy Markdown
Collaborator

@yihwang-nv, could you help to review this PR as trt-llm-torch-attention-devs? Thanks~

Assignment explanation
Componentsfmha/flashinfer-trtllm-gen (45%); runtime/kv-cache/layout-io (40%); integration/attention-tests (10%); unmapped (5%)
Tagsalgorithm:dense (100%); phase:decode (100%); features:paged-kv (50%); features:speculative-decoding (50%)
PR effort8 points — Grouped decode requires reasoning about tensor slicing, per-launch metadata and workspace reuse. Windowed speculative KV updates add ordering and repeated-slot invariants, supporting 8 points without counting unrelated MoE/GEMM work. No new model architecture is demonstrated.
ImportanceImportant — run_generation changes decode launch partitioning and shared-workspace use; the new windowed commit kernel mutates K/V contents and logical-to-physical context state. Both introduce sensitive correctness and performance contracts.
Retained GitHub review requestslitaotju: preserve direct code-owner review request
Affinity (0–1)0.617 component/tag match; 0.463 after PIC preference
Outstanding points at selection41 → 49 (+8)
Points already reserved on this PR0
Effective weight1
Completed review points (preceding 168 hours)18
Combined points after assignment67
Demand-derived target59.00 points (soft share)
Additional fair share before assignment0.00 points
Share explanationWhole PR / qualification or coverage constraint exceeds a soft share; assignment is allowed.
Selection ruleaffinity with 0.3-share guard
Assignment scope (yihwang-nv)all

Affinity and workload are snapshots at selection, not live counters. Existing reservations on this PR are counted once.

@yuxianq
yuxianq requested review from yihwang-nv and removed request for kris1025 October 22, 2026 23:35
TRTLLM_GEN_DECODE_SEQS_PER_LAUNCH=N (off by default) launches the trtllm-gen
generation kernel for unwindowed attention in groups of at most N sequences, so
each group's sequences get proportionally more KV splits at large batches. With
the variable unset the decode call is the single launch it was before.

Signed-off-by: Xiao Wang <[email protected]>
modeling_v2_resolve records the engine's max_batch_size for the target class it
returns (resolved_max_batch_size). It is not a routing input; a target may read
it at construction to leave out a fast path whose memory cost only pays off at a
few concurrent requests.

Signed-off-by: Xiao Wang <[email protected]>
…l on sm107

context_sequence_parallel takes its eager-row threshold per SM version (sm103 and
sm107 each have their own), so long context steps on sm107 TEP4 use the
sequence-parallel forward and the one-launch context prep as on sm103.

Signed-off-by: Xiao Wang <[email protected]>
…ion for multi-request steps

- wide_swa_block and wide_full_attention serve decode steps of two to four
  requests (9..32 rows) on sm107 TEP4.
- multi_request_split_kv serves five to 128 requests on sm107 as on sm103; its
  CTAs per KV-head pair follow the device SM count.
- multi_request_prep_append folds the K/V append into the decode prep for steps of
  five or more sequences.
- The full-attention prep, split-KV and norm-gate ops take the multi-request row
  bands these paths need.

Signed-off-by: Xiao Wang <[email protected]>
…ter GEMMs

- wide_dense_gemms: split-K dense projections for 9..32 rows with sm107 tables.
- wide_prologue: a sharded router GEMM for 16..32 rows.
- router_gemm: multi-request router GEMM for 33..512 rows; its CTA count and split
  counts come from the device SM count (one wave), unchanged on sm103.
- batch_dense_gemms: the PDL norm-gate chain for 33..512 rows; the QKV TGV tactic
  rows are keyed by device capability and empty on sm107, where cuBLAS keeps the
  QKV projection.
- fixed low-M GEMM tables for sm107.

Signed-off-by: Xiao Wang <[email protected]>
- wide_post_attention_hop: the TP4 post-attention transport for 9..32 rows.
- multi_request_post_attention_hop (the wide hop for multi-request steps) arms from
  one row past the last row the 8-row hop takes, so exactly one hop serves each
  row count.
- wide_moe_allreduce (129..1024 rows), finalize_two_shot (from a per-SM row floor)
  and projection_publish (33..448 rows, with a certified producer for 212 SMs) are
  enabled on sm107 TEP4.
- Direct and gathered pool routes, projection inbox and unpool boundary take the
  sm107 TEP4 transports.

Signed-off-by: Xiao Wang <[email protected]>
- wide_persistent_experts: the persistent expert kernel for multi-request steps.
- half_window_experts: ring-buddy expert windows that hold half of each rank's
  experts, behind a capacity gate at small max_batch_size.
- hot_replicas on sm107 TEP4 for 33..512 rows when max_batch_size is above 8; it
  yields to half_window_experts when both would arm.
- The MoE prologue and its early expert ids take the new row bands.

Signed-off-by: Xiao Wang <[email protected]>
…arena and multi-request drafter paths

- The drafter's context K/V is committed into a windowed arena; the context-K/V
  fork and the verify fold run over it.
- drafter_fc_inbox, wide_drafter_window_attention (geometry tables per SM count),
  wide_draft_topk and wide_split_sampler serve multi-request steps on sm107 TEP4.

Signed-off-by: Xiao Wang <[email protected]>
…ast paths

The (sm107, TP4) composition serves the sm103 TEP4 base paths without the LM-head
inbox, the 2..4-request paths, and the multi-request attention, collective,
GEMM/expert, drafter and context path sets. Each path owns a row band so exactly
one implementation arms per op and row count. Capacity gates read the resolved
max_batch_size, and a yield rule keeps hot_replicas and half_window_experts from
both arming. (sm103, TP4), (sm103, TP8) and (sm107, TP8) are unchanged.

Signed-off-by: Xiao Wang <[email protected]>
@Tabrizian
Tabrizian force-pushed the mso-hcvr/agentx-tep branch from f1ad0cc to a84a8ab Compare October 23, 2026 16:06
@Tabrizian

Copy link
Copy Markdown
Member

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #80203 [ run ] triggered by Bot. Commit: a84a8ab Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #80203 [ run ] completed with state SUCCESS. Commit: a84a8ab
/LLM/main/L0_MergeRequest_PR pipeline #66007 completed with status: 'SUCCESS'

CI Report

Link to invocation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants