For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).
Mojo function
matmul_dynamic_block_scaled_mxfp4_kernel
def matmul_dynamic_block_scaled_mxfp4_kernel[out_dtype: DType, BLOCK_N: Int](c_ptr: Pointer[Scalar[out_dtype], MutAnyOrigin, _safe=False], a_ptr: Pointer[UInt8, ImmutAnyOrigin, _safe=False], b_ptr: Pointer[UInt8, ImmutAnyOrigin, _safe=False], a_scales_ptr: Pointer[Float8_e8m0fnu, ImmutAnyOrigin, _safe=False], b_scales_ptr: Pointer[Float8_e8m0fnu, ImmutAnyOrigin, _safe=False], M: Int, N: Int, K: Int)
GPU kernel that computes an MXFP4 block-scaled matmul on AMD CDNA4 using FP4 dot-product intrinsics.
Each thread computes BLOCK_N output elements for one row by
iterating over K in MXFP4_SF_VECTOR_SIZE groups, dequantizing FP4
pairs to BF16 and accumulating via the llvm.amdgcn.fdot2 intrinsic.
Parameters:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!