vllm.model_executor.kernels.linear.mxfp8.rocm_native
¶
Native MXFP8 linear GEMM for AMD CDNA4 (gfx950) via Triton tl.dot_scaled.
Consumes the FP8 E4M3 weights + E8M0 block scales directly (no dequant-to-BF16);
activations are MXFP8-quantized per token, or arrive pre-quantized as a
QuantizedActivation with row-major (not swizzled) E8M0 scales. Uses the
CDNA4 hardware microscaling matrix cores. dot_scaled tiles K by 128; a
weight whose K is not a multiple of that is dequantized to BF16 once at load
and served by a plain linear instead, since can_implement does not filter
on K.
Classes:
-
RocmDotScaledMxfp8LinearKernel–Native CDNA4 (gfx950) MXFP8 linear via Triton
tl.dot_scaled.
RocmDotScaledMxfp8LinearKernel
¶
Bases: Mxfp8LinearKernel
Native CDNA4 (gfx950) MXFP8 linear via Triton tl.dot_scaled.
Methods:
-
supports_quantized_input–Whether
apply_weightsreads aQuantizedActivationfor
Source code in vllm/model_executor/kernels/linear/mxfp8/rocm_native.py
243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 | |
supports_quantized_input(layer)
staticmethod
¶
Whether apply_weights reads a QuantizedActivation for
layer as is (fp8 weights), rather than dequantizing it back.
Source code in vllm/model_executor/kernels/linear/mxfp8/rocm_native.py
_as_block32_scale(weight_scale)
¶
The [N / 32, K / 32] block scales, if every 32 rows share their scales.
Source code in vllm/model_executor/kernels/linear/mxfp8/rocm_native.py
_select_cfg(M, N, K)
¶
(BLOCK_M, BLOCK_N, BLOCK_K, num_warps, num_stages) — graph-tuned on gfx950.
The M-bucketed, shape-adaptive tile selection here is the speedup over the upstream 2-bucket launcher. Tiles are pipelined (num_stages>=2, larger BLOCK_K) and occupancy- and shape-aware: keyed on the LOCAL (M, N, K), so it adapts to the TP-sharded shapes (e.g. MiniMax-M3 TP=4 vs TP=8, where local N and K differ) — large-K prefill uses BLOCK_K=256; short-K (K=768) widens N. BLOCK_K must divide K (the K-loop is unmasked), so every BLOCK_K below is guarded to be K-divisible (served K: 384/768/1024/2048/6144).