IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /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. /get-started.md).

Mojo function

dequant_mx

def dequant_mx(ctx: DeviceContext, output: TileTensor[Engine=output.Engine, address_space=output.address_space, linear_idx_type=output.linear_idx_type], input: TileTensor[Engine=input.Engine, address_space=input.address_space, linear_idx_type=input.linear_idx_type], scales: TileTensor[Engine=scales.Engine, address_space=scales.address_space, linear_idx_type=scales.linear_idx_type], num_rows: Int, num_cols: Int)

Dequantize MXFP4 or MXFP8 weights to bfloat16 or float32.

The format follows the dtype of input: uint8 is packed MXFP4, float8_e4m3fn is MXFP8.

Args:

Raises:

If num_cols is not a multiple of 32, or if the shapes of output, input and scales do not agree with num_rows and num_cols. The kernels read scales on trust, so a short scale tensor would otherwise be an out-of-bounds read.

Was this page helpful?