vllm.models.minimax_m3.amd.sp_prefill_akr
¶
The amd_kernels sp_prefill route (TP4): the sequence-parallel prefill from
4096 tokens. Each rank keeps a shard of the residual stream; per layer the two
all-reduces become the hand-offs of
amd_kernels.collectives.seq_parallel_handoffs_h6144_q2048_ranks4 (pull
collectives for a single batch, SDMA pushes per DBO microbatch) around the layer's
own attend and the FFN of every token, with the whole o_proj on every rank.
Functions:
-
forward–The SP forward of
modelfrom the embeddings to the final norm. -
full_o_proj_layers–The decoder layers of
model(aMiniMaxM3Model) with an o_proj_full. -
load_o_proj_full–A
WeightsMapperweights transform: each checkpoint o_proj tensor of a layer -
make_o_proj_full–At decoder-layer init: the whole o_proj on amd_kernels' MXFP8 GEMMs (+3.1 GB
-
plan_model–Whether this forward runs the amd_kernels SP layers.
_check(model, hidden_states)
¶
At the first SP-sized forward (the profile run): check the layers once and build the communicators.
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
_dense_mlp(mlp, codes, scales)
¶
The dense MLP of every token -> its TP partial [padded, H] (no reduce).
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
_gemm(layer, codes, scales)
¶
A switched MXFP8 linear on row-major codes with preshuffled (AITER) scales.
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
_init(device, layers)
¶
Build and warm up the communicators (collective: every TP rank).
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
_unsupported(layer)
¶
None when layer can run the amd_kernels SP layer, else why not.
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
forward(model, positions, hidden_states, aux_hidden_states)
¶
The SP forward of model from the embeddings to the final norm.
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
full_o_proj_layers(model)
¶
The decoder layers of model (a MiniMaxM3Model) with an o_proj_full.
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
load_o_proj_full(weights, layers)
¶
A WeightsMapper weights transform: each checkpoint o_proj tensor of a layer
in layers once more, for its o_proj_full.
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
make_o_proj_full(layer, quant_config, prefix)
¶
At decoder-layer init: the whole o_proj on amd_kernels' MXFP8 GEMMs (+3.1 GB per rank at TP4), or None where the sequence-parallel prefill cannot run.
Source code in vllm/models/minimax_m3/amd/sp_prefill_akr.py
plan_model(model, hidden_states)
¶
Whether this forward runs the amd_kernels SP layers.