vllm.models.minimax_m3.nvidia.specialized_decode.stock
¶
Every stage on the ops the stock layers run: the stock-op chain.
Each stage below runs exactly the ops MiniMaxM3DecoderLayer runs for a pure
decode step of up to MAX_ROWS rows, in the same order and with the same
arguments, split at the stage boundaries of stages.py. Run alone, the chain
reproduces the stock decode; it is also the last implementation of every
stage, which a kernel stage falls back to for the steps it does not support.
Two places split one stock call in two:
MiniMaxM3IndexerMSAImpl.forwardisStockIndexScore(its decode branch) followed byStockPageTopK(its unified top-k); executor steps have no prefill rows, so its prefill branch never runs.MiniMaxM3MoE.forwardcomputes the router logits, then runs the experts;StockAllReduceNorm.post_attentioncomputes the logits andStockMoEthe experts.
Classes:
-
StockAllReduceNorm–forward_input_norm, the post-attention -
StockDenseDecode–MiniMaxM3Attention.attn: the platform's attention backend. -
StockFront–MiniMaxM3SparseAttention.forward/MiniMaxM3Attention.forward -
StockIndexScore–The decode branch of
MiniMaxM3IndexerMSAImpl.forward: the CuTe DSL -
StockMoE–MiniMaxM3MoE.forward(orforward_unfinalized) after the router: -
StockPageTopK–The unified top-k of
MiniMaxM3IndexerMSAImpl.forward: -
StockSparseDecode–attn.impl.forward: the MSA sparse decode (CUTLASS, or Triton where
Functions:
-
stock_stages–The stock-op chain: one stock implementation per stage.
StockAllReduceNorm
¶
Bases: AllReduceNormStage
forward_input_norm, the post-attention
fused_allreduce_gemma_rms_norm (+ the MoE router) and the final norm
of MiniMaxM3Model.forward.
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
StockDenseDecode
¶
Bases: DenseDecodeStage
MiniMaxM3Attention.attn: the platform's attention backend.
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
StockFront
¶
Bases: FrontStage
MiniMaxM3SparseAttention.forward / MiniMaxM3Attention.forward
up to the attention: qkv_proj and
fused_minimax_m3_qknorm_rope_kv_insert. Executor steps stay below the
fused qkv epilogue's 512 rows, so it never runs.
Methods:
-
run_qkv–The sparse front after
qkv_proj: q/k norms, RoPE and the KV /
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | |
run_qkv(attn, qkv, num_tokens, dtype, positions)
staticmethod
¶
The sparse front after qkv_proj: q/k norms, RoPE and the KV /
index-K cache insert of qkv (a kernel QKV projection reuses it).
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
StockIndexScore
¶
Bases: IndexScoreStage
The decode branch of MiniMaxM3IndexerMSAImpl.forward: the CuTe DSL
(or Triton, for wide query tiles) decode score into the unified score
buffer.
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
StockMoE
¶
Bases: MoEStage
MiniMaxM3MoE.forward (or forward_unfinalized) after the router:
the shared expert and the routed experts on the configured NVFP4 MoE
backend.
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
StockPageTopK
¶
Bases: PageTopKStage
The unified top-k of MiniMaxM3IndexerMSAImpl.forward:
fmha_sm100.sparse_topk_select into the shared top-k buffer.
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
StockSparseDecode
¶
Bases: SparseDecodeStage
attn.impl.forward: the MSA sparse decode (CUTLASS, or Triton where
CUTLASS has no plan) over the shared top-k buffer.
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
_finalize_moe_output(out, rows)
¶
The un-reduced BF16 FFN partial of an unfinalized MoE output: the weighted top-k sum of the GEMM2 rows (fp32), times the routed scale, plus the shared expert.
Source code in vllm/models/minimax_m3/nvidia/specialized_decode/stock.py
stock_stages()
¶
The stock-op chain: one stock implementation per stage.