If you are running a GGUF model, ollama will split the process, putting as many layers as it can on GPU and the rest on CPU. IT will run slower, but faster than CPU only.
Mini PCs have revolutionized the boring PC market. The power they are able to squeeze inside these small boxes gives me hope for the future of computing.
While I agree that they are cool, they kind of become pointless once you add one of these giant eGPUs. You could build a mini itx pc instead and avoid the occulink restrictions while also gaining the increased upgradability of a full desktop.
Mini PCs are (for the most part) just laptop bowels transplanted in a little box. They have use cases, for sure (hospitals, HTPCs, schools, small clients, emulation boxes, offices) but as soon as you ramp up the performances the prices and drawbacks (mainly thermals) go up quickly too, at the point where it's better to stick to a custom build solution unless you REALLY need the small form factor. I admit that the mainstream pc market of today is VERY boring though, it peaked just around pre-covid and stayed there (I'm still using my ryzen 3600 + 6700 xt and I don't feel the need to upgrade to PCIx 5, while I bleeded money into my home server instead).
@@TheRaretunes true. But i hope the tech gets better and better for them. I find pc cases to be really ugly. Didn’t mind them back in the day but those aren’t best for airflow. Talking about airflow, just how much air do you need. I like small itx cases a lot more and surprisingly, they show that you don’t really need that much space for airflow and good temps. “Building computers” is also an overhyped genre. It’s really not all that it’s cracked up to be.
Chinese modders transplanted a chip from RTX 4090D to a custom board or a 3090 board and soldered 48 GB of memory. Real beast for AI rig. However, I'm not sure about the warranty for such Frankenstein card.
It's honestly sad at this point neither nvidia, Intel or amd have come out with a $700 card that just has 48gb vram and a $900 model with 128GB. The memory is cheap as nvidia just wants to squeeze you to spend $2000 on 4090. With Ai now I think at least just 1x consumer model would be good from someone. I mean, you'd sell at least 2m units.
@@Larimussas far as I know nvidia has monopoly over AI due to their CUDA technology. Until amd or intel isn't capable of competing with nvidia in this space, there wouldn't be any card with such memory.
@cena777248 yeh they do for now. Intel has already created some inference with their tech I beleive. And since CPU models exist I'm sure if amd made a cheap 48gb vram card the internet will figure out how to convert models or whatever it is. I'm pretty sure you can run some models with amd too? Just much less support where nvidia just runs everything right now and most optimally I think.
@@Larimuss it’s not good business for the average consumer to have access to good, fast, general-purpose local AI. We’d pay, what, maybe $600 more for that at an enthusiast level, less for the average consumer. But as long as AI remains the domain of big cloud companies and startups backed by VCs with deep pockets, people will keep flocking to them for this seemingly exclusive godlike power, and they will keep paying enterprise money to Nvidia.
Some points here Alex: 1. The power cable that's split into three power plugs is a "dongle" that converts the 12V HPWR plug that's too recent for most power supplies out there, so they supply a splitter that is powered by 3 or 4 of the 8 pin PCI-E connectors. 2. The drivers for your GPU are provided by Nvidia themselves (just Google game ready drivers for RTX 4090), as the AIB drivers (Gigabyte's) are outdated. 3. All modern GPUs (from 2010 onwards) are all set to have zero fan revs at sub 60° C.
@@R1L1. You're talking about exceptions to the rule, I only recall the Vega VII that had it's fans running all the time because it ran hot as the sun. Apart from that point 3 is the rule.
@@blackhorseteck8381 that doesn't change the fact that you are wrong, you could have just said most modern GPUs not all GPUs . Even then my rx6500xt always keeps the fans on, same with my 3060, didn't change anything after buying so yeah... Idk.
small advice regarding ollama: use verbose example: ollama run llama3.1:8b --verbose technically these commands, including what you ran, keeps the model loaded. You have to manually unload it, or you can tell the model to unload after you go /bye: ollama run llama3.1:8b --verbose --keepalive 10s the verbose will tell you the tokens per second generated. the keepalive 10s will drop the model from memory after 10s
Serious question: why not just use the power directly if you're UPS isn't big enough? This isn't a mission critical server with important information, it doesn't need 24/7 operation during a power outage.
10:10 The GPU spikes while running Ollama could be due to Batch processing: The AI might be processing data in phases, causing short bursts of high GPU usage. Resource optimization: The GPU is only used for certain tasks, leading to inconsistent usage. Power management: The GPU adjusts its power consumption based on demand, resulting in spikes.
@@dontblinknerd Windows automatically install the latest version of Nvidia drivers, otherwise it would not detect the RTX 4090 but the Microsoft video card.
I experienced the same VRAM problems. I have a i9-32 thread and 128GB system RAM and runs the large models in slow motion but works. Small models run fast enough to use on the i9, but if it fits the gpu 16GB its really fast and enough to use as a service for a few clients. I'm using 4090 mobile=4080 desktop. Large models, these days, seems the Mac unified ram is the way to go for running large models but slower, but at least it runs and the wait is not too long.
I'm not convinced about the Mac's unified RAM. What all these Mac youtubers don't show you is the impact of larger prompts. While you may be fine with 5tokens/s, it's gonna suck if you have to wait a minute before it even starts to generate something.
ollama is smart enough to use two gpus simultaneously, so for that 40GB LLM you really have to use two gpus with 24GB vram each, once you get over gpu vram capacity, things go into ram and though cpu which is terribly slow - at such point Apple Silicon Macs have advantage of utilizing shared ram, so something like 64GB Mac Studio "outperforms" and PC with lack of gpu vram
Also ISTA-DASlab (on huggingface) managed to squeeze original Llama 70B 140Gb model into 22Gb remaining 90+% quality ratio, so it can run on one 3090 card. 8B model they've made possible to run on smartphones.
running "ollama ps" will show you how much of the model is loaded on system ram vs GPU ram. You want 2x4090s for enough VRAM to run a 70b at a good speed.
@@AZisk You are confusing it with the older RTX A6000 of the previous generation. I got the Ada one and it was nearly 8k€ on a good day.... so my car has to somehow surive for some years more now. :-|
I've got a 1080 ti from 2017, and a PC I built in 2016 overclocked to almost 5Ghz, 6 cores 12 threads, with 64 GB Ram I am currently running Llama 3.2 7B models lightning fast with my PC
Thanks for the demo. Now i understand how the llm work, especially the part where it consume power and how it consume the memory. With this info, i can manage the usage properly.
If you want to run larger model's on that card look for a Mixture of Experts model, otherwise stick with models smaller than 10-12gb in size, especially if you choose one that has a large context length. I recently sold my 4090 to help finance a second A6000, I can get Llama 70 q8 models to run with a 98k context length but only just barely. That eats up about 56gb of vRAM the rest goes to the context window weights and all sorts of other stuff.
Come on Alex, the fact that you bought a 4090 and don't have a home built PC is crazy lol. Bring that in as your next project Mr. Laptop / Mini PC guy 😂
Thx for the content. But as you pointed out, as long as consumers CUDA video card will be limited to 24 go, speed don't matter if you are that limited in model size.
You can see additional stats on model performance like tokens per second by using the --verbose flag with Ollama run. So Ollama run llama3.1 --verbose. Love the videos!
The white video cards are usually purchased by people building a "snow blind" PC - white case, white video card, white power supply, white cables, etc. These white video cards can be difficult to source and during periods of short supply they command a premium price with no other benefit than matching the color of the build. Larger LLMs yield very poor performance when spilling over from the maximum RAM of the nVidia RTX 4090 into the 128 Gb RAM in my tower PC. I get much better performance running up to 70 billion parameter LLMs on my MacBook Pro M3 Max. This is why I will be purchasing a Mac Studio M4 Ultra with maximum RAM installed when it is available.
11:00 Ollama has this feature (?) that makes it so that when you exceed a certain percentage the GPU vRAM, it meets the rest of its requirements from the system memory and CPU. That is why it is significantly slower. But it makes sure that you get an output unlike others that net you an OutOfMemoryError.
My best guess about the gpu spikes: the whole LLM does not fit into the vram. And this means the gpu has to load new parts into vram. 13B models run fine on GPU but beyond that it’s CPU+GPU
Ollama on linux is even more performant. If the model is too large to fit on the vram it will normally "overflow" to the system memory but still use the gpu, normally you would get arround 30% gpu utilization depending on the "ratio" of vram usage vs system memory. I like this sort of videos please go deeper into this. This is out of experience and I did not search in this in the documentation as it just worked like I wanted it too.
Wow Alex, that's surprising! Even the RTX 4090 seems to struggle, but as someone suggested in the comments, try updating your Nvidia drivers to see if it helps. I ran the same model on an AMD graphics card, and most of the time, it defaults to the CPU, with 0% GPU utilization. Since AMD lacks CUDA cores, I assumed that's why it ignores the GPU. Seeing this happen with your Nvidia card makes me wonder if we can force GPU usage. However, running models locally on our PCs doesn’t seem practical right now, as online models often deliver better results. Local setups might still be useful for generating small code snippets, though.
Of course it just work.. oculink is just pcie over a cable. That's why it's not hot swappable. So it work just as easily than plugging a gpu in a regular pc, with the bandwidth limitation.
Thunderbolt 5, announced by Intel, brings significant improvements over Thunderbolt 4. It supports data transfer speeds of up to 80 Gbps, which can double to 120 Gbps in certain configurations (using a feature called “Bandwidth Boost” for high-bandwidth applications like displays). Key improvements in Thunderbolt 5 include: • Increased Bandwidth: Standard 80 Gbps, with the ability to dynamically boost up to 120 Gbps. • Display Support: Enhanced support for multiple high-resolution displays, including up to 3 x 4K displays or 2 x 8K displays. • Expanded PCIe Bandwidth: 3x the PCIe data bandwidth of Thunderbolt 4, enabling faster external storage and support for high-performance peripherals like GPUs. • Backward Compatibility: It remains backward compatible with Thunderbolt 4, Thunderbolt 3, USB4, and USB3. Thunderbolt 5 is expected to appear in devices starting in 2024.
@@f.iph7291 before you open your mouth please fist research what you are talking about, the only thing in the 4090 that runs close to that band width is the memory at 1008 GB/s. It has nothing to do with thunderbolt 5.
From a computer engineering background I’m 200% sure that your spikes comes from the bottlenecking of the GPU, basically it only gets the load for some milliseconds, then it is waiting for the data transfer in the pipeline, and keep looping in that, you are only using 63Gbps/ 1008GBps transfer rate
@@MultiMojo As they say in the boat business, isn't that 63Gbps "a hole below the waterline?" If Oculink still is the limited factor, why have such a beefy GPU if you can't integrate it for full effect?
Actually LLM inference doesn't need too much power. Just limit GPU max power with nvidia-smi or afterburner to ~250w per GPU and be happy. It's has very very low impact on tokens / sec.
Yepp, that is why I saved my money and only got a 3060 12GB GPU. I still get about half of the speed of the top cards and most models are 8B. Next step is usually too much for 24GB anyways. Better to save money for now and buy something in a few years when VRAM probably is a lot cheaper or more specialised cards gets released.
"Next step is usually too much for 24GB" Sorry but no, you CAN put those 24GB to good use, you just have to use quantized models. You can squeeze every bit of performance from a 3090 or 4090 by finding models that are around 20 GB, leaving some headroom for the rest of the OS/UI and your context window.
@@reezlaw With that logic, I can use a quantized model to fit in 12GB too. 70B models quantized down to under 24GB will simply not perform well, so it's useless in my opinion. The prices for such cards are simply insane, unless you are lucky with a used one.
The issue that you see with over 24gb is not because it’s running on the CPU. It’s because ollama uses your RAM as a buffer for the vram. Only your ram is at best 55GBps while Vram in that 4090 is probably 650GBps. Add to that your using the oculink symmetrically- i’m assuming you have around 20GBps each way? (Dunno the oculink standard) Also note you are changing the latency by magnitudes. From ns to just under miliseconds (due to distance, several standards translation etc) and in a case of a huge matrix made of very small chunks of dara, that the algorithm needs constant access to it’s entirety.. So your left with a processor moving around lots of data but can’t keep feeding the parallel units of the g card.
llama.cpp and everything based on it can offload layer of the model to system memory. Meaning you can run larger model at a huge performance penalty. Strong rec for LMStudio!!!
It would be interesting to see how this compares to full size PC with a 4090. I am starting to build a system around a 4090 tomorrow. I went the more traditional route with a full size case, i9-13900, Asus Tuff Gaming MB, Corsair 1200 PS, 64GB, etc. Something smaller might be nice so I am watching closely.
I have a laptop with TB4 and a watercooled egpu with a 3090 in it. It works perfectly as i always offload the llm to my vram anyway. With TB5 starting to show Oculink will need an oculink v2 to compete :)
Hey, could you make a video about Snapdragon processors and the compatibility issues developers face, especially for college students working on projects? It would be really helpful to understand how to optimize for Snapdragon chipsets and address common challenges
I prefer another mini PC also from Minis Forum, the GTi4 Mini PC with EX Docking, which includes a 600W power supply. The mini PC can work independently or be plugged into the EX Docking to use a 4090 graphics card. It looks much cleaner since there are no extra cables.
If you use LM Studio, you can fill the GPU with most of the layers, and put the final layers on CPU, you will very fast responses with a minor hit on performance, I am not sure if you can do this in Ollama though
This whole bandwidth argument is a bit of a strawman when looking purely at inference. It plays a gigantic role in training, where you'll actually bottleneck trying to move data from disk to RAM, from ram to VRAM and back. But for inference, you're moving kilobytes per second at most. The only thing that's affected by bandwidth is the loading speed of the model. Once that's in VRAM, how much data are you gonna move - 32k tokens worth of context.
To clarify, it should only be bandwidth between GPU and PC that's not a very big deal, right? Memory bandwidth, conversely, is probably the most important factor in speed, I believe. Just don't want anyone who's even newer to this stuff than I am to get confused
Jep. But only when the model fits completely into the VRAM and doesn‘t need swap paging 😅. Which it needs for slightly bigger models 11:15 since the 4090 has only 20% of the vram of my MacBook 😂 without triggering a UPS 8:36
Highly recommend you use exl2 instead of GGUF quantization. It only works on actual GPUs and not CPU-only systems like the Mac, so it's lesser known, but it's much faster than GGUF.
Amazing vid and helpful to understand how to set up our private computing. The 4090 is limited by VRAM, as you demonstrated. Why not attempt this with an A6000 (48MB VRAM) model? The A6000 is optimized for AI performance, whereas the 4090 is optimized for gaming and 3D rendering. Thoughts?
sure there are better gpus for AI, but i would say they are a bit out of the budget of most consumers. even the 4090 is at the top end of what the consumer market can bear.
"I was expecting a lot more noise from the 4090 to be honest. It's not that loud." Maybe that's because there's literally 0% load on the GPU? Who knows.
at 9:56, the Cudaz Device to Host is fluctuating, its relative to the spikes at 10:07 means gpu is sending something large data to the system causing cuda-z showing slower available bandwidth,
Ollama can offload model layers to the GPU I guess.. In other applications like ooba-text-gen or LMStudio you can actually specify how many layers you want to offload to the GPU. Rest of the model will run on your CPU. The speed gains are noticeable when you have at-least 50% of the layers offloaded. But with 24GB and 70b models it wont be 50%.
I'm not sure why you chose a mini-computer and occulink, when you could have used an itx mb with full 16 lane PCIe5 capabilities? It's not smaller, or more convenient or efficient just doesn't make a lot of sense.
Most (or all?) LLM workloads are memory-bounded (meaning the read speed of the GPU memory is the bottleneck). If you try quantized models, the GPU usage should improve to not just spike (quantized weights mean less memory needs to be read, and the workload can get more on the processing-bounded side).
For a moment near the beginning of the video I was thinking you found a way to run a GPU on a Mac. I do have one quick question, if you are running a Linux box, can you use more than one GPU to increase the amount of RAM?
I'd be willing to watch a deep-dive on why OCulink is better than USB 80Gbps (USB4 v2.0) or Thunderbolt 5... I think there is still a big bottleneck for a 4090 using OCulink.
One of the things I love about hardware is there is zero need for instructions "Does this fit in there? It does. Well that's where it's supposed to go!". Brilliant. I laughed out loud when the UPS kicked in.
If you are running a GGUF model, ollama will split the process, putting as many layers as it can on GPU and the rest on CPU. IT will run slower, but faster than CPU only.
👍
@@paulhorn24 yeah I think a 4090 paradoxically is not as good choice as let's say gpu with no graphical capabilities but way more vram right?
Mini PCs have revolutionized the boring PC market. The power they are able to squeeze inside these small boxes gives me hope for the future of computing.
While I agree that they are cool, they kind of become pointless once you add one of these giant eGPUs. You could build a mini itx pc instead and avoid the occulink restrictions while also gaining the increased upgradability of a full desktop.
@@kroeken but you cant over clock your cpu
@@rochester3 huh? Yes you can. A proper ITX or mATX build is better in every way to these mini PCs with external GPUs.
Mini PCs are (for the most part) just laptop bowels transplanted in a little box.
They have use cases, for sure (hospitals, HTPCs, schools, small clients, emulation boxes, offices) but as soon as you ramp up the performances the prices and drawbacks (mainly thermals) go up quickly too, at the point where it's better to stick to a custom build solution unless you REALLY need the small form factor.
I admit that the mainstream pc market of today is VERY boring though, it peaked just around pre-covid and stayed there (I'm still using my ryzen 3600 + 6700 xt and I don't feel the need to upgrade to PCIx 5, while I bleeded money into my home server instead).
@@TheRaretunes true. But i hope the tech gets better and better for them. I find pc cases to be really ugly. Didn’t mind them back in the day but those aren’t best for airflow. Talking about airflow, just how much air do you need. I like small itx cases a lot more and surprisingly, they show that you don’t really need that much space for airflow and good temps. “Building computers” is also an overhyped genre. It’s really not all that it’s cracked up to be.
Chinese modders transplanted a chip from RTX 4090D to a custom board or a 3090 board and soldered 48 GB of memory. Real beast for AI rig. However, I'm not sure about the warranty for such Frankenstein card.
It's honestly sad at this point neither nvidia, Intel or amd have come out with a $700 card that just has 48gb vram and a $900 model with 128GB. The memory is cheap as nvidia just wants to squeeze you to spend $2000 on 4090.
With Ai now I think at least just 1x consumer model would be good from someone. I mean, you'd sell at least 2m units.
@@Larimussas far as I know nvidia has monopoly over AI due to their CUDA technology.
Until amd or intel isn't capable of competing with nvidia in this space, there wouldn't be any card with such memory.
@cena777248 yeh they do for now. Intel has already created some inference with their tech I beleive. And since CPU models exist I'm sure if amd made a cheap 48gb vram card the internet will figure out how to convert models or whatever it is. I'm pretty sure you can run some models with amd too? Just much less support where nvidia just runs everything right now and most optimally I think.
@@Larimuss Agreed. Everyone wants more vram, not more speed. But monopolists do monopoly stuff.
@@Larimuss it’s not good business for the average consumer to have access to good, fast, general-purpose local AI. We’d pay, what, maybe $600 more for that at an enthusiast level, less for the average consumer. But as long as AI remains the domain of big cloud companies and startups backed by VCs with deep pockets, people will keep flocking to them for this seemingly exclusive godlike power, and they will keep paying enterprise money to Nvidia.
Some points here Alex:
1. The power cable that's split into three power plugs is a "dongle" that converts the 12V HPWR plug that's too recent for most power supplies out there, so they supply a splitter that is powered by 3 or 4 of the 8 pin PCI-E connectors.
2. The drivers for your GPU are provided by Nvidia themselves (just Google game ready drivers for RTX 4090), as the AIB drivers (Gigabyte's) are outdated.
3. All modern GPUs (from 2010 onwards) are all set to have zero fan revs at sub 60° C.
point 3 is not right.
@@R1L1. You're talking about exceptions to the rule, I only recall the Vega VII that had it's fans running all the time because it ran hot as the sun. Apart from that point 3 is the rule.
@@blackhorseteck8381 that doesn't change the fact that you are wrong, you could have just said most modern GPUs not all GPUs . Even then my rx6500xt always keeps the fans on, same with my 3060, didn't change anything after buying so yeah... Idk.
@@R1L1. my 970 also has always on fans
@@R1L1. are you using 2 monitors?
small advice regarding ollama:
use verbose
example: ollama run llama3.1:8b --verbose
technically these commands, including what you ran, keeps the model loaded. You have to manually unload it, or you can tell the model to unload after you go /bye:
ollama run llama3.1:8b --verbose --keepalive 10s
the verbose will tell you the tokens per second generated.
the keepalive 10s will drop the model from memory after 10s
@@serikazero128 or if you already "inside" Ollama type /set verbose
👍
@@Lemure_Noah👍
Serious question: why not just use the power directly if you're UPS isn't big enough? This isn't a mission critical server with important information, it doesn't need 24/7 operation during a power outage.
Haven't seen anyone do a video using multiple video cards in parallel to run a large model. So that is my humble request. Love the content.
👍
10:10 The GPU spikes while running Ollama could be due to
Batch processing: The AI might be processing data in phases, causing short bursts of high GPU usage.
Resource optimization: The GPU is only used for certain tasks, leading to inconsistent usage.
Power management: The GPU adjusts its power consumption based on demand, resulting in spikes.
could it be limiting by the drivers? I've read something about the drivers limiting the cards for uses other than gaming.
@@dontblinknerd Windows automatically install the latest version of Nvidia drivers, otherwise it would not detect the RTX 4090 but the Microsoft video card.
The UPS going off was hilarious! 😂
I thought it was mine for a sec 😅
I think you meant 40Gigabits/s for Thunderbolt 4 - instead of gigabytes.
I experienced the same VRAM problems. I have a i9-32 thread and 128GB system RAM and runs the large models in slow motion but works. Small models run fast enough to use on the i9, but if it fits the gpu 16GB its really fast and enough to use as a service for a few clients. I'm using 4090 mobile=4080 desktop. Large models, these days, seems the Mac unified ram is the way to go for running large models but slower, but at least it runs and the wait is not too long.
I'm not convinced about the Mac's unified RAM. What all these Mac youtubers don't show you is the impact of larger prompts. While you may be fine with 5tokens/s, it's gonna suck if you have to wait a minute before it even starts to generate something.
ollama is smart enough to use two gpus simultaneously, so for that 40GB LLM you really have to use two gpus with 24GB vram each,
once you get over gpu vram capacity, things go into ram and though cpu which is terribly slow - at such point Apple Silicon Macs have advantage of utilizing shared ram, so something like 64GB Mac Studio "outperforms" and PC with lack of gpu vram
Also ISTA-DASlab (on huggingface) managed to squeeze original Llama 70B 140Gb model into 22Gb remaining 90+% quality ratio, so it can run on one 3090 card. 8B model they've made possible to run on smartphones.
I can’t understand why I find unboxing all this stuff was so interesting.
Me too, I’m addicted to these videos 😅
Yo your surge protector gonna explode. Haha.
The GPU spike is normal. It's likely just the model going back and forth.
Beeeeeeep!!!
i love this man, never bored watching
running "ollama ps" will show you how much of the model is loaded on system ram vs GPU ram. You want 2x4090s for enough VRAM to run a 70b at a good speed.
2 used 3090s would do a more than decent job for a fraction of the price
@@reezlaw but it wont be a mini PC anymore
@@soumyajitganguly2593 indeed
Well there is always the RTX 6000 Ada that is essentially a 4090 with 48GB VRAM but it costs around 10.000 USD I believe 😅
only $5000 😝
@@AZisk The Ada is $7200 at the cheapest. Where are you finding it for $5k? Or are you mixing it up with the previous gen RTX A6000?
@@samizdat_eth the previous gen A6000 is not that bad.. it's a 3090 with 48GB and you can get it for ~4k.
@@AZisk You are confusing it with the older RTX A6000 of the previous generation. I got the Ada one and it was nearly 8k€ on a good day.... so my car has to somehow surive for some years more now. :-|
I've got a 1080 ti from 2017, and a PC I built in 2016 overclocked to almost 5Ghz, 6 cores 12 threads, with 64 GB Ram
I am currently running Llama 3.2 7B models lightning fast with my PC
Thanks for the demo. Now i understand how the llm work, especially the part where it consume power and how it consume the memory. With this info, i can manage the usage properly.
If you want to run larger model's on that card look for a Mixture of Experts model, otherwise stick with models smaller than 10-12gb in size, especially if you choose one that has a large context length. I recently sold my 4090 to help finance a second A6000, I can get Llama 70 q8 models to run with a 98k context length but only just barely. That eats up about 56gb of vRAM the rest goes to the context window weights and all sorts of other stuff.
This was a crazy video!! One of your best!!!
Glad you liked it!!
Come on Alex, the fact that you bought a 4090 and don't have a home built PC is crazy lol. Bring that in as your next project Mr. Laptop / Mini PC guy 😂
idk man, i just don’t want a big box standing around heating up the place.
@@AZisk don't worry the new 4090 will do that itself haha. Great video!
@@purian23My 4080 is a heater already lol
It is nice when the room is cold
Thx for the content.
But as you pointed out, as long as consumers CUDA video card will be limited to 24 go, speed don't matter if you are that limited in model size.
You can see additional stats on model performance like tokens per second by using the --verbose flag with Ollama run.
So Ollama run llama3.1 --verbose.
Love the videos!
This is a great way to benchmark new local LLMs. Just use a common prompt and compare.
Can you list all the ollama commands/flags Thanks
The white video cards are usually purchased by people building a "snow blind" PC - white case, white video card, white power supply, white cables, etc. These white video cards can be difficult to source and during periods of short supply they command a premium price with no other benefit than matching the color of the build.
Larger LLMs yield very poor performance when spilling over from the maximum RAM of the nVidia RTX 4090 into the 128 Gb RAM in my tower PC. I get much better performance running up to 70 billion parameter LLMs on my MacBook Pro M3 Max. This is why I will be purchasing a Mac Studio M4 Ultra with maximum RAM installed when it is available.
11:00 Ollama has this feature (?) that makes it so that when you exceed a certain percentage the GPU vRAM, it meets the rest of its requirements from the system memory and CPU. That is why it is significantly slower. But it makes sure that you get an output unlike others that net you an OutOfMemoryError.
Isn’t it a llama.cpp port to go?
@@anuragshas Ollama is built based on llama.cpp, but everything about Ollama is automatically handled (in this case the CPU/GPU allocation).
My best guess about the gpu spikes: the whole LLM does not fit into the vram. And this means the gpu has to load new parts into vram. 13B models run fine on GPU but beyond that it’s CPU+GPU
I have a 3090 with 24GB and yes you can run 13b. Nice setup
11:15 It automatically offloads some layers of the llm to the system RAM so it uses both gpu and cpu
Check ollama logs, there you will see a "xx/yy layers ofloaded to GPU".
Ollama on linux is even more performant. If the model is too large to fit on the vram it will normally "overflow" to the system memory but still use the gpu, normally you would get arround 30% gpu utilization depending on the "ratio" of vram usage vs system memory. I like this sort of videos please go deeper into this. This is out of experience and I did not search in this in the documentation as it just worked like I wanted it too.
Wow Alex, that's surprising! Even the RTX 4090 seems to struggle, but as someone suggested in the comments, try updating your Nvidia drivers to see if it helps. I ran the same model on an AMD graphics card, and most of the time, it defaults to the CPU, with 0% GPU utilization. Since AMD lacks CUDA cores, I assumed that's why it ignores the GPU. Seeing this happen with your Nvidia card makes me wonder if we can force GPU usage.
However, running models locally on our PCs doesn’t seem practical right now, as online models often deliver better results. Local setups might still be useful for generating small code snippets, though.
You should have bought a AMD Radeon™ PRO W7900 Dual Slot, which has 48 GB of GDDR6.
LM Studio can split the model between CPU and GPU. You can tweak the split between them in the UI. Try that.
Ollama does this automatically as well. If you look at the task manager while the 70b model is running, the vram is filled up.
seasonic is definitely an amazing power supply. ive used them for all of my builds
Of course it just work.. oculink is just pcie over a cable. That's why it's not hot swappable. So it work just as easily than plugging a gpu in a regular pc, with the bandwidth limitation.
Yes, it will run on whatever has enough memory to run into. 4090's are extremely good for Stable Diffusion, but not for big LLMs.
NOWAY he installing nvidia drivers from GIGABYTE
Thunderbolt 5, announced by Intel, brings significant improvements over Thunderbolt 4. It supports data transfer speeds of up to 80 Gbps, which can double to 120 Gbps in certain configurations (using a feature called “Bandwidth Boost” for high-bandwidth applications like displays). Key improvements in Thunderbolt 5 include:
• Increased Bandwidth: Standard 80 Gbps, with the ability to dynamically boost up to 120 Gbps.
• Display Support: Enhanced support for multiple high-resolution displays, including up to 3 x 4K displays or 2 x 8K displays.
• Expanded PCIe Bandwidth: 3x the PCIe data bandwidth of Thunderbolt 4, enabling faster external storage and support for high-performance peripherals like GPUs.
• Backward Compatibility: It remains backward compatible with Thunderbolt 4, Thunderbolt 3, USB4, and USB3.
Thunderbolt 5 is expected to appear in devices starting in 2024.
this is clearly AI and doesn't know wtf is TB5
Lmao. Even then the bandwidth is much lower than the 4090 which is arounf 1tb/s
@@johnpp21 „Clearly“, and thats why?
@@f.iph7291 Yeah, but faster than Oculink
@@f.iph7291 before you open your mouth please fist research what you are talking about, the only thing in the 4090 that runs close to that band width is the memory at 1008 GB/s. It has nothing to do with thunderbolt 5.
From a computer engineering background I’m 200% sure that your spikes comes from the bottlenecking of the GPU, basically it only gets the load for some milliseconds, then it is waiting for the data transfer in the pipeline, and keep looping in that, you are only using 63Gbps/ 1008GBps transfer rate
Oculink is limited to 63Gbps transfer rate
@@MultiMojo As they say in the boat business, isn't that 63Gbps "a hole below the waterline?" If Oculink still is the limited factor, why have such a beefy GPU if you can't integrate it for full effect?
If you went with a 750W PS you have:
- plenty of power
- save $100
- NO alarm bells going off. 😂
i got greedy with power
that ups sound in the perfect moment 🤣.doing a nice job. keep it up
That PSU will work great to go in an entire desktop with the one 4090. Not really enough for 2x 4090s, though. That really needs a 1600W psu.
Actually LLM inference doesn't need too much power. Just limit GPU max power with nvidia-smi or afterburner to ~250w per GPU and be happy.
It's has very very low impact on tokens / sec.
really killing that poor ups
Yepp, that is why I saved my money and only got a 3060 12GB GPU. I still get about half of the speed of the top cards and most models are 8B. Next step is usually too much for 24GB anyways. Better to save money for now and buy something in a few years when VRAM probably is a lot cheaper or more specialised cards gets released.
you can run very big 70B models on your card with 90% quality, like from ISTA-DASlab austrian EU research team on huggingface
"Next step is usually too much for 24GB" Sorry but no, you CAN put those 24GB to good use, you just have to use quantized models. You can squeeze every bit of performance from a 3090 or 4090 by finding models that are around 20 GB, leaving some headroom for the rest of the OS/UI and your context window.
@@reezlaw yes! like ISTA-DASlab on huggingface incredible work with models
@@reezlaw With that logic, I can use a quantized model to fit in 12GB too. 70B models quantized down to under 24GB will simply not perform well, so it's useless in my opinion. The prices for such cards are simply insane, unless you are lucky with a used one.
Loving the LLM testing videos! Now I need a 4090 😁
Definitely need to build something! Awesome video 😍
Just saw the news with thunderbolt 5 able to transfer up to 120 Gbps 😮
The issue that you see with over 24gb is not because it’s running on the CPU. It’s because ollama uses your RAM as a buffer for the vram. Only your ram is at best 55GBps while Vram in that 4090 is probably 650GBps. Add to that your using the oculink symmetrically- i’m assuming you have around 20GBps each way? (Dunno the oculink standard)
Also note you are changing the latency by magnitudes. From ns to just under miliseconds (due to distance, several standards translation etc) and in a case of a huge matrix made of very small chunks of dara, that the algorithm needs constant access to it’s entirety..
So your left with a processor moving around lots of data but can’t keep feeding the parallel units of the g card.
this is so cool, thanks for showing us
Thanks for watching!
llama.cpp and everything based on it can offload layer of the model to system memory. Meaning you can run larger model at a huge performance penalty. Strong rec for LMStudio!!!
Would love to see you do fine-tuning and inference tests on a 16" 2019 MacBook Pro with an eGPU.
My Mac heated up by just watching this in 4k lolz
Great video! But, didn't you do something similar before and your macs destroyed NVIDIA?
I did it with the rtx4090 in a laptop
Hi, nice test. Did It works also with a card like A6000 or h100?
Power suppllies often hit peak efficiency around 40-60% loading so thats a justification for 1200w
It would be interesting to see how this compares to full size PC with a 4090. I am starting to build a system around a 4090 tomorrow. I went the more traditional route with a full size case, i9-13900, Asus Tuff Gaming MB, Corsair 1200 PS, 64GB, etc. Something smaller might be nice so I am watching closely.
I have a laptop with TB4 and a watercooled egpu with a 3090 in it. It works perfectly as i always offload the llm to my vram anyway. With TB5 starting to show Oculink will need an oculink v2 to compete :)
Love your videos
Thanks
Can you explain the downsides of quantizing models?
What are the disadvantages of running a 70B model on a 4090 with increased quantization?
Quantizing lowers the actual resolution of the model, it is less precise, but can still create good results unless quantized to oblivion.
Really cool, wondering if there are dual or Quad GPU solutions
Didn’t realize that was a Kizer; we all have the same hobbies lmfao.
love that knife!
eGPUs are the future, best of all worlds.
Plug it into an oculink laptop though, like a GPD winmax, then you just need 1 machine.
Hey, could you make a video about Snapdragon processors and the compatibility issues developers face, especially for college students working on projects? It would be really helpful to understand how to optimize for Snapdragon chipsets and address common challenges
You should make a video on replacing Copilot with Ollama and Continue!
Exllamav2 is also a similar inferencing engine that should definetly be used if your model can fit on our gpu memory!
I prefer another mini PC also from Minis Forum, the GTi4 Mini PC with EX Docking, which includes a 600W power supply. The mini PC can work independently or be plugged into the EX Docking to use a 4090 graphics card. It looks much cleaner since there are no extra cables.
The UA-cam plaque is always crooked Alex
I always get platinum or titanium PSUs cause I love overkill 😁
ORAC. Coming into reality!!!😂
Awesome video can’t watch it with volume up with your ups freaking due to it making my dogs bark they think it’s the fire alarms
My Kizer is ALSO my faverit knife!!
If you use LM Studio, you can fill the GPU with most of the layers, and put the final layers on CPU, you will very fast responses with a minor hit on performance, I am not sure if you can do this in Ollama though
Llama 3.2 3b is fantastic for text summarisation.
This whole bandwidth argument is a bit of a strawman when looking purely at inference. It plays a gigantic role in training, where you'll actually bottleneck trying to move data from disk to RAM, from ram to VRAM and back. But for inference, you're moving kilobytes per second at most. The only thing that's affected by bandwidth is the loading speed of the model. Once that's in VRAM, how much data are you gonna move - 32k tokens worth of context.
To clarify, it should only be bandwidth between GPU and PC that's not a very big deal, right? Memory bandwidth, conversely, is probably the most important factor in speed, I believe.
Just don't want anyone who's even newer to this stuff than I am to get confused
@BaldyMacbeard you are 100% right. For this application any connection will work just fine with the exact same performance.
Jep. But only when the model fits completely into the VRAM and doesn‘t need swap paging 😅. Which it needs for slightly bigger models 11:15 since the 4090 has only 20% of the vram of my MacBook 😂 without triggering a UPS 8:36
So basically we could build AI accelerators with a normal USB C connector to boost private LLMs.
that card looks like an SUV for PC
thank god you god that ATX 3.0 to prevent the meltdown stuff on the 4090
@@zerogravityfallout4228 having an ATX 3.0 PSU doesn’t mean you’re protected against the meltdown unfortunately…
Highly recommend you use exl2 instead of GGUF quantization. It only works on actual GPUs and not CPU-only systems like the Mac, so it's lesser known, but it's much faster than GGUF.
Amazing vid and helpful to understand how to set up our private computing. The 4090 is limited by VRAM, as you demonstrated. Why not attempt this with an A6000 (48MB VRAM) model? The A6000 is optimized for AI performance, whereas the 4090 is optimized for gaming and 3D rendering. Thoughts?
sure there are better gpus for AI, but i would say they are a bit out of the budget of most consumers. even the 4090 is at the top end of what the consumer market can bear.
10:00 a MiB =/= Megabit. 6100 MiB is just under 6GB or 48Gb or 5100 Mb.
USB4 2.0 80Gbps transfer speed should be pretty sweet when it lands.
"I was expecting a lot more noise from the 4090 to be honest. It's not that loud." Maybe that's because there's literally 0% load on the GPU? Who knows.
literally?
@@AZisk And figuratively.
at 9:56, the Cudaz Device to Host is fluctuating, its relative to the spikes at 10:07
means gpu is sending something large data to the system causing cuda-z showing slower available bandwidth,
Ollama can offload model layers to the GPU I guess.. In other applications like ooba-text-gen or LMStudio you can actually specify how many layers you want to offload to the GPU. Rest of the model will run on your CPU. The speed gains are noticeable when you have at-least 50% of the layers offloaded. But with 24GB and 70b models it wont be 50%.
Which monitor are you using?
I'm not sure why you chose a mini-computer and occulink, when you could have used an itx mb with full 16 lane PCIe5 capabilities? It's not smaller, or more convenient or efficient just doesn't make a lot of sense.
Hey, Alex, let's try to connect this eGPU to your Mac!
Need to know how M4 max compares to a proper 4090!
I use a 4070ti, a 1080ti, a 1060 6g, and a 5700xt.
Works fine. if i pay that much for anything its going to be a new threadripper first.
Most (or all?) LLM workloads are memory-bounded (meaning the read speed of the GPU memory is the bottleneck). If you try quantized models, the GPU usage should improve to not just spike (quantized weights mean less memory needs to be read, and the workload can get more on the processing-bounded side).
Change the any one of the Graphical View in Cuda Garaph on Task manager to see the Cuda performance in specific.
WOW. How much did this cost? I’m sensing an Amex Black Card in the vicinity.
🤣 the dock was only $99
interesting keep 'em coming. I'm working on these too..
woah that's sick
How would you feel about doing some fine-tuning? Maybe your fastest Mac Studio vs. This thing?
Wow, cool video, Thank You 👍
For a moment near the beginning of the video I was thinking you found a way to run a GPU on a Mac.
I do have one quick question, if you are running a Linux box, can you use more than one GPU to increase the amount of RAM?
I'd be willing to watch a deep-dive on why OCulink is better than USB 80Gbps (USB4 v2.0) or Thunderbolt 5...
I think there is still a big bottleneck for a 4090 using OCulink.
One of the things I love about hardware is there is zero need for instructions "Does this fit in there? It does. Well that's where it's supposed to go!". Brilliant.
I laughed out loud when the UPS kicked in.
27b Q4 model fits into 16gb GPU, so you actually can try quite big q4 and q3 models.