7 ms·
In case anyone is wondering, yes, there is a cost when a model is quantized. https://oobabooga.github.io/blog/posts/perplexities/ https://oobabooga.github.io/b
by _kava 3y ago
In case anyone is wondering, yes, there is a cost when a model is quantized.
https://oobabooga.github.io/blog/posts/perplexities/ https://oobabooga.github.io/blog/posts/perplexities/
Essentially, you lose some accuracy and there might be some weird answers and probably more likely to go off the rail and hallucinate. But the quality loss is lower the more parameters you have. So for very large model sizes the differences might be negligible. Also, this is the cost of inference only. Training is a whole other beast and requires much more power.
Still, we are looking at GPT3 level of performance on one server rack. That says something when less than a year ago, such AI was literally magic and only run on a massive datacenter. Bandwidth and memory size are probably, in my ignorance mind, easier to increase than raw compute so maybe we will soon actually have "smart" devices.
- ripvanwinkle 3y agoThank you! Is there a sweet spot with quantization. how much can you quantize for given model type and size and still be useful.
- pseudonom- 3y agoTim Dettmers recently (https://www.manifold1.com/episodes/ai-on-your-phone-tim-dettmers-on-quantization-of-neural-networks-41/transcript https://www.manifold1.com/episodes/ai-on-your-phone-tim-dett...): "But what we found with these neural networks is, if you use 32 bits, they're just fine. And then you use 16 bits, and they're just fine. And then with eight bits, you need to use a couple of tricks and then it's just fine. And now we find if you can go to four bits, and for some networks, that's much easier. For some networks, it's much more difficult, but then you need a couple more tricks. And so it seems they're much more robust."
- KirillPanov 3y ago> And now we find if you can go to four bits That will be really interesting for FPGAs, because the current ones are basically oceans of 4-bit computers. Yes, you can gang together a pair of 4LUTs to make a 5LUT, and a pair of 5LUTs to make a 6LUT, but you halve your parallelism each time you do that. OTOH you can't turn a 4LUT into a pair of 3LUTs on any currently-manufactured FPGA. It's simply the "quantum unit" of currently-available hardware -- and it's been that way for at least 15 years (Altera had 3LUTs back in the 2000s). There's no fundamental reason for the number 4 -- but it is a very, very deep local minimum for the current (non-AI) customers of FPGA vendors.
- tysam_and 3y agoYes, there is a logarithmically-bound (or exponential if you're viewing it from another angle) falloff in the information lost in quantization. This comes from the non-uniform "value" of different weights. We can try to get around them with different methods, but at the end of the day, some parameters just hurt more to squeeze. What is insane though is how far we've taken it. I remember when INT8 from NVIDIA seemed like a nigh-pipedream!
- simonw 3y agoI was hoping that link would answer the question that's been bugging me for months: what are the penalties that you pay for using a quantized model? Sadly it didn't. It talked about "perplexities" and showed some floating point numbers. I want to see examples like "here's a prompt against a model and the same prompt against a quantized version of that model, see how they differ."
- version_five 3y agoI want to see examples like "here's a prompt against a model and the same prompt against a quantized version of that model, see how they differ." We suck at evaluating and comparing models imo. There are metrics and evaluation task, but it's still very subjective. The closer we get to assessing human like performance, the tougher it is, because it becomes more subjective and less deterministic by the nature of the task. I don't know the answer, but I know that for the metrics we have it's not so easy to translate them into any idea about the kind of performance on some specific thing you might want to do with the model.
- cj 3y ago> some specific thing you might want to do with the model. I think this right here is the answer to measuring and comparing model performance. Instead of trying to compare models holistically, we should be comparing them for specific problem sets and use cases... the same as we compare humans against one another. Using people as an example, a hiring manager doesn't compare 2 people holistically, they compare 2 people based on how well they're expected to perform a certain task or set of tasks. We should be measuring and comparing models discriminately rather than holistically.
- mr_toad 3y agoYou could have two models answer 100 questions the same way, and differ on the 101st. They’re unpredictable by nature - if we could accurately predict them we’d just use the predictions instead.
- redox99 3y ago>Still, we are looking at GPT3 level of performance on one server rack. That says something when less than a year ago, such AI was literally magic and only run on a massive datacenter. I'm not sure what you mean by this. You've always been able to run GPT3 on a single server (your typical 8xA100).
- blovescoffee 3y agoAm I missing something or how do you know this? Also I think the OP was talking about a single card not multiple but that was just my reading.
- redox99 3y agoBecause 175B parameters (350GB for the weights FP16, let's say a bit over 400GB for actual inference), fit very comfortably on 8xA100 (640GB VRAM total). And basically all servers will have 8xA100 (maybe 4xA100). Nobody bothers with a single A100 (of course in a VM you might have access to only one)
- axiom92 3y ago> And basically all servers will have 8xA100 for those wondering: no this is not the norm. My lab at CMU doesn't own any A100s (we have A6000s).
- doctorpangloss 3y agoThe servers the commenter is talking about are DGX machines from NVIDIA. It doesn’t really make sense to BTO. What you gain economically you lose in the science you can do. But nobody could have anticipated this.
- _zoltan_ 3y agoyou could also get HGX from any of the vendors.
- smcleod 3y agoGood blog post, shame the site has no RSS feed!
- prvc 3y agoAny use case for using the 7B model over the 13B, quantized?
- clarionbell 3y agoSBC
- bobboies 3y agoWtf does SBC mean? God enough with the acronyms people.
- cameron_b 3y agoIn my experience, it usually means Small Block Chevy, but in certain communities it means Single Board Computer, an older way of referring to devices like the Raspberry Pi. I would elaborate and say, anywhere that your computer is resource constrained ( ram, processing power ) but you still want to make up articles for your Amazon Affiliate blog
- bobboies 3y agoSingle board computer makes sense. I wish folks would type things out.
- loudmax 3y agoIn this context I'd assume SBC means Single Board Computer, such as a Raspberry Pi or one of the many imitators. The article itself mentions running LLaMa on a Pi 4. The interesting implication about running an LLM on a single board computer is that if it's a proof of concept for an LLM on a smartphone. If you have a model that can produce useful results on a Ras Pi, you have something that could potentially run on hundreds of millions of smartphones. I'm not sure what the use case is for running an LLM on your phone instead of the cloud, but it opens some interesting possibilities. It depends just how useful such a small LLM could be.
- Joeri 3y ago
- YetAnotherNick 3y agoThe effect is lesser than you think. 5 bit quantization has negligible performance loss compared to 16 bits: https://github.com/ggerganov/llama.cpp/pull/1684 https://github.com/ggerganov/llama.cpp/pull/1684
- astrange 3y agoThis paper from last month has a method for acceptable 3-bit quantization and a start at 2-bit. https://arxiv.org/abs/2307.13304 https://arxiv.org/abs/2307.13304
- WithinReason 3y agoThis is not generally true, sometimes quantisation can improve accuracy. I haven't seen that with LLMs yet though.
- arijun 3y agoInteresting, how would that work? Are there any well-known examples? Is it: the weights all happen to be where float is sparse, so quantization ends up increasing fidelity? Or is it more of a “worse is better” dropout-type situation?
- WithinReason 3y agoI suspect it works as regularisation of the network. It usually happens when you train with quantisation instead of post-training quantisation, an I haven't seen that done with LLMs yet.
- matsemann 3y agoFor image recognition it can sometimes be like that. My gut feeling is that lowering from fp32 to fp16 can get rid of some kind of overfitting or so.
- riezebos 3y agoCould this be why people recently say they see more weird results in ChatGPT? Maybe OpenAI is trying out different quantization methods for the GPT4 model(s) to reduce resource usage of ChatGPT.
- pocketarc 3y agoI'd be more inclined to believe that they're dropping down to gpt-3.5-turbo based on some heuristic, and that's why sometimes it gives you "dumber" responses. If you can serve 5/10 requests with 3.5 by swapping only the "easy" messages out, you've just cut your costs by nearly half (3.5 is like 5% of the cost of 4).
- vbezhenar 3y agoServing me ChatGPT 3.5 when I explicitly requesting ChatGPT 4 sounds like a very bad move? They're not marketing it like "ChatGPT Basic" and "ChatGPT Pro".