-
Notifications
You must be signed in to change notification settings - Fork 35
[MXFP4] Add scale generation utils #503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nice bit shift wizardry 🧙 , tests look well-covered though
A few nits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 🔥 🔥
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple very small nits, but LGTM!
Summary:
Reference: https://github.com/vllm-project/vllm/blob/main/tests/quantization/reference_mxfp4.py
Added functions:
round_to_power_2generate_mxfp4_scaleswhich will be called bycalculate_qparams.generate_mxfp4_scaleswill also convert the scales to exponents and store as uint8convert_mxfp4_exp_scaleto convert the exponent scales back to dense such that they can be applied to the weight / activations during QDQTesting