IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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

def quantize_dynamic_block_scaled_mxfp4[in_dtype: DType](output: TileTensor[DType.uint8, Storage=output.Storage, address_space=output.address_space, linear_idx_type=output.linear_idx_type], output_scales: TileTensor[DType.float8_e8m0fnu, Storage=output_scales.Storage, address_space=output_scales.address_space, linear_idx_type=output_scales.linear_idx_type], input: TileTensor[in_dtype, Storage=input.Storage, address_space=input.address_space, linear_idx_type=input.linear_idx_type], ctx: DeviceContext)

Launches the AMD CDNA4 MXFP4 quantization kernel over a flat input buffer.

Enqueues quantize_dynamic_block_scaled_mxfp4_kernel with a 512-thread block grid, emitting a trace event for profiling.

Parameters:

  • in_dtype (DType): Element type of the input activation tensor (inferred). Must be bfloat16.