vllm.models.minimax_m3.amd.dspark_akr
¶
The amd_kernels draft route (gfx950, TP4, the draft not torch.compiled): the
MiniMax-M3.1 DSpark draft's attention, context K/V, MXFP8 linears and shared lm_head;
dspark_akr_fused runs the rest of its forward, sample_akr its sampling.
Classes:
-
AkrShuffledLmHeadMethod–The lm_head's GEMM on amd_kernels'
bf16_gemm_n50016_k6144over the shard in
Functions:
-
attach–From
MiniMaxM3DSparkForCausalLM.__init__, before the weights load. -
attention_forward–MiniMaxM3DSparkAttention.forwardafter its qkv_proj: q/k-norm + RoPE + fp8 -
plain_processor–A logits processor that only applies the lm_head (bf16, full vocabulary).
-
setup–The speculator's
akr_setuphook (every TP rank, afterload_model, before -
switch_shared_lm_head–Shuffle the lm_head's shard in place (a permutation of its storage) and give it
AkrShuffledLmHeadMethod
¶
Bases: UnquantizedEmbeddingMethod
The lm_head's GEMM on amd_kernels' bf16_gemm_n50016_k6144 over the shard in
shuffle_weight's layout (any row count).
Source code in vllm/models/minimax_m3/amd/dspark_akr.py
_attention(attn, q, attn_metadata, layer, kv_cache)
¶
o_proj's input: the library's MXFP8 codes where the fused draft marked the layer
(not in a breakable PIECEWISE capture), else bf16 [tokens, heads * 128]. Rows of
no request are not written; the profile run (no metadata) gives zeros; metadata past
the kernel's case goes to the layer's TritonAttentionImpl.
Source code in vllm/models/minimax_m3/amd/dspark_akr.py
_query_ok(attn)
¶
The library's layer shape and RoPE, an fp8 KV cache under TRITON_ATTN (the
layout [pages, KV heads, page, 256]).
Source code in vllm/models/minimax_m3/amd/dspark_akr.py
attach(model)
¶
From MiniMaxM3DSparkForCausalLM.__init__, before the weights load.
Source code in vllm/models/minimax_m3/amd/dspark_akr.py
attention_forward(attn, qkv, positions)
¶
MiniMaxM3DSparkAttention.forward after its qkv_proj: q/k-norm + RoPE + fp8
K/V insert, the sliding-window attention over the fp8 cache, o_proj.
Source code in vllm/models/minimax_m3/amd/dspark_akr.py
plain_processor(lp)
¶
A logits processor that only applies the lm_head (bf16, full vocabulary).
Source code in vllm/models/minimax_m3/amd/dspark_akr.py
setup(spec, model, target_model)
¶
The speculator's akr_setup hook (every TP rank, after load_model, before
any capture): the shared lm_head's layout, the fused forward, the sampling.
Source code in vllm/models/minimax_m3/amd/dspark_akr.py
switch_shared_lm_head(lm_head, logits_processor, models)
¶
Shuffle the lm_head's shard in place (a permutation of its storage) and give it the method above: the target's and the draft's logits run the library GEMM. Refused when another parameter holds the same tensor (a tied embedding).