vllm.models.minimax_m3.amd.ops.indexer_context_parallel
¶
Opt-in M3 compute-only index context partitioning, independent of global DCP.
Functions:
-
check_context_score_inputs–Validate the layout
indexer_context_scoresassumes; call once. -
indexer_context_scores–Return [heads,tokens,ceil(blocks/world)] with round-robin logical blocks.
_decode_score_chunks(batch, local_blocks)
¶
Chunks one score row is split across.
A count, not a size: the grid is (request, chunk), so this is the
second grid dim. The round trip through the size drops chunk counts that
do not divide the blocks and would launch programs that only return.
Source code in vllm/models/minimax_m3/amd/ops/indexer_context_parallel.py
check_context_score_inputs(idx_q, index_cache, block_table, seq_lens)
¶
Validate the layout indexer_context_scores assumes; call once.
These hold for every step of a served model, so they are not re-checked on the hot path.
Source code in vllm/models/minimax_m3/amd/ops/indexer_context_parallel.py
indexer_context_scores(idx_q, index_cache, block_table, seq_lens, max_seq_len, rank, world_size, max_query_len, sm_scale, out=None)
¶
Return [heads,tokens,ceil(blocks/world)] with round-robin logical blocks.
max_seq_len sizes the grid and must be a capture-stable bound, not the
batch's own longest sequence: the grid and CHUNK are baked into a CUDA
graph at capture, where the dummy batch is one token long, and a replay
sized off that would score only the first block of each shard. Pass
max_model_len; the per-request causal bound clips the real work and
chunks past the end return immediately.
out, when given, is a [heads, >=tokens, >=local] buffer written in
place (stable address for CUDA graph capture).
Source code in vllm/models/minimax_m3/amd/ops/indexer_context_parallel.py
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 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 | |