Skip to content

[None][feat] MiniMax-M3.1 NVFP4 context (prefill) path on Rubin (SM107) - #21039

Draft
peihu-nv wants to merge 39 commits into
NVIDIA:mainfrom
peihu-nv:peihengh/m31-vr-prefill-pr-draft
Draft

peihu-nv wants to merge 39 commits into
NVIDIA:mainfrom
peihu-nv:peihengh/m31-vr-prefill-pr-draft

Conversation

@peihu-nv

@peihu-nv peihu-nv commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Depends on #21038 (MiniMax-M3.1 Rubin SM107 decode), which depends on #20917. This branch contains both of their commits; review only the top commit, "MiniMax-M3.1 NVFP4 context (prefill) path on Rubin (SM107)".

Description

Adds the MiniMax-M3.1 NVFP4 context (prefill) path for Rubin (SM107): a TP2 context target for disaggregated context workers, plus the prefill items of the TP2 aggregated target. It also vendors the MSA sparse-attention kernels this path needs and builds them with the wheel.

Everything is default ON on SM107 and exact against the stock path (bitwise, or the same math in a fixed order). Each item has a TRTLLM_M31_DISABLE_<ITEM>=1 kill switch; TRTLLM_M31_DISABLE_TP2CTX=1 drops the whole context target.

Area Items (kill switch suffix)
QKV fused QKV + index GEMM with the cache producer, from a shipped CuTe DSL AOT object (TP2CTX_QKV_FUSED, TP2CTX_QKV_ROWS)
Norm / quantize boundary RMSNorm + MXFP8 / NVFP4 quantize in one op; FP32 router input (TP2CTX_NORMQ, TP2CTX_NORMQ_F32, TP2CTX_GATE_CAST, CTXNORMQ)
Sequence parallel SP boundaries, copy-engine peer pushes, peer add fused into the norm (TP2CTX_SP, TP2CTX_SP_OVL, TP2CTX_SP_PMOVL, TP2CTX_SP_ADDNORM; agg: TP2AGG_SP, AGG_SP_PREMOE)
GEMM / MLP pinned cuBLASLt MXFP8 projections; SwiGLU-OAI + MXFP8 quantize for the shared expert and dense MLP (TP2CTX_MXFP8_CUBLASLT, TP2CTX_SWIGLU_MXFP8, AGG_PREFILL_CUBLASLT)
Sparse attention combine writes o_proj's MXFP8 input; prefill tile select; 128-row indexer proxy plan; in-place sparse output (TP2CTX_COMBINE_MXFP8, TP2CTX_TSEL, TP2CTX_PROXY_Q128, TP2CTX_SPARSE_OUT, AGG_TSEL, AGG_PROXY_Q128)
CUDA graphs the prefill items inside breakable CUDA graphs (TP2CTX_ITEMS_IN_BCG, TP2CTX_A1_IN_BCG); prefill output clone for graph output reuse (PREFILL_OUT_CLONE)
Scheduling LPT step order; pinned AllReduce heuristic (TP2CTX_SCHED_LPT)
Serving prefix-cache hits spliced into an int32 array, context-only prompt ids sent from it (PTC_ARRAY_SPLICE, PTC_INT32_REPLY); ConversationRouter per-server in-flight cap, late binding and session TTL (config keys, default off)
Opt-in exact K=32 index scorer (TRTLLM_M31_ENABLE_TP2CTX_IDX_SCORER=1)

Kernels: the C++ ops (SP add-norm, CTXNORMQ, SwiGLU + MXFP8, MXFP8 cuBLASLt out=, the context peer ops, NVFP4 index-K) are built in-tree, with fake implementations for torch.compile. The MSA fmha_sm100, fmha_sm100_q8kv8 and prefill_bf16x kernels are vendored from vllm-project/MSA@25c1447 (MIT; one Apache-2.0 file; lock, license and notice files included) and built ahead of time by build_wheel.py. That replaces the external fmha_sm100 package and the native-library fallback loaders.

