Transformers can't load the MXFP4/MXFP8 checkpoints yet. Point Transformers users to Ergo-bf16?

#17
by KingKanye - opened

The repo is tagged library_name: transformers. The Hub's "Use this model → Transformers" snippet is AutoModelForCausalLM.from_pretrained("Amazon-FMR/Ergo"), and the Transformers Ergo docs use the same example. On current Transformers main, that snippet doesn't load this repo, and it doesn't load Ergo-mxfp8 either. Only Ergo-bf16 works.

You can check this from the safetensors headers alone:

repo layers.1.feed_forward.up_proj up_proj_scale
Ergo-bf16 BF16 [256, 8192, 4096] (the layout ErgoExperts expects) n/a
Ergo-mxfp8 F8_E4M3 [256, 4096, 8192] U8 [256, 4096, 256]
Ergo (MXFP4) U8 [256, 4096, 4096] U8 [256, 4096, 256]
  • MXFP4: Transformers' mxfp4 quantizer only handles GPT-OSS (*_blocks/*_scales). The packed experts are loaded raw and fail with a size mismatch.
  • MXFP8: On GPU, the FP8 quantizer's expert swap crashes with AttributeError: ErgoConfig has none of: ('hidden_activation', 'hidden_act'). On CPU, it raises a size mismatch, and the quantizer's .scale rename also drops the residual-gate and expert-norm tensors.

Details and an offline reproducer: https://github.com/huggingface/transformers/issues/51633.

Until Transformers supports these layouts, it may help to add a short note to the README "Your own hardware" section: "For Hugging Face Transformers, use Amazon-FMR/Ergo-bf16; the MXFP4/MXFP8 checkpoints are for SGLang/vLLM." Could you also confirm the MXFP4 packing (which nibble comes first) and the scale semantics (E8M0, 32-element blocks along the input dimension)? A Transformers fix needs both.

FMR at Amazon org

thanks for the feedback! yes for now quantized fine tuning isn't supported. I've updated the model card to make that clear

Sign up or log in to comment