Which Quantization Method is Right for You? (GPTQ vs. GGUF vs. AWQ)

  Рет қаралды 15,519

Maarten Grootendorst

7 ай бұрын

In this tutorial, we will explore many different methods for loading in pre-quantized models, such as Zephyr 7B. We will explore the three common methods for quantization, GPTQ, GGUF (formerly GGML), and AWQ.
Timeline
0:00 Introduction
0:25 Loading Zephyr 7B
3:25 Quantization
7:42 Pre-quantized LLMs
8:42 GPTQ
10:29 GGUF
12:22 AWQ
14:46 Outro
📒 Google Colab notebook colab.research.google.com/drive/1rt318Ew-5dDw21YZx2zK2vnxbsuDAchH?usp=sharing
🛠️ Written version of this tutorial maartengrootendorst.substack.com/p/which-quantization-method-is-right
🤗 Zephyr 7B on HuggingFace huggingface.co/HuggingFaceH4/zephyr-7b-beta
Support my work:
👪 Join as a Channel Member:
/ @maartengrootendorst
✉️ Newsletter maartengrootendorst.substack.com/
📖 Join Medium to Read my Blogs medium.com/@maartengrootendorst
I'm writing a book!
📚 Hands-On Large Language Models www.oreilly.com/library/view/hands-on-large-language/9781098150952/
#datascience #machinelearning #ai