Results (Rubin, MiniMax-M3.1-Flash NVFP4, AgentX SA client)

Client: the SA InferenceX AgentX harness 1.0.12 preset. Acceptance: synthetic (forced) K7 AL 4.04; natural AL not demonstrated. Y = output-export total token throughput per GPU; X = per-user generation tokens/s.

Cell Topology GPUs Y / GPU X_P90 X_med
agg c20 TP2 2 76.87K 479.3 535.8
agg c32 TP2 2 128.38K 282.0 410.4
agg c56 TP2 2 212.97K 200.9 262.2
agg c68 TP2 2 243.10K 163.6 209.4
dis-X c16 CTX TP2 + GEN TP8 (batch 1) 10 11.86K 1227.2 1310.6
dis-T c24 CTX TP2 + 2 x GEN TP4 (batch 1) 10 19.64K 980.6 1024.7
anchor-Y c64 CTX TP2 + 4 x GEN TP2 (batch 2) 10 50.72K 611.5 658.3

The agg rows ran an image one step older than the disaggregated rows; the difference is context-only (the SP pre-MoE fix, plus a decode-side register_fake, and their tests). Since the sweep, this commit only adds the ConversationRouter late-binding fixes listed below, which the swept runs did not exercise. dis-X and dis-T are latency cells: the generation servers run batch 1 by configuration.

Changes to shared #20917 code

  • Prefill tile select (selectPrefillTileSm103): a selected score that is a negative NaN is now emitted as -1 (it was emitted as its block id), as the reference minimax_m3_select_blocks does for -inf. Outputs change only when an indexer score is a negative NaN. GB path changed, not GB-hardware-tested.
  • Vendored MSA: the SM103 (GB300) targets now load the MSA kernels from the vendored tree (vllm-project/MSA@25c1447 plus the vendor patches in 3rdparty/vendor_patches/) instead of the external fmha_sm100 package. GB path changed, not GB-hardware-tested.
  • Context RMSNorm + MXFP8 op (ctxResidualRmsNormMxfp8Sm103): an optional FP32 side output and the SM107 device check; existing callers get the same kernel instantiation. GB path unchanged.
  • Model routing: a new branch for the SM107 TP2/EP2 context worker only. GB routing unchanged.

ConversationRouter late-binding fixes (added after the sweep)

With late_bind, a queued turn could stall the whole queue: one that excluded every live server waited forever, a server removal could leave the queued head without a candidate, and a head waiting for a busy server held back turns that could take the server it excluded. The coordinator path also ignored late_bind. Now dispatch walks the queue in order, skipping (not blocking on) a turn whose candidates are all at the cap; a turn with no live candidate fails with the ordinary "No available servers after excluding ..." error; adding or removing a server re-runs dispatch; and the coordinator path rejects late_bind.

Follow-up commits on this PR

  • Precompiled installs (TRTLLM_USE_PRECOMPILED) keep the vendored MSA sources from the checkout; only the CUTLASS headers the wheel build stages come from the wheel.
  • The TP2 context target arms the late-compile detector after warmup, as the generation targets do.
  • ConversationRouter late binding dispatches waiting turns after every server-list change, including servers found by the metadata monitor.
  • Merges of [None][feat] Add Rubin (sm_107) MiniMax-M3.1 low-latency decode targets #21038's follow-ups (the disaggregated first-verify fix, TOPP_V6 gated to SM107, the shared SM107 opt-ins armed at routing, and two test updates). The TP2 context route arms the same shared opt-ins as the generation targets.

Pending updates

  • Context-side follow-ups below that land before review, as further commits on this PR.

