Buckets:
| # AQLM | |
| Additive Quantization of Language Models ([AQLM](https://huggingface.co/papers/2401.06118)) mengkuantisasi beberapa bobot secara bersama-sama dan memanfaatkan ketergantungan antar bobot tersebut. AQLM merepresentasikan kelompok 8-16 bobot sebagai jumlah dari beberapa kode vektor. | |
| AQLM juga mendukung fine-tuning dengan [LoRA](https://huggingface.co/docs/peft/package_reference/lora) menggunakan pustaka [PEFT](https://huggingface.co/docs/peft), dan sepenuhnya kompatibel dengan [torch.compile](https://pytorch.org/tutorials/intermediate/torch_compile_tutorial.html) untuk inferensi dan pelatihan yang lebih cepat. | |
| Jalankan perintah di bawah untuk menginstal pustaka AQLM dengan dukungan kernel untuk inferensi dan pelatihan di GPU maupun CPU. | |
| ```bash | |
| pip install aqlm[gpu,cpu] | |
| ``` | |
| Muat model yang dikuantisasi AQLM dengan [from_pretrained()](/docs/transformers/main/id/main_classes/model#transformers.PreTrainedModel.from_pretrained). | |
| ```python | |
| from transformers import AutoTokenizer, AutoModelForCausalLM | |
| quantized_model = AutoModelForCausalLM.from_pretrained( | |
| "ISTA-DASLab/Mixtral-8x7b-AQLM-2Bit-1x16-hf", | |
| dtype="auto", | |
| device_map="auto" | |
| ) | |
| ``` | |
| ## Konfigurasi | |
| Konfigurasi kuantisasi AQLM terutama bervariasi dalam jumlah codebook yang digunakan, serta ukuran codebook dalam bit. Konfigurasi yang paling populer dan kernel inferensi yang didukung ditunjukkan di bawah ini. | |
| | Kernel | Jumlah codebook | Ukuran codebook, bit | Notasi | Akurasi | Percepatan | Inferensi GPU yang cepat | Inferensi CPU yang cepat | | |
| |---|---------------------|---------------------|----------|-------------|-------------|--------------------|--------------------| | |
| | Triton | K | N | KxN | - | Hingga ~0,7x | ✅ | ❌ | | |
| | CUDA | 1 | 16 | 1x16 | Terbaik | Hingga ~1,3x | ✅ | ❌ | | |
| | CUDA | 2 | 8 | 2x8 | OKE | Hingga ~3,0x | ✅ | ❌ | | |
| | Numba | K | 8 | Kx8 | Bagus | Hingga ~4.0x | ❌ | ✅ | | |
| ## Sumber daya | |
| Jalankan [notebook](https://colab.research.google.com/drive/1-xZmBRXT5Fm3Ghn4Mwa2KRypORXb855X?usp=sharing) demo AQLM untuk melihat lebih banyak contoh cara mengkuantisasi model, mendorong model terkuantisasi ke Hub, dan lainnya. | |
| Untuk contoh notebook demo lainnya, kunjungi [repository](https://github.com/Vahe1994/AQLM) AQLM. | |
Xet Storage Details
- Size:
- 2.58 kB
- Xet hash:
- f0593263b04abeb355a8d8e5ecbc5cf5b18e6547dc13b16b3b6d5147b9945551
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.