vllm.models.minimax_m3.nvidia.msa_cutlass_sparse_decode
¶
MiniMax CUTLASS sparse decode using per-query-token page indices.
Classes:
-
MSACutlassDecodePlanCache–Reusable plans whose mutable tensors retain cudagraph-stable addresses.
Functions:
-
msa_cutlass_sparse_decode–Run CUTLASS sparse decode with metadata prepared by the MSA builder.
-
nvfp4_kv_cache_slots–Return the per-head K and V slots of an NVFP4 cache.
-
nvfp4_kv_cache_views–Return the K data, K scale, V data and V scale views of an NVFP4 cache.
-
prepare_decode_metadata–Prepare graph-stable runtime metadata for one sparse decode step.
-
should_prepare_decode_metadata–Return whether a graph shape can use the CUTLASS decode path.
-
supports_cutlass_sparse_decode–Return whether static model geometry supports CUTLASS sparse decode.
MSACutlassDecodePlanCache
dataclass
¶
Reusable plans whose mutable tensors retain cudagraph-stable addresses.
Source code in vllm/models/minimax_m3/nvidia/msa_cutlass_sparse_decode.py
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 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 | |
msa_cutlass_sparse_decode(query_fp8, kv_cache, topk, output, metadata, *, scale, q_scale_float, k_scale_float, v_scale_float, k_scale=None, v_scale=None)
¶
Run CUTLASS sparse decode with metadata prepared by the MSA builder.
NVFP4 caches are uint8 head-slot pages (see nvfp4_kv_cache_views) and
take the device global scales k_scale/v_scale.
Source code in vllm/models/minimax_m3/nvidia/msa_cutlass_sparse_decode.py
nvfp4_kv_cache_slots(kv_cache)
¶
Return the per-head K and V slots of an NVFP4 cache.
nvfp4_kv_cache_views(kv_cache)
¶
Return the K data, K scale, V data and V scale views of an NVFP4 cache.
kv_cache is uint8 [pages, 2 * Hkv, page_size, 72]; slot
2 * head + side (K = 0, V = 1) is that head's E2M1 data
[page_size, 64] followed by its E4M3 block scales [page_size, 8],
the one page layout fmha_sm100 reads.
Source code in vllm/models/minimax_m3/nvidia/msa_cutlass_sparse_decode.py
prepare_decode_metadata(block_table, seq_lens, seq_lens_cpu, decode_query_len, *, num_q_heads, num_kv_heads, page_size, topk_blocks, plan_cache=None)
¶
Prepare graph-stable runtime metadata for one sparse decode step.
Source code in vllm/models/minimax_m3/nvidia/msa_cutlass_sparse_decode.py
should_prepare_decode_metadata(batch_size, decode_query_len, *, decode_backend, num_q_heads, num_kv_heads, kv_cache_dtype, page_size, topk_blocks)
¶
Return whether a graph shape can use the CUTLASS decode path.
Source code in vllm/models/minimax_m3/nvidia/msa_cutlass_sparse_decode.py
supports_cutlass_sparse_decode(*, decode_backend, num_q_heads, num_kv_heads, kv_cache_dtype, page_size, topk_blocks)
¶
Return whether static model geometry supports CUTLASS sparse decode.