Known limitations and follow-ups

  • CTX MoE runs on TRTLLM-Gen. The CuTe DSL MoE needs the SwiGLU-bias epilogue, which the current backend does not expose, so the routed experts stay on TRTLLM-Gen. Those route inside their kernel, so the SP pre-MoE boundary is declined and runs full-T (logged once). Porting the epilogue is a follow-up.
  • Disaggregated GEN first verify (decode side): a generation-only request's first rejection-sampling verify could read a stale draft-probability row and, rarely, emit an out-of-range id. Seen as 2 failed requests in dis-T (plus the stock post-processing cascade they caused). The fix is folded into the decode PR.
  • Late compiles: the one reported late compile in the agg cells is a first-use load from the disk cache, not a JIT; tagging disk hits is a follow-up.
  • Docs: the build-from-source guide still mentions the removed 3rdparty/fmha_sm100 symlink; a follow-up updates it.
  • First-run caches: FlashInfer JIT, CuTe DSL FlashInfer kernels and Inductor compile on first use unless their caches are seeded; the measurements used seeded caches.
  • Generation batch size: the dis-X / dis-T cells are latency cells (GEN max_batch_size 1); TP4 / TP8 GEN SwiGLU above 8 rows uses the stock Triton kernel (the native ops are TP2-only).
  • MSA int32 offsets: very long sequences (about 1M tokens) at a large batch can overflow; set max_batch_size accordingly.
  • Dependencies: nvidia-cutlass-dsl 4.8.0 as in upstream requirements; flashinfer-cubin 0.6.18 is an optional dependency for Rubin.
  • Native builds are not byte-reproducible across rebuilds (same sources, different .so bytes).

Test Coverage

Run on Rubin (SM107) with a wheel built from this stack, nvidia-cutlass-dsl 4.8.0:

  • tests/unittest/_torch/modeling_v2/models/minimax_m3/minimax_m31_nvfp4__sm_107__tp2ctx/: 274 passed, 10 skipped, including the SP pre-MoE boundary tests.
  • tests/unittest/_torch/attention/sparse/msa/test_msa_vendored_imports.py: the vendored MSA packages import without the top-level names, in-process and in a fresh interpreter.
  • register_fake coverage: every PR op with a CUDA kernel has a fake implementation.
  • Prefill, TP2 aggregated, shared, disaggregated and serve unit tests: 0 failures, except 4 known FakeMetadata failures inherited from [None][perf] Add GB300 MiniMax-M3.1 low-latency decode targets #20917.
  • At the current head on Rubin: tests/unittest/disaggregated/test_router.py 113 passed (all 13 late-binding tests), test_openai_disagg_server.py 21 passed, tests/unittest/others/test_precompiled_link_mode.py 12 passed, and the TP2 context late-compile test 2 passed.

New tests sit next to the existing MiniMax-M3.1 tests for the same target; they are not yet added to a CI test list (see the CI placement note).

CI placement: the SM107 tests need Rubin GPUs, which CI does not run yet; CPU-only cases run on any GPU stage once listed.

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-compatible or api-breaking. For api-breaking, include BREAKING in 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.

GitHub Bot Help

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

pranav-nvidia and others added 23 commits October 22, 2026 18:03
MXFP8 non-expert projections with NVFP4 routed experts on the existing model:
model_config expands the packaging's expert recipe into the mixed per-layer
config, the weight mapper renames the packed expert tensors and inverts their
global scales, MXFP8 index projections and fused MXFP8 shards load their own
block-scale rows, the sparse cache manager takes the layer schedule from the
checkpoint and counts index-K bytes, the router GEMM runs in FP32 cuBLAS, and
the VL input processor loads the HF processor only for image requests.

Signed-off-by: Pranav Shrestha <[email protected]>
MiniMaxM3Gate keeps a BF16 split of its FP32 router weight (three terms
along K, built at load_weights, the multi-term emulation of CUTLASS's 3xTF32
GEMMs). BF16 inputs run one cuBLAS BF16 GEMM with FP32 accumulation over the
replicated input instead of an FP32 cast plus a SIMT SGEMM; FP32 inputs keep
the FP32 cuBLAS GEMM. Top-k parity against an FP64 reference is tested.

