vllm.models.deepseek_v41.amd.akr_mla
¶
Routes sparse_mla and wo_a of DeepSeek-V4.1's attention on amd_kernels.
the decode rows of the AITER sparse MLA call (plain per-tensor fp8
KV, attention sink, ragged SWA list plus the ragged top-512 list), with the inverse RoPE and MXFP8 epilogue into the buffer wo_a reads.
wo_a: the grouped MXFP8 wo_a GEMM with an MXFP8 epilogue, so wo_b (stock, or the mHC post-mix chain) reads its codes without a quantize launch. It reads the AITER-preshuffled weight the stock linear keeps (no copy). One split-K workspace per device: default stream only. wo_b: at the rows where the dense entry's decode kernel on wo_a's bf16 output (quantizer launch + GEMM) beats AITER's wo_b on the epilogue's codes, wo_a writes bf16 and the entry runs wo_b (the stock weight, shuffled scales).
Functions:
-
sparse_mla_decode–True if the kernel wrote this call's MXFP8 output.
-
wo_a–wo_a's MXFP8 output for wo_b, or None, having launched nothing.
-
wo_a_wo_b–wo_b(wo_a(attn_out)) with wo_a's bf16 output through the dense entry
_cache_ok(cache)
¶
An fp8 cache [blocks, block, 512] with a power-of-two block and
512-byte rows, the geometry the kernel reads.
Source code in vllm/models/deepseek_v41/amd/akr_mla.py
sparse_mla_decode(layer, q, positions, swa_cache, swa_indptr, swa_indices, extra_cache, extra_indptr, extra_indices, output_mxfp8)
¶
True if the kernel wrote this call's MXFP8 output.
Source code in vllm/models/deepseek_v41/amd/akr_mla.py
wo_a(layer, attn_out)
¶
wo_a's MXFP8 output for wo_b, or None, having launched nothing.
Source code in vllm/models/deepseek_v41/amd/akr_mla.py
wo_a_wo_b(layer, attn_out)
¶
wo_b(wo_a(attn_out)) with wo_a's bf16 output through the dense entry (its quantizer launch + GEMM), where that beats wo_a's MXFP8 epilogue + AITER's wo_b on the codes; None, having launched nothing, elsewhere.