-
Notifications
You must be signed in to change notification settings - Fork 1.4k
QQ linear #2931
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
base: main
Are you sure you want to change the base?
QQ linear #2931
Conversation
This reverts commit 867e0fc.
| return ql | ||
|
|
||
|
|
||
| class QQLinear(Module): |
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.
Does it make sense to hijack Module::train() and Module::eval() to update the weights between quantize and not-quantize?
I think at the very least it would be nice to have a method which turns it into the inference version since I expect it would be a common use case.
CC @angeloskath might have some ideas.
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.
I added QQLinear.train() and QQLinear.eval(). Let me know if you had something different in mind.
For inference, I think we should support two cases: (1) weights are loaded already quantized (with loading handled in mlx-lm, or a similar for cuda), or (2) weights are bf16/fp32, in which case we call .eval() to quantize them.
QQLinearlayer