Пікірлер: 40
@631kw
@631kw 7 ай бұрын
Amazing content! Most youtube tutorials just go into trying out the outputs of pre-made LLMs but rarely dive into this level of technical details.
@MaartenGrootendorst
@MaartenGrootendorst 7 ай бұрын
Thanks!
@jacehua7334
@jacehua7334 7 ай бұрын
Thanks didn't want to feel too unproductive on a thanksgiving but didn't want to commit to a full video series. Always releasing timely and great stuff!
@BitsNBytesAI
@BitsNBytesAI 2 ай бұрын
Thanks a lot for clarifying the main differences between quantization methods and also for sharing your code.
@user-fz8mn7sz7t
@user-fz8mn7sz7t 6 ай бұрын
I was struggling with quantization last weekend! very timely! thanks
@user-qo7vr3ml4c
@user-qo7vr3ml4c Ай бұрын
Thank you for the differences and the code.
@wezfaas3546
@wezfaas3546 5 ай бұрын
Thanks for including the colab, and I wasn't aware of AWQ before this video. Would you consider making a video on the efficiency on each, especially when using gpu on gguf model?
@sanjayojha1
@sanjayojha1 7 ай бұрын
Useful information and well made video.
@gue2212
@gue2212 5 ай бұрын
Outstanding! (To put things in perspective: I've seen a LOT of praise for wrapping the obvious or marketing-only BS into lengthy videos and I'm not shy to speak my mind there too!)
@JG27Korny
@JG27Korny 5 ай бұрын
Thank you for the informative video. I understood how I made a huge mistake using gguf when having the VRAM to use GPU primarily.
@bibhutibaibhavbora8770
@bibhutibaibhavbora8770 11 күн бұрын
Great video❤
@radmilraychev5687
@radmilraychev5687 7 ай бұрын
Really enjoyed this session! Any chance you can continue this by showing how to fine-tune this versions of the models?
@TheMrguiller1993
@TheMrguiller1993 5 ай бұрын
Thank you so much for the video, i would like to know which method is faster at inference time.
@yueyu8778
@yueyu8778 7 ай бұрын
Great content! I am wondering whether nowadays we should choose LLMs over BERT models on most tasks or use seperately based on specific use cases? That could be an interest topic to discuss!
@venushah8179
@venushah8179 4 ай бұрын
Really enjoyed your video. It was very informative. Just wanted to know can finetuning be done on these pre-quantized models ??
@naseerfaheem
@naseerfaheem 5 ай бұрын
Great video and great comparisons. Can you make a video on how to quantize a model oneself as well?
@inakigorostiaga6305
@inakigorostiaga6305 7 ай бұрын
Thank you for the great explanations :) Does it make sense to do this before trainning? Quantize the model with these tecniques befor doing peft, qlora, p-tunning etc?
@MaartenGrootendorst
@MaartenGrootendorst 7 ай бұрын
It definitely helps with training if the full model does not fit on the GPU. With many of these methods, efficiency is important and quantization is seldom not used.
@temp911Luke
@temp911Luke 5 ай бұрын
Hi, WHich one is faster ? GGUF with CUDA or AWQ ?
@Sl15555
@Sl15555 5 ай бұрын
i would like to load the new codellama models on to 2 a6000's, is there any good guides on how to do that in python? im reaching out after soo many attempts and hours of research, also i woul dlike to run in windows 11 and linux but guides on loading and running models from my own python would be awsome!
@maryamashraf6370
@maryamashraf6370 3 ай бұрын
Thanks for this video - was a great explanation on the difference between the three models. How's the support for AWQ now? Also I would love it if you could make a video on how to deploy these quantized models for production
@silentwindstudio
@silentwindstudio 4 ай бұрын
Thanks for the video! What I don't understand is that people always say that AWQ is faster than GPTQ, but in my 3060 12gb they are usually quite slow, around 3t/s, while in gptq I can get from 5 to 20t/s
@lphiro5602
@lphiro5602 7 күн бұрын
Bfloat 16-bit is error 1+8+7 format.
@efexzium
@efexzium 6 ай бұрын
Great video, how ever its quite frustrating trying to run this code in production the dependencies are never correct.
@shekharmeena529
@shekharmeena529 4 ай бұрын
inference is tooo slow on the T4 gpu on collab, i fed a football commentary transcribe text line to llm the pre quantized one, it took 3 minutes to obtain the result
@FamilyManMoving
@FamilyManMoving 5 ай бұрын
Brilliant video; you have a style that explains things nicely. Thank you. Sub'd. If you are looking for ideas, I think an overview of what "weights, biases and parameters" mean for models would be great.
@rajivraghu9857
@rajivraghu9857 5 ай бұрын
Good one..
@toromanow
@toromanow 5 ай бұрын
RuntimeError: cutlassF: no kernel found to launch! - it what I'm getting when trying to run your example at step 4: outputs = pipe( prompt, max_new_tokens=256, do_sample=True, temperature=0.1, top_p=0.95 )
@denissorn
@denissorn 6 ай бұрын
My understanding was GPTQ is recommended when quantized model can fit entirely in vRAM and that with GGUF one can still offload layers to a GPU. If I wanted to try mixtral dolphin ~40GB version (On a system w/4080 16GB VRAM, 64GB RAM) what would be a better choice GPTQ or GGUF?
@MaartenGrootendorst
@MaartenGrootendorst 6 ай бұрын
Definitely GGUF. Mixtral 4bit doesnt dit within 16GB Vram, so offloading layers would be necessary. I remember you could offload around 20 layers if I'm not mistaken. I do think the quantised variants, including the dolphin fine tune, are worth checking out.
@denissorn
@denissorn 6 ай бұрын
@@MaartenGrootendorst Thanks!
@35wangfeng
@35wangfeng 4 ай бұрын
what about exllamav2?
@Sir_Olf
@Sir_Olf 3 ай бұрын
Always fun to hear Dutch people talk English and American at the same time, haha. Nice informative video .
@ringpolitiet
@ringpolitiet 26 күн бұрын
Next time, keep your negative thoughts to yourself.
@kiiikoooPT
@kiiikoooPT 7 ай бұрын
Well what about the title of the video? I still don't know wich one is right for me wich was the point of watching this video. All you did was explain what each method is, not wich one we should use :s You have good information here in this video but still you missed the entire point of the title in my opinion.
@kiiikoooPT
@kiiikoooPT 7 ай бұрын
well nevermind, I paused the video cause it was about to finish and go over to another on the playlist, and guess you do talk about it in the end, my bad. Thats what I get for not finishing the video before coming with stupid questions.
@CitizUnReal
@CitizUnReal 6 ай бұрын
​@@kiiikoooPT well i came here for similar reasons and although this is indeed very well explained, i still miss something i was hoping for (kinda like you): which quant works best for what mode? as i have read the other day that for example gptq is less suitable for rp than exl2. why? i dont know. thats why i came here. do the modes chat, cai and instruct have their preferred quantizations? if so, why? im leaving without those answers but with further base knowledge, which is more important in the long run. but hey.. there is one answer i was interested in: why do some models assume both the character- and the user role and progress the rp-story themselves instead of letting me guidie it? because now i know thats sort of typical for the awq quant
@kiiikoooPT
@kiiikoooPT 6 ай бұрын
from the litle I understand, the fact that a model prompt is diferent from model to model, has nothing to do with it being awq or gguf or whatever type off file, that is just about loading the model with diferent loaders. what you are talking about is another topic, you need to see videos about something like mistral vs mistral instruct. or diference betwen those. cause what you are saying has to do with how the model learned stuff, or how it was trained. the instruct models like the name says, are models that are based on instructions, so your prompt cannot be as a role play, cause it will give step by step anwsers instead of a simple conversation. What I really wanted to know is what kind of file is better for low end hardware, since my laptop has an nvidea graphic card with cuda cores, but is so hold that there is not even up to date drivers for it, so I can't install the stupid pytorch with cuda, only cpu mode, and I thought the type of file, gguf and so on, had diferent ways of loading the models, so I could manage to load it without the libraries everyone is using cause they have recent hardware. @@CitizUnReal
🌊Насколько Глубокий Океан ? #shorts
00:42
Looks realistic #tiktok
00:22
Анастасия Тарасова
Рет қаралды 11 МЛН
Получилось у Вики?😂 #хабибка
00:14
ХАБИБ
Рет қаралды 7 МЛН
GamePad İle Bisiklet Yönetmek #shorts
0:26
Osman Kabadayı
Рет қаралды 513 М.
Hisense Official Flagship Store Hisense is the champion What is going on?
0:11
Special Effects Funny 44
Рет қаралды 2,6 МЛН
Собери ПК и Получи 10,000₽
1:00
build monsters
Рет қаралды 2,2 МЛН
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН
ИГРОВОВЫЙ НОУТ ASUS ЗА 57 тысяч
25:33
Ремонтяш
Рет қаралды 331 М.