transformers
e32afc72 - Round the ue8m0 FP8 scale before quantizing so dequant matches the stored inverse (#46763)

Commit
85 days ago
Round the ue8m0 FP8 scale before quantizing so dequant matches the stored inverse (#46763) For scale_fmt="ue8m0", Fp8Quantize._quantize_one quantized the weight with the unrounded block scale but stored a weight_scale_inv rounded up to a power of two. Fp8Dequantize multiplies by that stored inverse, so the round-trip was off by up to a full octave per block. Round the inverse scale first, re-derive the forward scale from it, then quantize, matching DeepGEMM's order. The scale_fmt="float" path is unchanged.
Author
Parents
Loading