Repository navigation
Quantize on load from the checkpoint tensor, not its cast to the quantized dtype - #50301
qgallouedec wants to merge 5 commits into
Conversation
…tized dtype A param quantized on load holds its quantized dtype (uint8 for MXFP4, float8 for FP8), and the loader cast the checkpoint tensor to it before quantizing: MXFP4 got integer garbage, FP8 lost precision. Also quantize the MXFP4 experts along their input features and load them like a pre-quantized checkpoint.
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
…on load The config saved `modules_to_not_convert: null`, which the Hub flags as invalid.
|
Very similar to #49773, only the quantizer changes are new - the linked PR will be merged first @qgallouedec if you can adapt this one please! 🙏 |
|
There is a series of fixes from Arthur so not sure how much the quantizers in general change maybe wait a bit first? |
# Conflicts: # src/transformers/core_model_loading.py
|
Done: with main merged the loader change is #49773's, so this PR keeps only the MXFP4 quantizer changes. They are still needed: on main, a bfloat16 gpt-oss quantized on load saves |
|
Talking about #50245 so I'd rather wait for that to land first. If things are still broken, we can revisit this PR if you dont mind |
|
[For maintainers] Suggested jobs to run (before merge) run-slow: mxfp4 |
What does this PR do?
Fixes #50300
Mxfp4Quantizequantized the gpt-oss experts along the output features, so a model quantized on load saved blocks and scales unlike a pre-quantized checkpoint's. It now quantizes along the input features and swizzles like a pre-quantized checkpoint. Its config now savesmodules_to_not_convertas a list, notnull, which the Hub flags as invalid. The loader half of this PR landed in #49773.gate_up_proj_blocksas (4, 128, 8, 16) instead of (4, 256, 4, 16). With this PR, gpt-oss-20b quantized on load saves the same blocks and scales asquantize_to_mxfp4, and its logits match the pre-quantized checkpoint's.Who can review?
@SunMarc @MekkCyber