Compression at the Edge — NVIDIA, Unsloth, HuggingFace, Ollama
AI Engineer · 46 min · 478 sentences · from YouTube's caption track
Each timecode opens YouTube at the start of that sentence. Line anchors (#s42) are the cue ids in the WebVTT, and every line carries its start and end seconds. All transcripts has every talk, and the whole corpus as one file.
- 00:01[music]
- 00:12Okay.
- 00:12Hello everybody.
- 00:13Welcome to uh compression at the edge, the panel that we'll be conducting for the next bit here.
- 00:21Uh very nice to meet you all.
- 00:23I'll be your trusty moderator today.
- 00:25My name is Chris Alex.
- 00:26I'm a product research engineer at Nvidia.
- 00:28I work on Neotron.
- 00:29Let's go.
- 00:30Okay, we are joined by Daniel.
- 00:34Yes, hello everyone.
- 00:34I'm from Enslaf.
- 00:36Um, yeah, thanks for coming everyone.
- 00:38Excellent.
- 00:39And
- 00:39hello.
- 00:40Hi, I'm build NVIDIA model optimizer and we conduct a lot of models.
- 00:44Let's go.
- 00:45I'm Marv.
- 00:46I work as a machine learning engineer at Hugging Face.
- 00:49Awesome.
- 00:50I'm Parth.
- 00:51I work at Volama.
- 00:53So, compression uh a big topic.
- 00:57We're gonna we're going to set some some context hopefully uh in order to to kind of launch into this.
- 01:03So m maybe just in each of your own words if you want to kind of define what you think about compression, let us know like how you engage with uh with technology that ultimately is designed to make models that are bigger be a little bit smaller, right?
- 01:18Like that's the that's the general idea.
- 01:21So uh maybe we'll just go in reverse order.
- 01:23Par if you want to kick us off and what is compression to you?
- 01:26Yeah, I think honestly with Olama and for those of you who are not familiar, one of the easiest ways to run local models um and for us what honestly like rose to popularity was
- 01:39being able to run a larger model on a relatively small machine through quantization, which I'm sure we'll talk a lot about today.
- 01:47Um, and to me, compression is so so important because it actually makes these giant models viable for most people.
- 01:55I think for me it's just um shrinking something without losing information.
- 02:01But there's absolutely zero free lunch.
- 02:02So at the end of the day, you still spend on something whether it's latency or uh quality uh at the short um and I kind of agree.
- 02:12I feel like compression is much more than that definition because it democratizes the models for everyone at edge devices at your computer.
- 02:22I'm sure you are all running some uh Gemma 4, Kuwant at the moment or QN 3.6 those are the hot ones these days and like it's it just works so well.
- 02:33Um so yeah uh this is my definition at least it democratizes things.
- 02:38Cool.
- 02:39So the way I think about is same cost more intelligence.
- 02:43So compression accelerates and enables to give like u like a quick example originally we started with training in FP32 right and now we are talking about FP4 so that is 8x
- 02:55uh more compression and same almost same intelligence without not much degradation yeah same cost more intelligence
- 03:03yeah like how we see quantization is like you know you take like a big model like GLM 5.2 to it's 1.5 tab which is definitely ginormous.
- 03:13Um but then the trick is you can actually quantize it and shrink it to 250GB.
- 03:18Um so you can make it 86% smaller.
- 03:20Um but with tricks of quantization it will not become 86%.
- 03:24So it's not 86% dumber right if you compress it by 86% it doesn't become like you know terrible useless.
- 03:31Um and so what we show with dynamic quantization if you quantize some layers to you know higher precision and you leave most of the layers in like one bit or two bit and some you know very important layers is 16 bit you can still recover 76%
- 03:45of all accuracy.
- 03:46Um so you so the trick for quantization is if you quantize the correct layers you will not make the model you know literally useless.
- 03:53Um and compression I guess is very important for you to run on your local computers.
- 03:57Um you know make democratization of AI.
- 04:00Yeah.
- 04:01So like, okay, we we we've been talking today about like there this inflection point, right?
- 04:06Recent moments that like uh kind of led to this uh this more this resurgence of the importance of local AI and and uh you know open models, right?
- 04:18Own your own intelligence.
- 04:20You guys were like ahead of the curve though, right?
- 04:22Like I mean you guys were thinking about this before it was it was cool to think about it, right?
- 04:27So, I'd love to hear from each of you like when was the moment that you knew that like quantization or compression like is the path forward for it and and we're going to talk a lot today about like consumer
- 04:40right uh hardware that means like your RTX cards your your your Macs things like that right but uh it goes well beyond that what was the moment you kind of first like
- 04:50got the quantization or compression bug you know that made you say like oh this is going to be big man and we'll just go way back down the line.
- 04:58Daniel, take us away.
- 04:59Yeah.
- 05:00Um, so I think like the biggest moment was Deep Seek R1.
- 05:03Definitely when it got released, it was quite dramatic for the world because we finally have some sort of like reasoning model that worked very well.
- 05:11Um, and it was open source.
- 05:12Um, and the biggest problem though it was very big.
- 05:16Um, and you know, running it locally was extremely complex.
- 05:19Um, and so you know we when we started off like you know we decided okay let's do some tricks.
- 05:25let's quantize some layers to higher precision.
- 05:28Um, and it randomly worked.
- 05:30Um, and so like we were quite surprised like you know 1.58 bit quant worked well.
- 05:35Um, and we were yeah we just posted about this and we were quite surprised.
- 05:39Okay, look model seem to be working well.
- 05:41Um, and then obviously over time we had you know Quen 3.6 3.5 GMA 4 you know every single time there's a new even Nvidia's you know open source models Neimatron
- 05:50they just keep getting better and better and better.
- 05:52Um the only problem sometimes is they get bigger and bigger and bigger.
- 05:55So that's the only problem and so you need to focus more on like you know how to make the model smaller and smaller and smaller and so like you know recently with GLM 5.2 who you know was quite
- 06:04you know it's a very good local model and although it's ginormous and so making it work very well in the local device is complicated um but I think like you know I guess it's a long history
- 06:14of these models um but we're expecting more you know whatever the next model is the next jama the next any model um we're very excited for the future
- 06:23yeah it's like a ongoing arms race between how big can we make the models versus how small can we make them and they still work right uh uh maybe some thoughts for for from you like what when did you think like ah man quantization
- 06:37is is it
- 06:39so I originally started working on pruning uh so okay so that was maybe 3 years back that was when CV models were all the rage then sadity happened um yeah so pruning typically you typically lose uh quality so you need to fine-tune it a little bit and then we lls came out and quantization was a easy compression
- 07:00thing you could do you don't uh lose lot of accuracy the model it so what I learned was some kind of compressions are really good you can architect techniques
- 07:10so that u you can chop it down a lot without u losing quality so quantization is really good sparity is really good but not as much as quantization so I did not have like a exact moment of like you know where I got this numeric bug it uh slowly grew on me and uh so for example NVFP4
- 07:31right I was fortunate to work on NVFP4 experiment math when I joined Nvidia and the NVFP4 is very genius uh it we have been doing like a lot of research and experiments to
- 07:44uh make NVFP4 better but it is like a really solid uh numeric format.
- 07:49So yeah, so that was Yeah.
- 07:51So basically like you know uh some compressions are really good and you can cleverly architect uh understanding things better and uh not lose quality like like you know Dan said uh mix precision
- 08:02uh quantization you can compress it 10 chop it at 10 without losing much quality.
- 08:08Yeah.
- 08:08So that was a slowly growth for me.
- 08:11Should I?
- 08:12Yes please.
- 08:13So, um I think for me the biggest wow moment of quantization was back in the day there was something called Q Laura
- 08:21and and the fact that we could actually fine-tune stuff on a toaster essentially that is the collab tier T4 for me that was like a big wow although it's super slow
- 08:35it's it's okay um but on top of it um for instance like we have libraries called TRL and bits and bites and have that enables all of this and like you can even do this with the very advanced techniques like GRPO
- 08:49for instance actually you can train stuff on the um I mean you need to collocate on stuff but like with very small amounts of VRAM and then recently we
- 09:00uh in case you missed it we have acquired Lama CPPA kind of AUI hired llama CPP and then I kind of pivoted to the llama CPP world and I was like wow Because like the second wow moment for me was the fact that I could run open claw and hermes agent on like very long horizon tasks with
- 09:21Q1 3.6 quants which wouldn't be able to which wouldn't be possible before.
- 09:27Um I just know uh I tried many models actually with that and then Q1 3.5 was like wow it can do a lot of coding it can fix its own
- 09:36harness and stuff.
- 09:38So yeah, that was the two big moments for me actually.
- 09:42Yeah.
- 09:43Um I think I'll speak to it more from like a a consumer point of view.
- 09:47Um I this is back in like 2023.
- 09:50Uh I was kind of hacking around my own stuff.
- 09:52This is prior to me being at a Lama.
- 09:54Um but one of the coolest things was I wanted to run kind of my AI on my computer.
- 09:59You know, I was still in school at the time, broke, did not have a lot of money.
- 10:02And so I was like, "Okay, I need to run this for free somehow.
- 10:05So what's like the best option?"
- 10:07Um, and so I came across a Llama at the time and I ran the model kind of locally at on my computer and I think it was Llama 3 at the time as well
- 10:16very long time ago.
- 10:18Um, and honestly for me that's kind of how I got into the whole world of local models.
- 10:22It's like okay this is actually workable.
- 10:25I can like make it do things.
- 10:27It's able to output something and you know back then it wasn't as good as it is you know outputting now.
- 10:32As Murvey said, Quentin 3.6 is insane and Gemma 4 and all there's all these new models which can have so much more capability baked into them.
- 10:40But for me, it was honestly the idea of like being able to even just run something locally.
- 10:46Um, and it started with like Llama 3 with Lama and being able to actually have it run and like complete tasks.
- 10:54Um, and prior to that, you know, I'd done built a lot of models before.
- 10:58Um, and I knew like how much work it goes like is that goes into building them.
- 11:02Um, and running them has always been hard.
- 11:04So to me, quantization like really makes that happen for a lot of people.
- 11:09Yeah.
- 11:09I mean, I think everyone's experience is the same, right?
- 11:11like uh probably most of the people in this room the first time that you run one of these models that like you know only existed behind an API or or a hosted environment on on some cloud GPU somewhere
- 11:23uh on your on your computer or on your you know your your your gaming laptop or your your gaming whatever it is I mean it's just uh I think from that moment on you're like
- 11:34making these things small is pretty cool there there is no a something that we have to discuss right and and and and and anyone can jump in to to follow up to this, but I'll pose it first to you, Daniel.
- 11:47Uh you said like models are 86% smaller, right?
- 11:51But like they're not 86% dumber.
- 11:53Uh how that sounds absurd, right?
- 11:56Like uh and and beyond how like how do you actually like verify or think about verifying that like this model is uh you know gone through the process of some some form of compression, right?
- 12:08Whatever it happens to be.
- 12:09How do I now like determine that that model is is not garbage, right?
- 12:13Like that that that we haven't chopped out 86% of its brain.
- 12:17Yeah, that's a great question.
- 12:18Um, so I think generally speaking, if you compress a model down by 86%, you would assume, you know, if you randomly select parts of the model to compress like delete or something like that or set set them to be like if you round it to like the closest number, you would most likely it will be not 86%
- 12:35dumber.
- 12:35It will be 100% dumber.
- 12:36So if you do that methodology that will not work.
- 12:39Um and so the main trick of language models is you should leverage the architecture of the language model itself.
- 12:44So language models generally have like you know 36 layers you know 50 layers many many layers each of the layers have different importance.
- 12:51Um and so like you know for example the most the first layer is actually very important and then the last layer is also very important but then the middle layers are kind of useless.
- 12:59Um and so the main reason why they're not that useful um is because when you train a language model um with like you know let's say one trillion parameters
- 13:07um you have to use many many tokens right so like a language model can be trained with like 30 trillion tokens um but we're still not there yet in terms of saturating all of the weights
- 13:17um so once you okay maybe in the future once we train to 300 trillion tokens okay maybe you can't do compression anymore okay maybe that's another topic but at the current stage the trick is
- 13:28um 86% of the weights do not need to be there in the model um because of the training algorithm because of you know back propagation some of the weights are very close to zero and you can literally just set them to zero um and so that's one of the tricks um and also you have to do you
- 13:42know layer by layer analysis you know if you quantize layer 1 what will happen to accuracy if you quantize layer two what will happen to accuracy and so on so on so on um and so you can also think of this as like a combinatorial
- 13:55optimization problem um you don't just do okay layer one and then do layer 2, you also have to do like you know 32 choose two layers or choose three layers.
- 14:03So it becomes very complicated.
- 14:05Um and so like you know it's a very then you get some combinatorial explosion problem you know it's not just layer by layer you know within the layer which number of this specific tensor is not quantizable or not.
- 14:17Um for example there is something called a um super weights there is a super weights paper which shows that if you quantize one number just one of the entire model your model becomes 20% dumber.
- 14:27Um, and so you need to find this specific one number and then you cannot quantize this.
- 14:32Um, so there's like very weird mechanisms of language models during training.
- 14:37Um, and yeah, there's a lot of whole research going into like quantizing models correctly.
- 14:42Um, yeah.
- 14:43Anyone else with thoughts to add here?
- 14:46Uh, yeah.
- 14:47So, okay.
- 14:47So, particularly your question was about how we evaluate.
- 14:51Yeah.
- 14:51Like how Yeah, exactly.
- 14:52Like how beyond just how do we make the model smaller like how do we know that it's not dumb?
- 14:57We just run all the benchmarks mostly the AA benchmarks.
- 15:01So uh model optimizer team we publish lot of check quantiz checkpoints on hugging face hub.
- 15:06You can check the Nvidia model optimizer space.
- 15:09Uh so we with FP4 we target for less than 1% accuracy degradation overall on all a benchmarks.
- 15:17Yeah.
- 15:17So uh yeah.
- 15:18Yeah.
- 15:19So that is um and and they're like you know we we uh we we try to use simple uh strategies because that way we can um push out uh models faster.
- 15:32Um on top of that um learning is that u the strong like like you know um the symbol and strong nicely designed number formats like FP4 preserve like lot of accuracy
- 15:45and then u we also see this um disproportionate sensitivity to some layers for example uh linear uh attention projection layers are very sensitive the the uh KV QKB layers are sensitive
- 15:59whereas we we by default keep them in uh FP4 while we put say like you know other uh layers in FP8 or BF16.
- 16:08We use this uh gradient based sensitivity analysis.
- 16:12It runs like a linear programming solver.
- 16:15But yeah, but my main um learning has been um that uh FP4 or like like you know really nicely designed uh number formats help a lot and we Yeah.
- 16:29And then a lot of benchmarking the boring stuff in which we spent a lot of time.
- 16:34Yeah.
- 16:34Maybe ju maybe just for everyone here who is like uh you know I mean I I think hopefully most of us understand like BF-16 and like you know uh
- 16:44FP8 like what what the hell is NVFP4?
- 16:47Oh cool.
- 16:48Okay so FP4 um the number is that it's a floating point 4bit number but the genius isn't it is a microlock scaled uh number.
- 16:57So microlock scaling means uh every u you choose a group.
- 17:03In in the case of FP4, you choose 16 elements and you can share one scaling fac one one extra um FP8 number between these 16 elements.
- 17:13So this was originally u invented by uh uh bits and bites Tim that yeah so uh Nvidia adopted like a similar but different design of uh four bits but every uh 16 bits share one uh 8 bit value
- 17:29uh to scale them and yeah that has been like that has been tremendous it uh gives significant improvements over like other formats yeah of 4bit.
- 17:42Yeah.
- 17:43Yeah.
- 17:43So it's it's not as simple as like uh we just make the numbers smaller, you know, it's a lot more going into it than that.
- 17:50I'd be interested to hear from you guys.
- 17:51Uh like I think a lot of the time when we talk about compression or quantization or any technique that makes the model more accessible, right?
- 18:01We're talking about it through the lens of like uh so that I can run it on my on my toaster like you said, right?
- 18:07Uh but like is there any value to compression or these techniques that exist for like a business that presumably has access to I would hope more more than a toaster
- 18:18part maybe you want to
- 18:20yeah I think for sure like you have a variance in kind of just you know hardware that a employee has versus hardware which uh scales up and you know they're running their own clusters.
- 18:34Um, and the way that at least we look at it from is you're you should be able to run whatever model you want locally on kind of that individual's computer as well.
- 18:45Um, and you know with compression in particular, you run through a lot of different challenges.
- 18:50So accuracy is for sure one of them.
- 18:53Um, but you know actually making use of it through a harness.
- 18:57Um, seeing you know what the end result is when you actually try it out.
- 19:01you know there's so many things that I feel can't be captured by a uh model optimizer or after quantizing it or you know certain benchmarks and it's literally me you know running through putting it in cloud code or something and running the model it's like no it doesn't feel just right
- 19:17um so I think you know the benchmarks are a great indicator of pointing in the right direction um but having the model behavior kind of stay in line with that I think is still kind of being worked done.
- 19:30And when it comes to businesses, you want to be able to give them the option to not just, you know, deploy their own models on like their own infrastructure,
- 19:38but also empower them to be able to run it on, you know, individual machines.
- 19:44I think benchmarking often times only work for the verifiable tasks rather than the, you know, the Vive itself.
- 19:51And like I now that I think about it actually it could have been cool to have like a quant arena or something but unfortunately like there was a paper last year by
- 20:01um singal I think from cohhere uh that showed that arenas are very much hacked.
- 20:07Uh so that that's also not the way but anyway I feel like most of the jobs still do not require like a fable level thing like we are kind of in a bubble as a software developers right so we are like wow fable
- 20:23but at the same time really most of the jobs do not require that and on top of it like for the businesses of some of the things that we are saying I feel like because I'm very open source pled it's like super obvious
- 20:37But at the same time many people don't know about it like you can just serve a lot of like you can have much more concurrency.
- 20:43Uh at the same time you can do like in-house deployment and stuff.
- 20:47So like um increasing concurrency cuts the compute and then yeah like most of the time people just don't need that.
- 20:56But like for instance like I've been hearing a lot from hugging face users and stuff and like it's not only the quantization but I know companies that actually distill midsize models to like very small ones for like reranking or whatever that doesn't require like LLM outputs
- 21:13uh cutting like millions of costs.
- 21:16So like it's not only quantization but like there is so much more that is out there for compression in my opinion and it just creates a ton of value for businesses and people aren't aware of it like because people in this room are like
- 21:30you know you are interested you you read about it you just assume that people know a lot about it but actually they don't and it's kind of shocking to me but yeah
- 21:41uh I another question that comes up all the time right we're talking about model compression uh you were talking about like GLM52, right?
- 21:48And let's let's shrink it down as much as we can.
- 21:51Uh back there on the the station we're running uh you know a reap quant of uh well compress of uh of GLM but like why would I do that when like uh Neotron 3 Nano exists or Gemma Small exists or Quentyn Tiny you know exists?
- 22:07like why why should I care about compression when a lot of these model shops are kind of putting out like uh small enough models that you can run them in kind of their native precision or very close to their native precision.
- 22:19So there is a paper showing that if you want to do compression um it's actually most likely better use of resources if you train a ginormous model then you quantize it down um and so there is this like formula where they show
- 22:32um comparing for example a very small model like a 35 billion um you know 35 billion Bflow 16 so 16 bit versus say like um four times bigger like 120 billion at 4bit um and which one's better right so essentially they're the same size in terms of disk case, but which one intelligence- wise is better?
- 22:51And from those experiments, they show that the bigger model quantized to 4bit is actually much better um than a 35 billion 16 bit.
- 22:59So in general, most likely what will happen is we'll get bigger and bigger and bigger and bigger models.
- 23:04Um and you know like okay currently now you know GLM you know 1.5 terabytes you know oh okay it's not that big.
- 23:10Um but what happens if it's 15 terabytes then okay we must do quantization we must do compression this will not fit in anyone's not not even enterprises can now service and so like local models you know you must do compression if they're getting bigger and bigger and bigger um and you know to extract any value out of
- 23:28it and you know okay I guess the DGX station has a lot of memory I guess that's very useful um but you know once we have 10 trillion parameter models that will also not fit and so like you know we need to do compression
- 23:40you I guess quantization for that.
- 23:42Um but in general the small ones are very useful.
- 23:44Um but I think the bigger ones compressed down um is slightly more useful.
- 23:48Um but there's also another trick you can do model routing.
- 23:51For example, for the small ones you can do it for the for example you can use the big ones for planning and then you execution with the small ones.
- 23:57Um but the small ones are still better because they're much faster.
- 24:01So even if you have a big one and you compress it down you'll probably get like five tokens to 10 tokens per second if you don't have enough GPU power.
- 24:09Um and for the small ones you can get 200 tokens per second.
- 24:12Um so I guess like depending on your use case um you also have to consider speed throughput you know what is your GPU that you have and stuff like that.
- 24:19Um yeah I guess I mean very cool very cool obviously uh so par with Olama I I I imagine mo most of the people here know Olama if if you're if you're not using it give it a try.
- 24:34uh you know this is one of those topics where you is Olama useful in a world where we don't have this kind of compression right like how how much uh is the fact that we can compress intelligence to kind of run on like my Mac or my
- 24:52uh you know my my my home workstation right like how much is that uh ecosystem important to to you know people or businesses or organizations like Ola
- 25:02yeah I think uh It's pivotal obviously for in in order to have like these models be so viable running on your personal computers and being able to actually make work of them as Murva was saying you know qu 36 just running on computer running open claw being able to
- 25:19fix its own harness that's really possible through some level of compression now there are you know other techniques which kind of some of the model labs will do especially while releasing
- 25:30smaller size models um things like Q8 at or you know with GPOSS it was MXFP4 which is a different format.
- 25:39So I do think as long as there's a demand for being able to run kind of personal language models even if compression didn't exist there would be analogous techniques or you know maybe model training would look a little bit different.
- 25:52Um obviously that comes everything comes at a trade-off.
- 25:54Um, as Daniel was mentioning, you know, you can have a really large model being condensed down into something smaller so you can run it versus even just having um a full precision model but smaller in parameter size.
- 26:06And they both come with different trade-offs.
- 26:08it matter of fact like how how do you see the open source community help drive this right like I think quantiz I mean we all remember Tim Demer's we all remember
- 26:19Qura you know is like that that that image right where there's a big stack of things that would fall over if it weren't for bits and bittes holding it all up like like how have you seen the open source community flourish or grow around
- 26:32uh not just quantization but compression more generally
- 26:36I wanted to add something to what Daniel says.
- 26:39By the way, if you don't know about their work, they have like immense pipelines to actually do the quants and then verify them and stuff.
- 26:46So like I highly recommend you to check out onslaught which is like in my opinion the best quants you will find over there.
- 26:53Yes.
- 26:54Oh, thank you.
- 26:55Um I wanted to say for instance like to add to your point like two years ago I think two years ago we trained like small VLM where there were no small vision language models.
- 27:06there was lava and then there was a jump to big models and then nobody was training like smaller ones.
- 27:11Um, we figured out that like um training like we trained like 1 B 500M and 260 uh 56M and like 256M was not good and like 500M was actually
- 27:27somewhat good and it was actually able to run on your iPhone which was like shocking to me and um I noticed that over time it feels like u people have been releasing like smaller models which is great.
- 27:42But like if you have like advanced models and then everybody is just releasing midsize models, you can quantize them.
- 27:48And I feel like that's the biggest value that quantization somewhat offers.
- 27:52And for instance, like to coming to your question about the community and stuff, for instance, this year what happened was that for the Q1 3.6 release, Q1 team asked the
- 28:01people, okay, we are going to release only one checkpoint, which is kind of heartbreaking.
- 28:06And everybody said the midsized ones.
- 28:09And this kind of goes to show the value of like how quantization is adopted and everybody's uh using those checkpoints and then quantizing them instead of asking for smaller models.
- 28:20I feel like you get more and more and more intelligence and then over time you shrink them and then suddenly it the the the bigger models make the bigger shifts in terms of like
- 28:33um how much you can quantize them and still you do not lose the information and the quants become smaller than the bigger models of yesterday which to me is like phenomenal.
- 28:44Um as for the community can you rephrase your
- 28:47[laughter]
- 28:47question again?
- 28:49I think you answered it actually.
- 28:51It's a great job.
- 28:52You Yeah,
- 28:53thank you.
- 28:54I mean, you know,
- 28:56I I got to ask this question since you're you're on the you're up here with us.
- 29:00So, we uh Nvidia Neotron releases NVFP4 with every uh release.
- 29:06NVFP4 is uh as described basically a numeric format, right?
- 29:11Uh but the idea is that it's like a smaller version of the model and it retains a lot of accuracy, right?
- 29:16uh which is the whole idea of of compression and quantization.
- 29:20Uh I just like to hear like how hard is it to do that right?
- 29:23Like so we kind of heard Daniel talk about it from this dynamic uh quantization strategy, right?
- 29:29Uh it's already sounds very difficult like how difficult as an engineering challenge is it to like make the model small without it shedding the bed.
- 29:39Uh I see.
- 29:39Okay.
- 29:40So if you're doing post- training quantization which is uh you take the model that uh the uh like the release model the BF16 model and do post- training quantization on it.
- 29:53It is fairly u like you know easy to do.
- 29:56Uh so we quantize to FP4 models like uh a uh large uh GLM or like you know those like trillion size models.
- 30:06uh you need uh like um a we have blackwell nodes so we put it on blackwell uh in in a couple of hours the condise checkpoint is ready but then our pain starts there because now we have to evaluate these models match the model card
- 30:22actually that is where we spend a lot of our time now coming to uh uh training based methods okay so for large models and mediumsiz models I would say like you know 20
- 30:34billion parameters plus or 30 million parameter plus den size.
- 30:39Uh this PTQ usually works out of the box.
- 30:42Uh with uh some selective quantization like the heristics like Dan mentioned right like we use some heristics such as sparse MOS can be aggressively quandisized like yeah and we also have this auto quandis which uses this automatic sensitivity analysis and napsack solver.
- 31:00Yeah.
- 31:00Yeah.
- 31:00So all those right.
- 31:02So for medium and large models PDQ works out of the box very easy relatively super easy to do.
- 31:08Uh then if it is smaller model say like you know less than 20B size model we have to do some uh quantization aware distillation etc to recover accuracy that is yeah so training based methods are a little bit more painful.
- 31:21They're becoming more painful especially with this reasoning models.
- 31:25So you need to have the original data set and it's not just about the original data set.
- 31:29Internally we have the original neotend data set but even then it is a pain because these are multi-rain uh multi-stage trained RL models like for done with now models are being trained with uh multiple teacher distillation
- 31:43where each teacher is like an expert in coding or reasoning or something.
- 31:47So it becomes really difficult to uh get uh good uh training data to uh train the model with with QAD uh yeah to recover accuracy.
- 31:58If we if we train if we do QA with wrong data it uh it most commonly breaks the model rather than helping it.
- 32:06Yeah.
- 32:07Yeah.
- 32:07So again it sounds hard.
- 32:09Uh I mean it's still an engineering challenge.
- 32:13No I want to stay corrected.
- 32:14I want uh to encourage people to like you know use quandies model mostly PTQ will uh work like you know if you are like looking at like 30B yeah it should work out of the box and
- 32:25there are so many tools right now like model op like unsloth has tools uh hug huggy face in the ecosystem tons of tools right to to make these big these big models small
- 32:36you you know something that I want to pick your guys' brains about is architecture for models in like the llama era of let's call it open AI right which is like uh every model was like the same you know the architecture was basically the same the kinds of things that you saw in the guts of the model
- 32:54were the same and now we're entering like a very cursed era of technology right where uh you know everyone's doing the architecture just a little bit differently we're using this hybrid attention
- 33:05they're using this uh you know linear attention uh you know you know variant uh you know we're we're exploring a lot and we're trying a bunch of new things.
- 33:16How has that like shifted the difficulty of quantization now that it's not just like one problem repeated with different uh you know you know numbers of layers like is that something that is
- 33:28makes it difficult to keep up with maybe maybe par you know from from Olaf's perspective like how hard is it to keep up with this?
- 33:35Yeah.
- 33:36Um there's kind of two facets to it I would say.
- 33:39Uh the first is actually just the model implementation itself.
- 33:42U there's you know been times where a model lab would come to us early and we're kind of working with them to implement the model uh beforehand and we do this except you know they come and sometimes there's like five different variations
- 33:54of a model and you know we need to have them all working.
- 33:57So the implementation is one side of it.
- 33:59Um and I'm sure other people also have to put a lot of work in it.
- 34:03But the other kind of other side is you kind of have to run through the quantization bit and seeing you know kind of which one works best.
- 34:11And atama we kind of do a UX thing of like giving a default uh model quantization for most things uh for most models.
- 34:19Um, and a big part of that is actually, you know, us spending the time one quantizing it, but then seeing if it actually works well with like different harnesses
- 34:29and, you know, is it actually usable after and so we find that sometimes when you have a very small parameter size model, um, you don't get like great quantization
- 34:40after that.
- 34:41Um so we sometimes leave it in higher precision um as a default just because we actually want people to have a better experience uh versus you know quantizing it down quantiz yeah yeah quantizing it down to too little of a precision
- 34:54um and not having the model actually work well.
- 34:58So it's always a challenge um both from like the implementation perspective but then actually you know running into the quantization bit and making sure it still works correctly.
- 35:07And and Daniel, like is it harder to do quantization now that like everything is some hybrid or linear variant or and it's also all like sparse or variations on sparsee
- 35:18like how much harder is it today than it was when it was everything was just long all the way down.
- 35:24Yeah.
- 35:24Like in the olden days you know every model was dense the transformer plus plus.
- 35:28So it's called transformer plus architecture.
- 35:30You know it's an old transformer.
- 35:32Okay.
- 35:32Plus RMS lay plus some extra tricks.
- 35:35That's called transformer plus.
- 35:36And then now it's like oh my it's like transformer plus+ plus and then plus this thing plus that thing minus this thing minus that thing a different activation function
- 35:44linear attention here sliding window window window attention you know how many layers are sliding window how many layers are global oh let's delete global do something else blah blah blah blah blah um you know everyone likes to do their own thing and you know they like to compare you know like okay this one does better for long
- 35:59context you know this one does worse for long context or something like this so there there's always like reasons why they like to change the architecture Um you know some folks even change some of the you know layer norm epsilons like you know change 1 eus 5 to 1 eus 6 okay which one's better and so on.
- 36:15So they do a lot of abilations you know they do a lot of testing you know this one seems to be better than this one.
- 36:19Um and yes it has complicated compression and quantization dramatically.
- 36:24Um you know you have your old huristics okay this works well for for this model but then when you go to the world oh you can quantize thee layers to like one bit and it doesn't break.
- 36:33Um but then you know when you go to the linear attention world you cannot quantize the linear attention layers.
- 36:38So if you quantize the linear we found that if you quantize the linear attention layers okay it looks like it's doing good but then when you do long context benchmarks you know when you actually use the model in real production it becomes gibberish.
- 36:48Um and so like there are some layers you cannot quantize with these new architectures.
- 36:52Some layers you can you know quantize very low to like one bit you know you can even delete some layers if you like.
- 36:57Um and so it's like these new architectures complicate the process.
- 37:01Um but to be honest very happy with this because we need more different architectures.
- 37:06We don't want everyone to be like thinking the same way and you know open source has been you know the open model era has been like there's so many different architectures
- 37:14and it's very good to have like you know a variety of different opinions and architectures.
- 37:19Yeah.
- 37:20I mean that's that's dope.
- 37:21Yeah.
- 37:21Hell yeah.
- 37:22Uh I we we got about five minutes left.
- 37:26Question.
- 37:26Can we ask questions?
- 37:27Uh I I I want to get one more question with these guys and then yes.
- 37:31Uh okay.
- 37:32So compression is an art not a science right now.
- 37:36It's a it's a it's an artisal science let's say.
- 37:38Uh but where is it going?
- 37:41Uh you know what does what does compression look like uh in six months and 18 months?
- 37:46Maybe we'll just go we'll start with Marv and then we'll we'll we'll do a loop around.
- 37:50Can we start from
- 37:52Yeah,
- 37:52[laughter]
- 37:52sure.
- 37:52We'll start.
- 37:54Would you like
- 37:55Yeah, sure.
- 37:55Um, so
- 37:57I think the way what we've seen so far is compression being so critical for any model launch that comes around.
- 38:06So it seems that model labs are starting to think more about it as well.
- 38:10Um, the folks at on do a phenomenal job.
- 38:14Fingers crossed they keep putting some great stuff out.
- 38:16Um, but more than that, I think because of, you know, the model architecture is changing and kind of this awareness that model labs are having, we're starting to see more things like QAT
- 38:27uh, come out from the labs themselves.
- 38:28And I'm sure like there's ways to push even that further.
- 38:32But I think it's going to be a mix of the labs kind of becoming a little bit more interested, but also the community kind of doing the great work they already have been and pushing that further.
- 38:42Can't go now that I thought about the question.
- 38:46So basic um what I think is most of so previously we were just running models on servers and stuff but I think we can just finally push the edge because like there was this increasing
- 38:58demand for privacy and everything especially for like sensitive data personal data and so on.
- 39:05So like I see compression being a super hot topic and um we are developing a lot of cool stuff with Llama CPP.
- 39:13So I would like I would like it if you could stay tuned for that.
- 39:16Um so that it runs like everywhere.
- 39:19Um so I think I see the the so previously I saw that the we were constantly scaling the model model parameters and then the data diversity and then going down.
- 39:31I see it as like going even further to the phones and stuff because it wasn't working like we tried a lot and then it wasn't working.
- 39:40I see intelligence going to phones thanks to the quants and everything.
- 39:45So yeah,
- 39:46going to phones.
- 39:47Let's go.
- 39:49Yeah.
- 39:50Okay.
- 39:50So the way I think about compression, uh the whole space is going to go more broader.
- 39:56So we will focus this discussion mostly on weight compression.
- 40:00So uh okay, going back to FP4 once again.
- 40:02Uh so it also do weight compression and uh math acceleration because it it do the uh gem in 4bit.
- 40:10So uh yeah so for in terms of weight compression we might be able to go to like one maybe two or three bit more but in terms of u
- 40:21quantization alone we might be like close like close to the par optimality uh yeah let's let's see uh then there are more like you know more type of compressions so KB cache compression right so yeah so people are still
- 40:37mostly using 8 bit uh 4-bit large models retain that quality very well but smaller models we see some drop.
- 40:45So yeah so looking forward to KV cache uh maybe comb action plus quantization uh like pushing uh the long uh horizon reasoning uh broader than sparsity.
- 40:56So uh so okay so by the way sparsity is uh has been part of Nvidia hardware but it has not been uh like broadly adopted.
- 41:07uh that is because um quantization does not degrade accuracy that much but spec uh sparity causes accuracy degradation a bit more.
- 41:15So in Rubin there is this cool feature called dynamic activation sparity so it can uh improve attention math etc. So yeah so looking forward to that and then coming back to like you know all these heterogeneous
- 41:27architectures right so with each release the yeah the particularly the attention architecture is getting more and more complex deepseek started it I blame them they started with MLA now like you know sparse attention indexed attention like you know lot of skips soft max yeah so it's getting broader
- 41:45and yeah so it is part of this process where we make models cheaper and and they are they are having compounding effects Perfect.
- 41:53So, so we're going to quantize more things uh more is basically the idea.
- 41:58That's that's pretty dope.
- 41:59I I don't I don't mind that.
- 42:01Take us home.
- 42:02Yeah.
- 42:02So, I think like the world we're going to get more and more bigger models.
- 42:07Um and you know, it would be very cool if we can run them locally on our phones, you know, on your laptops with your GPUs.
- 42:15Um and you like imagine in a world where, you know, the best Frontier models will be able to run on your computers.
- 42:21You know, that would be so cool.
- 42:22um you know now you can control your own destiny.
- 42:24you do not need to be, you know, controlled by some model labs and now you can do whatever you like on your computer, right?
- 42:31You can do your own fine-tuning, you can customize it.
- 42:34Um, you can, you know, everything becomes yourself.
- 42:37You own it.
- 42:38Um, and so like, you know, I see a world where the world in the future, all of the intelligence will be fully democratized, you know, via GPUs, via the phone, you know, any single hardware.
- 42:48And you you will have, you know, very capable AIs on your laptop, on your local devices running, you know, and it's also going to be efficient, right?
- 42:57You don't want your computer to like, you know, lose battery and die.
- 43:00Um, but I feel like, you know, with all of these techniques, um, you know, we can have a future where AI is fully democratized.
- 43:05And that's, yeah, that's where I see it.
- 43:07Yeah,
- 43:08not a bad future.
- 43:09Uh, again, we can't do it without any all of you in the room.
- 43:13So, big round of applause for the the panel here.
- 43:16[applause]
- 43:19Thank you so much guys.
- 43:20We we have one question.
- 43:21We'll do one question.
- 43:22All right.
- 43:22So you talked about all the different permutations of craziness that are happening in the model space and the proliferation of various techniques to right.
- 43:32Um but we often you find some weird Frankenstein model out there that you want to try out but you have no clue how well it actually performs on the original benchmarks of the model before all the modifications.
- 43:46So I'm just Is there any good resource out there?
- 43:49Maybe this is a job for this place.
- 43:56All these benchmarks again on these models again to see how well they perform after all the freakish things were done to them to see how well they're going for this for that
- 44:13etc. Right.
- 44:15a resource like that.
- 44:16Just curious.
- 44:19Yeah, if you find something like that, let me know.
- 44:21Yeah.
- 44:22Yeah.
- 44:22I I think I think that's it.
- 44:23Basically, the question is what is the resource I can look at to find out what is, you know, the of the suite of crazy quants or compresses that exist for a model?
- 44:32How do I find the ones that are good at the things that I care about?
- 44:35Is anyone doing that?
- 44:36I think right now it is not being done comprehensively.
- 44:41Uh we do have some so for some models when we do our dynamic quantizations we do release benchmarks um and we do not do so generally what our view is accuracy benchmarks can be very complicated because you have to do sampling
- 44:53how many trials you need to do and you have to average.
- 44:56So there is another better method in our view um KI divergence.
- 44:59So KOD is the distance between the uncontized version which is Bflat 16 and your quantized version.
- 45:05And you can calculate some sort of distance between the quantized version and the uncquantized version.
- 45:09And your goal is to make the distance zero and the size smaller.
- 45:14Do you do it over the output logits?
- 45:16Yes.
- 45:17So you check the output logs, you pass some sort of collaboration data, you shove it in and then you have some you check the output logits between the Bflat 16 and then the main, you know, the quantized version.
- 45:26And then the goal is make this distance zero.
- 45:28Um and you make the model smaller.
- 45:29That's KLD.
- 45:30Yeah, that's K. Um KLD, uh you can check out the paper.
- 45:34Accuracy is not all you need if you want to learn more about that one.
- 45:37That's it for us guys.
- 45:38Thank you so much again to our excellent panel.
- 45:42Thank you.
- 45:43[applause]
- 45:48[music]
- 45:57[music]