Signed-off-by: Pranav Shrestha <[email protected]>
KV pool and block-scale views are built once per layer and layout, the fused
QKV/index producer caches its per-layer-invariant arguments, block-id rows are
copied from the page-index buffers, the MSA metadata builders do their
batch-sized index arithmetic in numpy, and the NVFP4 decode and CSR prefill
wrappers resolve the device capability and the fmha_sm100 API once. Same
kernels, same arguments; adds prefix-reuse and BF16-cache decode tests.

Signed-off-by: Pranav Shrestha <[email protected]>
…SM107

The MiniMax-M3 Triton NVFP4 sparse decode kernels run on SM107, so keep
NVFP4 KV for that path instead of falling back to FP8 and include SM107
in the decode capability list and test guards.

Signed-off-by: Pranav Shrestha <[email protected]>
…deo tokens per patch

trtllm-serve and the multimodal prompt builders mark their rendered TextPrompt
with chat_template_applied; the input processor uses it verbatim instead of
wrapping it in a second user turn, normalises a framed marker, and rejects a
marker/media count mismatch before the HF processor runs. Media arrive as
uint8 numpy, and video tokens count one start/end bracket per temporal patch.

Signed-off-by: Pranav Shrestha <[email protected]>
…king on multimodal requests

Forward the pre-fusion token ids as orig_input_ids so the spec worker
(DSpark/DFlash, MTP, Eagle) sees them after fuse_input_embeds drops
input_ids, and slice the vision embeddings with find_input_mm_embeds so a
cached prefix or a chunk boundary inside a placeholder span no longer
trips the token-count check.

Signed-off-by: Pranav Shrestha <[email protected]>
The input processor implements the token-ID expansion hooks but never
set the opt-in flag, so a prompt_token_ids + image request was
detokenized and re-templated, doubling the image marker and failing the
marker count check. Set the flag and test the dispatch end to end.

Signed-off-by: Pranav Shrestha <[email protected]>
The drafter's nested HF config is flattened, its checkpoint tensors renamed,
MXFP8 linears dequantized and Gemma norm weights folded at load. Its KV pool
uses its own page size, is funded for its attention window plus the chunk in
flight, and the unpaired draft mirror is sized from the target request and
keeps the chunk start as history; the block decode reads a rebased table.

Signed-off-by: Pranav Shrestha <[email protected]>
… generation-init requests

A generation worker receives the prompt KV instead of prefilling it and
starts the drafter on a fresh slot, so the draft mirror never holds K/V
for the transferred prompt. Treat that prompt as history on gen-init so
the drafter's window trims the mirror to its tail plus headroom, instead
of asking for a prompt-sized chunk that exceeds the pool funding.

Signed-off-by: Pranav Shrestha <[email protected]>
…ligned reused prefix

On an unpaired draft pool the block decode reads a view rebased by the rounded-up base of a reused prefix.
While the stored tail is shorter than that base, entry 0 of the view lies past the request's allocation and resolves to page 0, so the block's own K/V landed in another request's page and the drafter stayed blind until the context caught up.
The view is now shifted only to the page holding the context length on those steps; the shortened read length is unchanged, so nothing below the base is read.
Adds a CPU test that walks every context length of that window.

Signed-off-by: Pranav Shrestha <[email protected]>
…sing in step

Resolve the parser's mode from thinking_mode or the prompt-resolved relay instead
of the bare thinking flag, so a prefilled <mm:think> block is read as reasoning.
Report truncated reasoning as reasoning in the non-streaming parse and make the
streaming parser emit the same split: unopened </mm:think> is a delimiter, text
before an opening tag is content, partial tags are withheld at chunk boundaries.

