-
-
Notifications
You must be signed in to change notification settings - Fork 776
4bit quantization for arbitrary nn.Parameter
#1720
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?
Conversation
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. |
Will there need to be any changes in PEFT to apply lora adapters to quantized parameters once this lands? |
We'll have to test, but at the very least, huggingface/peft#2710 needs to be merged in PEFT for this to work properly. |
it's merged |
This PR is in the same spirit as the recently introduced feature in huggingface/peft#2638.
Several models exist in the Hugging Face ecosystem where there are MoE layers that use
nn.Parameter
and are not compatible with the default quantization approach of replacingnn.Linear
. Such example models include, but are not limited to:A new utility,
bitsandbytes.nn.parametrize.replace_parameter_4bit()
is introduced. This will quantize and replace annn.Parameter
with a parametrization layer which automatically dequantizes the parameter when it is accessedAdditional work will be done on the HF Transformers side to enable integration with options in
BitsAndBytesConfig
..