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_fp4

def block_scales_interleave_fp4[scales_dtype: DType, //, *, SF_VECTOR_SIZE: Int = Int(16), num_max_threads: Int = Int(1024)](ctx: DeviceContext, input_scales_tile: TileTensor[scales_dtype, Storage=input_scales_tile.Storage, linear_idx_type=input_scales_tile.linear_idx_type], output_scales_tile: TileTensor[scales_dtype, Storage=output_scales_tile.Storage, linear_idx_type=output_scales_tile.linear_idx_type])

Launches the SM100 kernel that reinterleaves rank-2 scale factors into the 5D TCGEN layout.

Converts the flat scale-factor tensor into the interleaved 5D layout expected by the tensor-core scale-factor feed.

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 (defaults to 16).
  • โ€‹num_max_threads (Int): Maximum number of threads per block for the launch grid (defaults to 1024).