Signed-off-by: Pranav Shrestha <[email protected]>
The deployment guide gains a linkable "Serving MiniMax-M3.1-Flash" section
(bundled DSpark drafter, KV cache reuse, NVFP4 KV cache on SM107, thinking_mode
and reasoning parsing) and states that both MoE backends load the NVFP4 expert
packaging with the same static recipe. The supported-models matrices and the
sparse-attention page now say block reuse is supported and mixed MXFP8/NVFP4 loads natively.

Signed-off-by: Pranav Shrestha <[email protected]>
…okenization cache

`TransformersTokenizer` delegates `num_special_tokens_to_add` to the wrapped
tokenizer (the base class raises), so the MiniMax-M3 input processor's
tokenization-cache check runs. `resolve_hf_chat_template` falls through to the
tokenizer's template when the processor's `chat_template` is None.

Signed-off-by: Pranav Shrestha <[email protected]>
….4.0a1

The side-branch release job derives its wheel and container version from tensorrt_llm/version.py, so the branch gets its own alpha base instead of sharing the main nightlies' 1.4.0rc1 line.

Signed-off-by: Pranav Shrestha <[email protected]>
…#20564)

Signed-off-by: Yanchao Lu <[email protected]>
(cherry picked from commit ee7c59a)
Signed-off-by: Yanchao Lu <[email protected]>
Use the 1.4.0a0 base required by the side-branch release convention and keep the README badge and example dependency constraint aligned.

Signed-off-by: Yanchao Lu <[email protected]>
Signed-off-by: Tyler Burt <[email protected]>
(cherry picked from commit c962edd)
Signed-off-by: Yanchao Lu <[email protected]>
Add SM103 TP8 single-request decode through eight rows and TP4 decode through 32 rows, with shared native kernels and guarded DSpark runtime integration.

Signed-off-by: peihengh <[email protected]>
Add the MiniMax-M3.1 NVFP4 decode targets for Rubin (sm_107) at TP2, TP4
and TP8, stacked on the GB300 low-latency decode targets.

- Decode megakernel paths for sm_107: fused attention / MoE engines,
  multicast all-reduce + norm, the F3 prepushed all-reduce, the S2 MoE
  tail, DSpark drafting with C++ glue ops, and deterministic top-p.
- Native SwiGLU-OAI and MoE finalize ops for the TP2 target, bit for bit
  the Triton kernels they replace.
- CuTe DSL kernels loaded from ahead-of-time objects shipped in the
  wheel, keyed on the toolchain, kernel sources and model switches.
- Bundled tactic pins (name-keyed, plus index-keyed entries under a
  native-build guard), also served under TRTLLM_CACHE_DIR.
- Disaggregated serving: the DSpark draft context window transfers with
  the KV cache.
- LlmRequest takes context-only prompt tokens as an int32 array.
- DFlash rejection sampling writes full-width context one-hot draft
  probabilities.
- nvidia-cutlass-dsl is pinned to the 4.8.0 release.

Each optimization is on by default with a TRTLLM_M31_DISABLE_<ID> kill
switch.

Signed-off-by: peihengh <[email protected]>
Adds the MiniMax-M3.1 TP2 context target for SM107 (disaggregated context
workers) and the prefill items shared with the TP2 aggregated target. Items are
default ON on SM107; each has a TRTLLM_M31_DISABLE_<ITEM>=1 kill switch, and
TRTLLM_M31_DISABLE_TP2CTX=1 drops the whole context target.

Context target (TP2CTX_*):
- Fused QKV + index GEMM with the cache producer, loaded from a shipped CuTe
  DSL AOT object (QKV_FUSED, QKV_ROWS).
- Prefill boundary RMSNorm + MXFP8 / NVFP4 quantize in one op, with an FP32
  router input (NORMQ, NORMQ_F32, GATE_CAST).
- Sequence-parallel boundaries with copy-engine peer pushes and the peer add
  fused into the norm (SP, SP_OVL, SP_PMOVL, SP_ADDNORM). The pre-MoE boundary
  is taken only for routed experts that route through routing_method.apply.
