- 
          
- 
                Notifications
    You must be signed in to change notification settings 
- Fork 790
          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
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 | 
ab478e8    to
    50fe09d      
    Compare
  
    
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.Parameterand 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.Parameterwith 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..