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
quantize_dynamic_block_scaled_mxfp4_kernel
def quantize_dynamic_block_scaled_mxfp4_kernel[in_dtype: DType, *, elements_per_thread: Int](output_ptr: Pointer[UInt8, MutAnyOrigin, _safe=False], output_scales_ptr: Pointer[Float8_e8m0fnu, MutAnyOrigin, _safe=False], input_ptr: Pointer[Scalar[in_dtype], ImmutAnyOrigin, _safe=False], num_elements: Int)
GPU kernel that quantizes BF16 elements to packed MXFP4 with E8M0 block scales on AMD CDNA4.
Each thread processes elements_per_thread elements, cooperatively
reduces the per-group maximum via warp shuffle, and uses the
V_CVT_SCALEF32_PK_FP4_BF16 intrinsic for hardware FP4 packing.
Parameters:
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!