- Pinned cuBLASLt MXFP8 projections, SwiGLU-OAI + MXFP8 quantize for the
  shared expert and dense MLP, and the sparse-prefill combine publishing
  o_proj's MXFP8 input (MXFP8_CUBLASLT, SWIGLU_MXFP8, COMBINE_MXFP8).
- Prefill tile select, a 128-row indexer proxy plan, in-place sparse output and
  the prefill items inside breakable CUDA graphs (TSEL, PROXY_Q128, SPARSE_OUT,
  ITEMS_IN_BCG, A1_IN_BCG).
- LPT step scheduling, a pinned AllReduce heuristic, an opt-in exact index
  scorer (TRTLLM_M31_ENABLE_TP2CTX_IDX_SCORER) and the CuTe DSL MoE when the
  installed backend implements the SwiGLU-bias epilogue (CUTEDSL_MOE,
  UNPERMUTE_ADD).

Aggregated TP2 prefill items: SP and pre-MoE SP boundaries, prefill cuBLASLt
MXFP8, tile select, proxy plan, CTXNORMQ, FP32 router input and the prefill
output clone (AGG_*, TP2AGG_*, CTXNORMQ, PREFILL_OUT_CLONE).

Serving: prefix-cache hits spliced into an int32 array and context-only prompt
ids serialized from it (PTC_ARRAY_SPLICE, PTC_INT32_REPLY); ConversationRouter
gains a per-server in-flight cap, late binding and a session TTL.

Kernels and packaging: the C++ ops (SP add-norm, CTXNORMQ, SwiGLU + MXFP8,
MXFP8 cuBLASLt out=, peer ops, NVFP4 index-K) are built in-tree. The MSA
fmha_sm100 / q8kv8 / bf16x kernels are vendored from vllm-project/MSA (MIT,
with license and notice files) and built ahead of time with the wheel, which
drops the external fmha_sm100 package and the native-library fallback loaders.

Signed-off-by: peihengh <[email protected]>
… installs

A precompiled install selects package data by the wheel's patterns, which now
include the vendored MSA csrc / cute sources, so it copied (or linked) the
precompiled revision's copies over the checkout's tracked sources. Treat the
vendored MSA tree as source-owned, except the CUTLASS headers build_wheel.py
stages, as the telemetry schemas and the OpenEngine contract already are.

Signed-off-by: peihengh <[email protected]>
…t verify under rejection sampling

A generation-only request received from the context server entered with dummy (or context-server) draft tokens, so the
one-hot placeholder row was never requested (py_needs_onehot_draft_probs is set only for requests without draft
tokens) and its first rejection-sampling verify read the slot's stale or uninitialized draft-probability row. A stale
row accepts the dummy tokens; an uninitialized one can make chain_speculative_sampling emit an out-of-range token id.

disagg_gen_first_draft_tokens (speculative/utils.py) now picks the first draft tokens at receive: under rejection
sampling always dummy zeros with the one-hot row requested (no proposal row exists on this server); otherwise the
previous behaviour. CPU UT in speculative/hw_agnostic.

Signed-off-by: peihengh <[email protected]>
…fter warmup

The context-only server never called mark_server_ready(): the executor arms
it only for models whose RuntimeHooks opt into late_compile_detect, which the
generation targets do and the TP2 context target did not.

Signed-off-by: peihengh <[email protected]>
…y server-list change

The late-binding queue was re-dispatched on add_server / remove_server only,
so a server the metadata monitor added or removed left waiters queued until
the next request event. Router gets an _after_servers_updated hook, run with
the lock held after each server-list change once new servers are prepared
(add_server, remove_server and the metadata monitor); ConversationRouter
dispatches its waiters from it.

Signed-off-by: peihengh <[email protected]>
…out preparation

It runs after the preparation attempts of the new servers, not only after a
successful preparation; a server that fails preparation stays eligible, as it
is for ordinary routing.

