PTWM
transforms

ptwm_core::transforms::bit_reorder_fp8

BitReorderFp8E4M3 and BitReorderFp8E5M2 ops — per-byte bit shuffle for FP8 formats that moves the exponent into the high nibble for better entropy coding.

ptwm_core::transforms::bit_reorder_fp8

BitReorderFp8E4M3 and BitReorderFp8E5M2 ops — per-byte bit shuffle for FP8 formats that moves the exponent into the high nibble for better entropy coding.

rsmod

ptwm_core::transforms::bit_reorder_fp8

crates/ptwm-core/src/transforms/bit_reorder_fp8.rs:1
mod bit_reorder_fp8

`BitReorderFp8E4M3` and `BitReorderFp8E5M2` ops — per-byte bit shuffle for FP8 formats that moves the exponent into the high nibble for better entropy coding.

Both ops operate on `ElementWidth::Byte` planes (one byte per FP8 element). The algorithms are lifted from `crates/ptwm-core/src/split/dtype8`.
rstype

ptwm_core::transforms::bit_reorder_fp8::BitReorderFp8E4M3

crates/ptwm-core/src/transforms/bit_reorder_fp8.rs:26
pub struct BitReorderFp8E4M3;

Per-byte bit reorder for FP8-E4M3FN: `[S EEEE MMM]` → `[EEEE SMMM]`.

Moving the exponent to the high nibble makes the exponent plane highly compressible by downstream entropy coders (few dominant exponent values in typical trained weights). Requires `ElementWidth::Byte`; output descriptor matches the input. Algorithm: lifts `dtype8::reorder_byte_e4m3fn` / `dtype8::revert_byte_e4m3fn`.
rstype

ptwm_core::transforms::bit_reorder_fp8::BitReorderFp8E5M2

crates/ptwm-core/src/transforms/bit_reorder_fp8.rs:109
pub struct BitReorderFp8E5M2;

Per-byte bit reorder for FP8-E5M2: `[S EEEEE MM]` → `[EEEEE SMM]`.

Same motivation as [`BitReorderFp8E4M3`] but for the 5-exponent-bit variant. Requires `ElementWidth::Byte`; output descriptor matches the input. Algorithm: lifts `dtype8::reorder_byte_e5m2` / `dtype8::revert_byte_e5m2`.