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

quantize_dynamic_scaled_async_fp4_kernel

def quantize_dynamic_scaled_async_fp4_kernel[input_dtype: DType, input_tile_shape: Coord[input_tile_shape.element_types], input_desc_shape: Coord[input_desc_shape.element_types], output_dtype: DType, output_tile_shape: Coord[output_tile_shape.element_types], output_desc_shape: Coord[output_desc_shape.element_types], scales_dtype: DType, scales_tile_shape: Coord[scales_tile_shape.element_types], scales_desc_shape: Coord[scales_desc_shape.element_types], input_swizzle_mode: TensorMapSwizzle, output_swizzle_mode: TensorMapSwizzle, scales_swizzle_mode: TensorMapSwizzle, SF_VECTOR_SIZE: Int, NUM_PIPELINES_STAGES: Int](input_tma_op: TMATensorTile[input_dtype, input_tile_shape, input_desc_shape], output_tma_op: TMATensorTile[output_dtype, output_tile_shape, output_desc_shape], scales_tma_op: TMATensorTile[scales_dtype, scales_tile_shape, scales_desc_shape], tensor_sf: Float32)

GPU kernel that quantizes BF16 tiles to NVFP4 using TMA async copies and warp-specialized PDL.

One warpgroup issues TMA loads while another computes per-group scale factors and packs FP4 elements, then stores results back via TMA async stores.

Parameters:

Was this page helpful?