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
quantize_dynamic_scaled_fp4_async
def quantize_dynamic_scaled_fp4_async[input_dtype: DType, output_dtype: DType, scales_dtype: DType, //, SF_VECTOR_SIZE: Int](ctx: DeviceContext, output_tensor_tile: TileTensor[output_dtype, Storage=output_tensor_tile.Storage, linear_idx_type=output_tensor_tile.linear_idx_type], scales_tensor_tile: TileTensor[scales_dtype, Storage=scales_tensor_tile.Storage, linear_idx_type=scales_tensor_tile.linear_idx_type], input_tensor_tile: TileTensor[input_dtype, Storage=input_tensor_tile.Storage, linear_idx_type=input_tensor_tile.linear_idx_type], tensor_sf: Float32 = 1)
Launches the TMA-based NVFP4 quantization kernel on SM100 hardware.
Sets up TMA tile descriptors for input, output, and scales, then
enqueues the quantize_dynamic_scaled_async_fp4_kernel with
warp-specialized PDL.
Parameters:
- βinput_dtype (
DType): Element type of the input activation tensor. Must bebfloat16(inferred). - βoutput_dtype (
DType): Element type of the quantized output tensor. Must beuint8for NVFP4 (inferred). - βscales_dtype (
DType): Element type of the block scale-factor tensor. Must befloat8_e4m3fnfor NVFP4 (inferred). - βSF_VECTOR_SIZE (
Int): Number of input elements covered by each block scale factor. Must be 16 for NVFP4.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!