transformers
ff24c90c - Fix A.X-K2 fp8 modules_to_not_convert normalization for the gated-norm MLP (#47578)

Commit
117 days ago
Fix A.X-K2 fp8 modules_to_not_convert normalization for the gated-norm MLP (#47578) * Fix A.X-K2 fp8 modules_to_not_convert normalization for the gated-norm MLP The `W_down`/`W_up` -> `mlp.fc1`/`mlp.fc2` rename patterns were dot-anchored (`\.W_down\.`), so they renamed weight keys but did not normalize the bare module names that an fp8 checkpoint lists in `modules_to_not_convert`. `FineGrainedFP8HfQuantizer._normalize_modules_to_not_convert` applies these patterns to entries like `"W_down"` (no surrounding dots), so the dot-anchored pattern left them unchanged and the gated-norm gate MLP the fp8 releases keep unquantized would be fp8-quantized by mistake. Make the patterns unanchored so both the weight-key rename and the skip-list normalization yield `mlp.fc1`/`mlp.fc2`. * add test code * rm the test --------- Co-authored-by: vasqu <antonprogamer@gmail.com>
Author
Parents
Loading