mcg
exllamav3's default codebook: 3INST without the addend. One multiply, one LOP3, one fp16 add.
How it decodes
| step | operation |
|---|---|
| 1 | x = (state · 0xCBAC1FED) mod 2³² |
| 2 | x = (x & 0x8FFF8FFF) ^ 0x3B603B60 |
| 3 | v = fp16(x & 0xFFFF) + fp16(x >> 16) |
Dropping the addend saves an instruction. A multiply alone maps state 0 to 0, so one state always decodes to the XOR constant's value; the rest still look Gaussian.
E4M3 rounding
Set ROUND_E4M3 = true. Over all 65,536 states, mcg then decodes to exactly the 145 E4M3 values in
[−4, 4]: the codebook already covers the FP8 grid, so there is nothing left to gain from designing a hash around
FP8. EXLR8 rounds inside the Viterbi search, so the encoder only picks paths whose weights are exact in FP8.
Things to try
- Try other multipliers and watch the distinct-value count and the successor spread. An even multiplier throws away the state's top bit.
- Compare the distinct-value count with and without the rounding.