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

block_scales_interleave

def block_scales_interleave[scales_dtype: DType, //, *, SF_VECTOR_SIZE: Int, target: StringSlice[ImmStaticOrigin] = StringSlice("cpu")](output_scales_device: TileTensor[scales_dtype, Storage=output_scales_device.Storage, linear_idx_type=output_scales_device.linear_idx_type], input_scales_device: TileTensor[scales_dtype, Storage=input_scales_device.Storage, linear_idx_type=input_scales_device.linear_idx_type], ctx: DeviceContext)

Reinterleaves rank-2 scale factors into the 5D TCGEN layout on SM100 hardware.

Delegates to block_scales_interleave_fp4 after validating that the output scales are rank-5 and the input scales are rank-2.

Parameters:

  • โ€‹scales_dtype (DType): Element type of the block scale-factor tensors (inferred).
  • โ€‹SF_VECTOR_SIZE (Int): Number of elements covered by each block scale factor: 16 for NVFP4 or 32 for MXFP4.
  • โ€‹target (StringSlice[ImmStaticOrigin]): Trace target string identifying the device in profiling output (defaults to "cpu").

Was this page helpful?