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
mxfp8_quantize
def mxfp8_quantize[width: SIMDLength, //, lanes: Int](values: SIMD[.float32, width]) -> Tuple[SIMD[.float8_e4m3fn, width], Float8_e8m0fnu]
Quantizes a group spread over adjacent lanes to E4M3 with a UE8M0 scale.
The scale is the smallest power of two that fits the group's largest magnitude, floored at 1e-4, under 448.
Parameters:
- โwidth (
SIMDLength): The values each lane holds. - โlanes (
Int): The adjacent lanes that share one scale.
Args:
- โvalues (
SIMD[.float32, width]): This lane's part of the group.
Returns:
Tuple[SIMD[.float8_e4m3fn, width], Float8_e8m0fnu]: The quantized values and the group's scale.