Signed-off-by: peihengh <[email protected]>
…ost arrays

- toppRenormDetV3Sm103: the TOPP_V6 chain-prefetch summation now runs only on
  sm_107 devices (the same per-device compute-capability check as REJ v3);
  other devices, including GB300 callers, run the staged loop as before.
  TRTLLM_M31_DISABLE_TOPP_V6 still turns it off everywhere. Each kernel
  variant sets its own shared-memory attribute.
- LlmRequest binding: the int32 token-array fast path accepts host arrays
  only (nb::device::cpu); a device array takes the element-wise cast instead
  of a memcpy from a device pointer. Unit test with a CUDA tensor.

Signed-off-by: peihengh <[email protected]>
…gets that opt in

Shared paths this PR added were on for every model that reached them. Each
is now a model opt-in that only the sm_107 MiniMax-M3.1 targets arm, and
keeps its kill switch:

- RuntimeHooks fields (default False): draft_kv_reserve_guard (armed by the
  KV-cache creator before sizing), kv_gpu_prefetch, context_token_array,
  msa_prefill_fork, proxy_ms_reuse, context_onehot_index_fill and
  dflash_host_ctx_alloc (armed by the executor before warmup).
- Ahead-of-time CuTe DSL objects are served only after routing selects an
  sm_107 target (cute_aot.arm, before the model builds its kernels); an
  unarmed process compiles with no lookup, export or log line.
- The TP2 / TP4 / TP8 targets arm all of them, so their behaviour is
  unchanged.

Unit tests: the opt-in and kill-switch semantics, the unarmed AOT path, and
a source check that every sm_107 target arms each shared opt-in.

Signed-off-by: peihengh <[email protected]>
…ts role runs with

The shared sm_107 paths are now model opt-ins (RuntimeHooks fields, off by
default). The TP2 context target arms the ones the context role ran with
(draft_kv_reserve_guard, kv_gpu_prefetch, context_token_array,
msa_prefill_fork, proxy_ms_reuse, context_onehot_index_fill and
dflash_host_ctx_alloc), and its route arms the ahead-of-time CuTe DSL objects
(cute_aot.arm) for its fused QKV kernel. Without them the context role would
silently run the stock paths and JIT that kernel at startup.

The late-compile UT no longer arms the target's process-wide opt-ins; a new
UT checks each opt-in and the route's cute_aot.arm call.

Signed-off-by: peihengh <[email protected]>
A CUDA int32 tensor no longer takes the host-array copy; it takes the
sequence cast, which rejects it, as before the fast path existed. The test
asserts that rejection instead of a read through the element-wise cast.

Signed-off-by: peihengh <[email protected]>
…not opt in

The startup line reads "disabled (kill switch)" only when the kill switch
is set; a model that does not opt in reads "inactive (the model does not
opt in)". The parametrized state test covers both.

Signed-off-by: peihengh <[email protected]>
The shared opt-ins are now armed by routing, process-wide, when it selects
an sm_107 target (arm_sm107_shared_opt_ins, before the model is built),
instead of through the targets' RuntimeHooks. The target directories are
the source digest of their shipped ahead-of-time CuTe DSL objects, so
leaving them unedited keeps every shipped object valid. The RuntimeHooks
fields stay as the opt-in for other models. Unit test: routing arms every
opt-in before returning an sm_107 target, and the helper sets every flag.

Signed-off-by: peihengh <[email protected]>
…t routing

Routing now arms the shared sm_107 paths process-wide
(arm_sm107_shared_opt_ins) instead of the targets' RuntimeHooks. The TP2
context target's route is separate from the generation targets', so it calls
the helper itself (it also serves the ahead-of-time CuTe DSL objects), and the
seven opt-in fields leave the context target's RuntimeHooks. The UT checks the
context route's call.

Signed-off-by: peihengh <[email protected]>

This branch has not been deployed

No deployments
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