MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::mx::mxfp4 Struct Reference

MXFP4: a scale byte, then 16 bytes of packed E2M1 elements in GGML's block_mxfp4 order (element j low nibble, element j + 16 high nibble of byte 1 + j). More...

#include <mx_schemes.hpp>

Static Public Member Functions

static float decode_element (const std::byte *src, std::size_t j) noexcept
 Element j < block_size of the block at src (asserted, #826).
static void decode (const std::byte *src, float *dst) noexcept

Static Public Attributes

static constexpr std::size_t block_size = 32
static constexpr std::size_t block_bytes = 1 + 16

Detailed Description

MXFP4: a scale byte, then 16 bytes of packed E2M1 elements in GGML's block_mxfp4 order (element j low nibble, element j + 16 high nibble of byte 1 + j).

17 bytes.

Member Function Documentation

◆ decode()

void mtl::mx::mxfp4::decode ( const std::byte * src,
float * dst )
inlinestaticnoexcept

◆ decode_element()

float mtl::mx::mxfp4::decode_element ( const std::byte * src,
std::size_t j )
inlinestaticnoexcept

Element j < block_size of the block at src (asserted, #826).

Member Data Documentation

◆ block_bytes

std::size_t mtl::mx::mxfp4::block_bytes = 1 + 16
staticconstexpr

◆ block_size

std::size_t mtl::mx::mxfp4::block_size = 32
staticconstexpr

The documentation for this struct was generated from the following file: