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
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, Engine=input_scales_tile.Engine, linear_idx_type=input_scales_tile.linear_idx_type], output_scales_tile: TileTensor[scales_dtype, Engine=output_scales_tile.Engine, 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).
Args:
- ctx (
DeviceContext): Device context used to enqueue the kernel. - input_scales_tile (
TileTensor[scales_dtype, Engine=input_scales_tile.Engine, linear_idx_type=input_scales_tile.linear_idx_type]): Input rank-2 scale-factor tile in the flat row-major layout. - output_scales_tile (
TileTensor[scales_dtype, Engine=output_scales_tile.Engine, linear_idx_type=output_scales_tile.linear_idx_type]): Output rank-5 scale-factor tile in the 5D TCGEN interleaved layout.