vllm.models.minimax_m3.amd.sparse_attention_nvfp4
¶
MiniMax M3 block-sparse attention over an NVFP4 K/V cache on ROCm (gfx950).
The cache spec is NVIDIA's, but the bytes inside a page are laid out for the FlyDSL kernels, so pages are not interchangeable with NVIDIA's.
Classes:
-
MiniMaxM3SparseRocmNvfp4Backend–MiniMax M3 sparse attend over NVFP4 K/V pages (ROCm, gfx950).
-
MiniMaxM3SparseRocmNvfp4Impl–FlyDSL NVFP4 sparse decode (bf16 compute) and prefill (fp16 compute).
-
MiniMaxM3SparseRocmNvfp4MetadataBuilder–Adds each prefill token's request and absolute position.
Functions:
-
rocm_nvfp4_unsupported_reason–Why the ROCm NVFP4 attend cannot serve this layer, None when it can.
MiniMaxM3SparseRocmNvfp4Backend
¶
Bases: MiniMaxM3SparseBackend
MiniMax M3 sparse attend over NVFP4 K/V pages (ROCm, gfx950).
Methods:
-
customize_spec–Store each head's K and V as two slots of packed data + block scales.
Source code in vllm/models/minimax_m3/amd/sparse_attention_nvfp4.py
customize_spec(spec)
classmethod
¶
Store each head's K and V as two slots of packed data + block scales.
Source code in vllm/models/minimax_m3/amd/sparse_attention_nvfp4.py
MiniMaxM3SparseRocmNvfp4Impl
¶
Bases: MiniMaxM3SparseImpl
FlyDSL NVFP4 sparse decode (bf16 compute) and prefill (fp16 compute).
Methods:
-
forward_decode_mxfp8–forwardof a decode-only batch with the output emitted as MXFP8
Source code in vllm/models/minimax_m3/amd/sparse_attention_nvfp4.py
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 | |
forward_decode_mxfp8(layer, query, kv_cache, out_q, out_scale)
¶
forward of a decode-only batch with the output emitted as MXFP8
(E4M3 values out_q [tokens, H * D], row-major E8M0 scales
out_scale [tokens, H * D / 32]) for the o_proj that follows, instead
of bf16. Equal to mxfp8_e4m3_quantize of the bf16 output.
Source code in vllm/models/minimax_m3/amd/sparse_attention_nvfp4.py
MiniMaxM3SparseRocmNvfp4MetadataBuilder
¶
Bases: MiniMaxM3SparseMetadataBuilder
Adds each prefill token's request and absolute position.
Source code in vllm/models/minimax_m3/amd/sparse_attention_nvfp4.py
rocm_nvfp4_unsupported_reason(num_heads, num_kv_heads, head_dim, topk_blocks, block_size)
¶
Why the ROCm NVFP4 attend cannot serve this layer, None when it can.