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

decode_fp6_to_bf16

def decode_fp6_to_bf16[width: SIMDLength, //, fmt: FP6Format](code: SIMD[DType.uint8, width]) -> SIMD[DType.bfloat16, width]

Decodes FP6 codes to bfloat16.

Every FP6 value carries at most 3 mantissa bits and lives well inside bfloat16's exponent range, so the float32 decode followed by a bfloat16 cast is exact -- the cast never rounds.

Parameters:

  • โ€‹width (SIMDLength): SIMD width (lane count) of the code vector.
  • โ€‹fmt (FP6Format): The FP6 encoding of the input codes.

Args:

Returns:

SIMD[DType.bfloat16, width]: The decoded values as SIMD[DType.bfloat16, width].