Bnb quantization (#1626)
* Add get_quantized_model func
* Add tests for 4bit and 8bit quantization
* Add tests
* Fix style
* Add offload tests
* Fix style
* Fix
* Fix conflit
* fix generate quality test
* fix style
* add check for bnb layers and fix .to(cpu)
* Fix 8bit serialization and memory issue
* add import
* Change quantize_model to load_and_quantize_model
* Add tests for saving 8bit model
* Fix bnb dataclass
* fix style
* fix tests
* fix style
* remove depedency on tie_weights
* remove depedency on base_model_prefix
* remove depedency on device
* fix style
* Add doc about quantization
* fix import
* Fix text
* fix func name
* fix arg in dataclass
* Update docs/source/usage_guides/quantization.md
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
* fix funct name
* Add real model
* Fix doc
* put bash tag
* Update src/accelerate/utils/bnb.py
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
---------
Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>