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_fp4fp8_kernel
def quantize_dynamic_scaled_fp4fp8_kernel[out_dtype: DType, scales_dtype: DType, in_dtype: DType, output_layout: TensorLayout, scales_layout: TensorLayout, input_layout: TensorLayout, *, SF_VECTOR_SIZE: Int = Int(16), ELEMENTS_PER_THREAD: Int = Int(8), num_max_threads: Int = Int(512), gated: Bool = False, activation: def(Float32, Float32) thin -> Float32 = comptime #kgen.func.symbol<@linalg::@swiglu_activation::@"swiglu[::SIMD[DType.float32, 1]](::SIMD[DType.float32, 1],::SIMD[DType.float32, 1])"<:!lit.struct<@std::@simd::@SIMD<:!lit.struct<@std::@builtin::@dtype::@DType> {:dtype f32}, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> {1}>> apply(:!lit.generator<("value": !lit.struct<@std::@builtin::@float_literal::@FloatLiteral<:!pop.float_literal #pop.float_literal<0|1>>>, |) -> !lit.struct<@std::@simd::@SIMD<:!lit.struct<@std::@builtin::@dtype::@DType> {:dtype f32}, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> {1}>>> @std::@simd::@SIMD::@"__init__[!pop.float_literal](::FloatLiteral[$2])"<:!lit.struct<@std::@builtin::@dtype::@DType> {:dtype f32}, :!lit.struct<@std::@builtin::@simd_length::@SIMDLength> {1}, :!pop.float_literal #pop.float_literal<0|1>>, {})>>, rope_dim: Int = Int(0), rope_head_dim: Int = Int(0), rope_inverse: Bool = False, rope_layout: TensorLayout = Layout[TypeList[Int64, Int64](), TypeList[Int64, ComptimeInt[Int(1)]]()]](output: TileTensor[out_dtype, output_layout, MutAnyOrigin], scales: TileTensor[scales_dtype, scales_layout, MutAnyOrigin], input: TileTensor[in_dtype, input_layout, ImmutAnyOrigin], num_cols: Int32, num_cols_padded: Int32, tensor_sf: Float32, rope_freqs: OptionalReg[TileTensor[.float32, rope_layout, ImmUnsafeAnyOrigin]] = None)