Compression at the Edge — NVIDIA, Unsloth, HuggingFace, Ollama https://www.youtube.com/watch?v=J4_jCrTxMkk AI Engineer · 46 min · 478 sentences · sentence-level transcript from YouTube's caption track; each line begins at the time shown [00:01] [music] [00:12] Okay. [00:12] Hello everybody. [00:13] Welcome to uh compression at the edge, the panel that we'll be conducting for the next bit here. [00:21] Uh very nice to meet you all. [00:23] I'll be your trusty moderator today. [00:25] My name is Chris Alex. [00:26] I'm a product research engineer at Nvidia. [00:28] I work on Neotron. [00:29] Let's go. [00:30] Okay, we are joined by Daniel. [00:34] Yes, hello everyone. [00:34] I'm from Enslaf. [00:36] Um, yeah, thanks for coming everyone. [00:38] Excellent. [00:39] And [00:39] hello. [00:40] Hi, I'm build NVIDIA model optimizer and we conduct a lot of models. [00:44] Let's go. [00:45] I'm Marv. [00:46] I work as a machine learning engineer at Hugging Face. [00:49] Awesome. [00:50] I'm Parth. [00:51] I work at Volama. [00:53] So, compression uh a big topic. [00:57] We're gonna we're going to set some some context hopefully uh in order to to kind of launch into this. [01:03] So 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:18] Like that's the that's the general idea. [01:21] So uh maybe we'll just go in reverse order. [01:23] Par if you want to kick us off and what is compression to you? [01:26] Yeah, 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:39] being 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:47] Um, and to me, compression is so so important because it actually makes these giant models viable for most people. [01:55] I think for me it's just um shrinking something without losing information. [02:01] But there's absolutely zero free lunch. [02:02] So 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:12] I feel like compression is much more than that definition because it democratizes the models for everyone at edge devices at your computer. [02:22] I'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:33] Um so yeah uh this is my definition at least it democratizes things. [02:38] Cool. [02:39] So the way I think about is same cost more intelligence. [02:43] So 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:55] uh more compression and same almost same intelligence without not much degradation yeah same cost more intelligence [03:03] yeah 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:13] Um but then the trick is you can actually quantize it and shrink it to 250GB. [03:18] Um so you can make it 86% smaller. [03:20] Um but with tricks of quantization it will not become 86%. [03:24] So it's not 86% dumber right if you compress it by 86% it doesn't become like you know terrible useless. [03:31] Um 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:45] of all accuracy. [03:46] Um 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:53] Um and compression I guess is very important for you to run on your local computers. [03:57] Um you know make democratization of AI. [04:00] Yeah. [04:01] So like, okay, we we we've been talking today about like there this inflection point, right? [04:06] Recent 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:18] Own your own intelligence. [04:20] You guys were like ahead of the curve though, right? [04:22] Like I mean you guys were thinking about this before it was it was cool to think about it, right? [04:27] So, 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:40] right 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:50] got 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:58] Daniel, take us away. [04:59] Yeah. [05:00] Um, so I think like the biggest moment was Deep Seek R1. [05:03] Definitely 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:11] Um, and it was open source. [05:12] Um, and the biggest problem though it was very big. [05:16] Um, and you know, running it locally was extremely complex. [05:19] Um, and so you know we when we started off like you know we decided okay let's do some tricks. [05:25] let's quantize some layers to higher precision. [05:28] Um, and it randomly worked. [05:30] Um, and so like we were quite surprised like you know 1.58 bit quant worked well. [05:35] Um, and we were yeah we just posted about this and we were quite surprised. [05:39] Okay, look model seem to be working well. [05:41] Um, 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:50] they just keep getting better and better and better. [05:52] Um the only problem sometimes is they get bigger and bigger and bigger. [05:55] So 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:04] you 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:14] of 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:23] yeah 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:37] is is it [06:39] so 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:00] thing 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:10] so 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:31] right 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:44] uh make NVFP4 better but it is like a really solid uh numeric format. [07:49] So yeah, so that was Yeah. [07:51] So 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:02] uh quantization you can compress it 10 chop it at 10 without losing much quality. [08:08] Yeah. [08:08] So that was a slowly growth for me. [08:11] Should I? [08:12] Yes please. [08:13] So, um I think for me the biggest wow moment of quantization was back in the day there was something called Q Laura [08:21] and 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:35] it'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:49] for 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:00] uh 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:21] Q1 3.6 quants which wouldn't be able to which wouldn't be possible before. [09:27] Um 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:36] harness and stuff. [09:38] So yeah, that was the two big moments for me actually. [09:42] Yeah. [09:43] Um I think I'll speak to it more from like a a consumer point of view. [09:47] Um I this is back in like 2023. [09:50] Uh I was kind of hacking around my own stuff. [09:52] This is prior to me being at a Lama. [09:54] Um but one of the coolest things was I wanted to run kind of my AI on my computer. [09:59] You know, I was still in school at the time, broke, did not have a lot of money. [10:02] And so I was like, "Okay, I need to run this for free somehow. [10:05] So what's like the best option?" [10:07] Um, 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:16] very long time ago. [10:18] Um, and honestly for me that's kind of how I got into the whole world of local models. [10:22] It's like okay this is actually workable. [10:25] I can like make it do things. [10:27] It's able to output something and you know back then it wasn't as good as it is you know outputting now. [10:32] As 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:40] But for me, it was honestly the idea of like being able to even just run something locally. [10:46] Um, and it started with like Llama 3 with Lama and being able to actually have it run and like complete tasks. [10:54] Um, and prior to that, you know, I'd done built a lot of models before. [10:58] Um, and I knew like how much work it goes like is that goes into building them. [11:02] Um, and running them has always been hard. [11:04] So to me, quantization like really makes that happen for a lot of people. [11:09] Yeah. [11:09] I mean, I think everyone's experience is the same, right? [11:11] like 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:23] uh 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:34] making 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:47] Uh you said like models are 86% smaller, right? [11:51] But like they're not 86% dumber. [11:53] Uh how that sounds absurd, right? [11:56] Like 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:08] Whatever it happens to be. [12:09] How do I now like determine that that model is is not garbage, right? [12:13] Like that that that we haven't chopped out 86% of its brain. [12:17] Yeah, that's a great question. [12:18] Um, 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:35] dumber. [12:35] It will be 100% dumber. [12:36] So if you do that methodology that will not work. [12:39] Um and so the main trick of language models is you should leverage the architecture of the language model itself. [12:44] So language models generally have like you know 36 layers you know 50 layers many many layers each of the layers have different importance. [12:51] Um 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:59] Um 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:07] um 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:17] um 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:28] um 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:42] know 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:55] optimization 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:03] So it becomes very complicated. [14:05] Um 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:17] Um 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:27] Um, and so you need to find this specific one number and then you cannot quantize this. [14:32] Um, so there's like very weird mechanisms of language models during training. [14:37] Um, and yeah, there's a lot of whole research going into like quantizing models correctly. [14:42] Um, yeah. [14:43] Anyone else with thoughts to add here? [14:46] Uh, yeah. [14:47] So, okay. [14:47] So, particularly your question was about how we evaluate. [14:51] Yeah. [14:51] Like how Yeah, exactly. [14:52] Like how beyond just how do we make the model smaller like how do we know that it's not dumb? [14:57] We just run all the benchmarks mostly the AA benchmarks. [15:01] So uh model optimizer team we publish lot of check quantiz checkpoints on hugging face hub. [15:06] You can check the Nvidia model optimizer space. [15:09] Uh so we with FP4 we target for less than 1% accuracy degradation overall on all a benchmarks. [15:17] Yeah. [15:17] So uh yeah. [15:18] Yeah. [15:19] So 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:32] Um 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:45] and 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:59] whereas we we by default keep them in uh FP4 while we put say like you know other uh layers in FP8 or BF16. [16:08] We use this uh gradient based sensitivity analysis. [16:12] It runs like a linear programming solver. [16:15] But 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:29] And then a lot of benchmarking the boring stuff in which we spent a lot of time. [16:34] Yeah. [16:34] Maybe 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:44] FP8 like what what the hell is NVFP4? [16:47] Oh cool. [16:48] Okay 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:57] So microlock scaling means uh every u you choose a group. [17:03] In 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:13] So 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:29] uh 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:42] Yeah. [17:43] Yeah. [17:43] So 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:50] I'd be interested to hear from you guys. [17:51] Uh 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:01] We'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:07] Uh 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:18] part maybe you want to [18:20] yeah 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:34] Um, 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:45] Um, and you know with compression in particular, you run through a lot of different challenges. [18:50] So accuracy is for sure one of them. [18:53] Um, but you know actually making use of it through a harness. [18:57] Um, seeing you know what the end result is when you actually try it out. [19:01] you 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:17] um 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:30] And 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:38] but also empower them to be able to run it on, you know, individual machines. [19:44] I think benchmarking often times only work for the verifiable tasks rather than the, you know, the Vive itself. [19:51] And 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:01] um singal I think from cohhere uh that showed that arenas are very much hacked. [20:07] Uh 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:23] but 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:37] But 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:43] Uh at the same time you can do like in-house deployment and stuff. [20:47] So like um increasing concurrency cuts the compute and then yeah like most of the time people just don't need that. [20:56] But 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:13] uh cutting like millions of costs. [21:16] So 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:30] you 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:41] uh 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:48] And let's let's shrink it down as much as we can. [21:51] Uh 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:07] like 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:19] So 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:32] um 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:51] And from those experiments, they show that the bigger model quantized to 4bit is actually much better um than a 35 billion 16 bit. [22:59] So in general, most likely what will happen is we'll get bigger and bigger and bigger and bigger models. [23:04] Um 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:10] Um 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:28] it 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:40] you I guess quantization for that. [23:42] Um but in general the small ones are very useful. [23:44] Um but I think the bigger ones compressed down um is slightly more useful. [23:48] Um but there's also another trick you can do model routing. [23:51] For 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:57] Um but the small ones are still better because they're much faster. [24:01] So 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:09] Um and for the small ones you can get 200 tokens per second. [24:12] Um 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:19] Um 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:34] uh 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:52] uh 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:02] yeah 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:19] fix 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:30] smaller size models um things like Q8 at or you know with GPOSS it was MXFP4 which is a different format. [25:39] So 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:52] Um obviously that comes everything comes at a trade-off. [25:54] Um, 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:06] And they both come with different trade-offs. [26:08] it 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:19] Qura 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:32] uh not just quantization but compression more generally [26:36] I wanted to add something to what Daniel says. [26:39] By 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:46] So like I highly recommend you to check out onslaught which is like in my opinion the best quants you will find over there. [26:53] Yes. [26:54] Oh, thank you. [26:55] Um 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:06] there was lava and then there was a jump to big models and then nobody was training like smaller ones. [27:11] Um, 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:27] somewhat 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:42] But like if you have like advanced models and then everybody is just releasing midsize models, you can quantize them. [27:48] And I feel like that's the biggest value that quantization somewhat offers. [27:52] And 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:01] people, okay, we are going to release only one checkpoint, which is kind of heartbreaking. [28:06] And everybody said the midsized ones. [28:09] And 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:20] I 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:33] um 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:44] Um as for the community can you rephrase your [28:47] [laughter] [28:47] question again? [28:49] I think you answered it actually. [28:51] It's a great job. [28:52] You Yeah, [28:53] thank you. [28:54] I mean, you know, [28:56] I I got to ask this question since you're you're on the you're up here with us. [29:00] So, we uh Nvidia Neotron releases NVFP4 with every uh release. [29:06] NVFP4 is uh as described basically a numeric format, right? [29:11] Uh but the idea is that it's like a smaller version of the model and it retains a lot of accuracy, right? [29:16] uh which is the whole idea of of compression and quantization. [29:20] Uh I just like to hear like how hard is it to do that right? [29:23] Like so we kind of heard Daniel talk about it from this dynamic uh quantization strategy, right? [29:29] Uh 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:39] Uh I see. [29:39] Okay. [29:40] So 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:53] It is fairly u like you know easy to do. [29:56] Uh so we quantize to FP4 models like uh a uh large uh GLM or like you know those like trillion size models. [30:06] uh 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:22] actually 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:34] billion parameters plus or 30 million parameter plus den size. [30:39] Uh this PTQ usually works out of the box. [30:42] Uh 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:00] Yeah. [31:00] Yeah. [31:00] So all those right. [31:02] So for medium and large models PDQ works out of the box very easy relatively super easy to do. [31:08] Uh 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:21] They're becoming more painful especially with this reasoning models. [31:25] So you need to have the original data set and it's not just about the original data set. [31:29] Internally 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:43] where each teacher is like an expert in coding or reasoning or something. [31:47] So 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:58] If we if we train if we do QA with wrong data it uh it most commonly breaks the model rather than helping it. [32:06] Yeah. [32:07] Yeah. [32:07] So again it sounds hard. [32:09] Uh I mean it's still an engineering challenge. [32:13] No I want to stay corrected. [32:14] I 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:25] there 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:36] you 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:54] were 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:05] they'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:16] How 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:28] makes 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:35] Yeah. [33:36] Um there's kind of two facets to it I would say. [33:39] Uh the first is actually just the model implementation itself. [33:42] U 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:54] of a model and you know we need to have them all working. [33:57] So the implementation is one side of it. [33:59] Um and I'm sure other people also have to put a lot of work in it. [34:03] But 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:11] And atama we kind of do a UX thing of like giving a default uh model quantization for most things uh for most models. [34:19] Um, 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:29] and, 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:40] after that. [34:41] Um 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:54] um and not having the model actually work well. [34:58] So 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:07] And 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:18] like how much harder is it today than it was when it was everything was just long all the way down. [35:24] Yeah. [35:24] Like in the olden days you know every model was dense the transformer plus plus. [35:28] So it's called transformer plus architecture. [35:30] You know it's an old transformer. [35:32] Okay. [35:32] Plus RMS lay plus some extra tricks. [35:35] That's called transformer plus. [35:36] And 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:44] linear 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:59] context 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:15] So 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:19] Um and yes it has complicated compression and quantization dramatically. [36:24] Um 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:33] Um but then you know when you go to the linear attention world you cannot quantize the linear attention layers. [36:38] So 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:48] Um and so like there are some layers you cannot quantize with these new architectures. [36:52] Some layers you can you know quantize very low to like one bit you know you can even delete some layers if you like. [36:57] Um and so it's like these new architectures complicate the process. [37:01] Um but to be honest very happy with this because we need more different architectures. [37:06] We 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:14] and it's very good to have like you know a variety of different opinions and architectures. [37:19] Yeah. [37:20] I mean that's that's dope. [37:21] Yeah. [37:21] Hell yeah. [37:22] Uh I we we got about five minutes left. [37:26] Question. [37:26] Can we ask questions? [37:27] Uh I I I want to get one more question with these guys and then yes. [37:31] Uh okay. [37:32] So compression is an art not a science right now. [37:36] It's a it's a it's an artisal science let's say. [37:38] Uh but where is it going? [37:41] Uh you know what does what does compression look like uh in six months and 18 months? [37:46] Maybe we'll just go we'll start with Marv and then we'll we'll we'll do a loop around. [37:50] Can we start from [37:52] Yeah, [37:52] [laughter] [37:52] sure. [37:52] We'll start. [37:54] Would you like [37:55] Yeah, sure. [37:55] Um, so [37:57] I think the way what we've seen so far is compression being so critical for any model launch that comes around. [38:06] So it seems that model labs are starting to think more about it as well. [38:10] Um, the folks at on do a phenomenal job. [38:14] Fingers crossed they keep putting some great stuff out. [38:16] Um, 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:27] uh, come out from the labs themselves. [38:28] And I'm sure like there's ways to push even that further. [38:32] But 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:42] Can't go now that I thought about the question. [38:46] So 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:58] demand for privacy and everything especially for like sensitive data personal data and so on. [39:05] So like I see compression being a super hot topic and um we are developing a lot of cool stuff with Llama CPP. [39:13] So I would like I would like it if you could stay tuned for that. [39:16] Um so that it runs like everywhere. [39:19] Um 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:31] I 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:40] I see intelligence going to phones thanks to the quants and everything. [39:45] So yeah, [39:46] going to phones. [39:47] Let's go. [39:49] Yeah. [39:50] Okay. [39:50] So the way I think about compression, uh the whole space is going to go more broader. [39:56] So we will focus this discussion mostly on weight compression. [40:00] So uh okay, going back to FP4 once again. [40:02] Uh so it also do weight compression and uh math acceleration because it it do the uh gem in 4bit. [40:10] So 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:21] quantization 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:37] mostly using 8 bit uh 4-bit large models retain that quality very well but smaller models we see some drop. [40:45] So 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:56] So 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:07] uh that is because um quantization does not degrade accuracy that much but spec uh sparity causes accuracy degradation a bit more. [41:15] So 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:27] architectures 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:45] and yeah so it is part of this process where we make models cheaper and and they are they are having compounding effects Perfect. [41:53] So, so we're going to quantize more things uh more is basically the idea. [41:58] That's that's pretty dope. [41:59] I I don't I don't mind that. [42:01] Take us home. [42:02] Yeah. [42:02] So, I think like the world we're going to get more and more bigger models. [42:07] Um 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:15] Um and you like imagine in a world where, you know, the best Frontier models will be able to run on your computers. [42:21] You know, that would be so cool. [42:22] um you know now you can control your own destiny. [42:24] you 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:31] You can do your own fine-tuning, you can customize it. [42:34] Um, you can, you know, everything becomes yourself. [42:37] You own it. [42:38] Um, 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:48] And 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:57] You don't want your computer to like, you know, lose battery and die. [43:00] Um, 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:05] And that's, yeah, that's where I see it. [43:07] Yeah, [43:08] not a bad future. [43:09] Uh, again, we can't do it without any all of you in the room. [43:13] So, big round of applause for the the panel here. [43:16] [applause] [43:19] Thank you so much guys. [43:20] We we have one question. [43:21] We'll do one question. [43:22] All right. [43:22] So 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:32] Um 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:46] So I'm just Is there any good resource out there? [43:49] Maybe this is a job for this place. [43:56] All 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:13] etc. Right. [44:15] a resource like that. [44:16] Just curious. [44:19] Yeah, if you find something like that, let me know. [44:21] Yeah. [44:22] Yeah. [44:22] I I think I think that's it. [44:23] Basically, 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:32] How do I find the ones that are good at the things that I care about? [44:35] Is anyone doing that? [44:36] I think right now it is not being done comprehensively. [44:41] Uh 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:53] how many trials you need to do and you have to average. [44:56] So there is another better method in our view um KI divergence. [44:59] So KOD is the distance between the uncontized version which is Bflat 16 and your quantized version. [45:05] And you can calculate some sort of distance between the quantized version and the uncquantized version. [45:09] And your goal is to make the distance zero and the size smaller. [45:14] Do you do it over the output logits? [45:16] Yes. [45:17] So 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:26] And then the goal is make this distance zero. [45:28] Um and you make the model smaller. [45:29] That's KLD. [45:30] Yeah, that's K. Um KLD, uh you can check out the paper. [45:34] Accuracy is not all you need if you want to learn more about that one. [45:37] That's it for us guys. [45:38] Thank you so much again to our excellent panel. [45:42] Thank you. [45:43] [applause] [45:48] [music] [45:57] [music]