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

mxfp4_native_route_enabled

def mxfp4_native_route_enabled(min_block_scale_exp: Int, max_block_scale_exp: Int, M: Int, static_N: Int, static_K: Int) -> Bool

Whether mxfp4_dequant_matmul_amd takes the native block-scaled route.

Answers the routing question for one call, so a test can assert it instead of inferring it from values that both routes produce identically. It is False unless every conjunct holds:

  • the part has mfma.scale.f8f6f4 (gfx950), and the tiles cover K in whole 128-element blocks in K and whole 128-column blocks in N;
  • M is in the measured decode range;
  • the caller passed the weights' block-scale exponent range (an unknown range is _SCALE_EXP_UNKNOWN) and it keeps every weight * scale inside E4M3, so the two routes give the same numbers.

Args:

  • ​min_block_scale_exp (Int): Smallest E8M0 byte among the weight's block scales, or _SCALE_EXP_UNKNOWN.
  • ​max_block_scale_exp (Int): Largest E8M0 byte among the weight's block scales, or _SCALE_EXP_UNKNOWN.
  • ​M (Int): Output rows of this call.
  • ​static_N (Int): Output columns.
  • ​static_K (Int): Reduction extent in logical elements.

Returns:

Bool: True if this call runs the native route.

Was this page helpful?