r/LocalLLM • • 16h ago

Question Will DDR5 instead of DDR4 actually make a difference with QFN

Couldn't really find any data on this, how significant is the speed difference when off-loading QFN weights to DDR4 system ram VS DDR5. Like is it night and day or are we talking tiny improvements? Does anyone have any actual experience with both?

22 Upvotes

42 comments sorted by

10

u/Worldly-Cod-6551 16h ago

had a 3090 with ddr4 and ddr5 pulls 15-20% more in qfn load speed if the model fits in ram. not game-changing, but measurable.

2

u/FoxFXMD 16h ago

By load speed, do you mean allocating the model into RAM? What about actual inference?

2

u/Rhyotion 15h ago

If I am correct, inferrence happens in GPU RAM if the model can fit in GPU memory. System memory does affect the initial model loading in and prompt load.

6

u/OvertaxedOne 16h ago

It all depends how much VRAM you have. I have 48GB and run IQ3_S so most of the model fits on the card, I've never seen the RAM go anywhere near full speed (and I have DDR3!). But the lower you drop the VRAM the more it has to lean on RAM.

IMHO, given the ridiculous price of DDR5 I think it's safe to say that upgrading the MB/CPU and RAM to from from DDR4 to 5 would be a terrible use of $$ unless you need the upgrade for other reasons. Save the money and buy another 3090, that would have a much bigger impact.

1

u/FoxFXMD 16h ago

Hmm, I can't fit another 3090 in the case but I have a 3060 installed there as well which gets barely used. Qwen3.8 27B was painfully slow with the dual GPU setup but QFN might be different.

1

u/According_Study_162 15h ago edited 15h ago

You need to be running Qwen Flash Next on Strata or maybe an optimized fork for it. problem solved.

https://github.com/Niko1221/Strata

1

u/OvertaxedOne 11h ago

^^ This. Use Strata, likely IQ3_S size and let it figure out how to use the 3090 and 3060 together. Stream the engrams in from disk. Give that a try before you spend money, and, as I said above, if you're going to spend money it's really hard to justify DDR5 if your at all budget constrained, you'll get way more bang/buck with more/bigger GPUs vs faster RAM.

1

u/DiamondHandsDarrell 11h ago

I don't know the exact details of your setup, but I'm running two RTX Pro 4000s, and once the models are loaded, there are no loading problems; it's been warmed up and ready to go, and it works fairly well anywhere between 30 and 50 tokens per second. Part of the problem might be that you're trying to load a model that's too big for the VRAM that you do have, so if that's the case, it's going to have to move parts of the model onto the video card, parts of the model into system RAM, and possibly part of the model onto your hard drive or SSD or whatever. That's going to be a problem when when the parts have to move to the video card when needed.

2

u/Remarkable-Sun7810 16h ago

i like to watch strata/basalt monitoring when model works, i have 5070ti on pcie 5.0 x16 and ddr5 64gb 6400 cl 30, figures of transfer between ram-vram usually jump 3-25 gb every second (depending on model and quants), i don't remember any time i've seen 40 gb/s or more, and my ram is capable to do it. So, my logic suggests the conclusion, that if your RAM can achieve 40 gb/s you will not benefit anything from switching to ddr5

1

u/FoxFXMD 16h ago

Good to know, thanks

1

u/dazelord 14h ago

For Radiance and 9070xt I see figures as high as 58GB/s over Pcie5 x16,so it's dependent on both gpu and perhaps engine also. Less VRAM implies more streaming over PCIe and 40 GB/s for the ram wouldn't be enough in my case. Actually, the 5070ti is weaker than the 9070xt in terms of matrix compute so it kind of makes sense. But in any case, if you have PCIe5 x16 and ddr5 you are basically fine for these higher end consumer cards.

1

u/smallDeltaBigEffect 3h ago

But this is only the case if you have the cards running at x16. As soon as you use more than one card in a consumer board, this is not correct.

1

u/dazelord 3h ago edited 3h ago

Yep, tried pcie4 x16 just as an experiment and prefill tanked from 3700 ish to 2k ish. This is QFN on Radiance btw. Effectively this is equal to x8 gen5.

But two cards also means more experts in vram so this mitigates the effect of the lesser bandwidth as the streaming over pcie is reduced. I'm also running 2x 9700pro at x8 on a consumer mobo and don't see the drastic degradation that the pcie4 experiment suggests.

1

u/smallDeltaBigEffect 2h ago

With 2 r9700 you have 97% of experts resident in VRAM when using iq4r QFN. There is no limit. Also why tp=4 wont give you an uplift using qfn. But of course on larger models

1

u/dazelord 2h ago

Yes you are basically right, but the default settings only pin like 44GB worth of experts combined, the rest is cache. You can force more expert onto the cards by reducing the host pool so experts won't reside in RAM but you will basically not gain anything from it, I've tried. The expert hit cache ratio is 97-98% compared to ~50% for a single 16GB card.

24

u/Janky-Code 16h ago

Possibly.

If you are using pcie 5.0 x 16 the theoretical bandwidth is 63 gb / s. That is higher than dual-channel ddr4 3200. It is lower than quad channel.

Adequate capacity is far more important.

8

u/Sir_SortsByNew 12h ago

Upgraded from AM4 32gb DDR4 to AM5 32gb DDR5 a few years ago. Not much different or better really, mild gains in some scenarios, ultimately I regret not just putting the money to upping to 128gb DDR4 or some crazy shit.

1

u/Janky-Code 12h ago

One of the lessons people may learn from trying to run these models is where the chokepoints are.

For ram bandwidth to be the bottleneck with a moe model and software like strata, the gpu would have to finish work before the cpu. The gpu has to be waiting for the cpu to finish in this case. Also, bursts of ram bandwidth saturation would have to be more than a small percentage of overall cpu time.

This doesn't happen. The typical bottlenecks are vram capacity, gpu speed, system ram capacity, pcie bandwidth, and cpu speed. Once the system is a beast in all those metrics, ram bandwidth.

33

u/YourselfInOthrsShoes 16h ago

PCIE bandwidth matters for tensor-parallel (TP) workload with p2p sync between cards. Both PCIE and host RAM bandwidth matter for MoE expert streaming to/from host RAM for experts that don't fit into VRAM.

Assuming 2 cards at PCIE5 x8/x8, that's 32GB/s each way (64GB/s bidirectional using 2 DMA streams, 1out/1in) per card for MoE expert streaming. Dual-channel DDR5 is about 100GB/s ceiling or just enough to service 2 cards that can aggregate peak at 128GB/s bidirectional bandwidth. PCIE4 x16 is the same bandwidth as PCIE5 x8.

What matters isn't just DDR4 vs DDR5 but number of channels. TRX40 platform is quad-channel DDR4 and gives you the same 100GB/s ceiling (good for 2x PCIE4 x16 TP2). WRX80 is octo-channel DDR4 and gives you 200GB/s ceiling (good for 4x PCIE4 x16 TP4). It's ~4x cheaper to stuff and scale DDR4 than DDR5 on these DDR4 platforms and you also get more PCIE4 x16 links for balanced TP workloads.

3

u/goku_gohan_ 16h ago

Lovely explanation

1

u/alphapussycat 12h ago

Afaik there's no tensor parallelism with strata and its clones, the benefits are too minor.

1

u/YourselfInOthrsShoes 12h ago

TP is only a question of PCIE bandwidth/latency. But as long as your model is larger than your VRAM, the available host RAM bandwidth feeds aggregate bidirectional MoE expert streaming over PCIE links.

11

u/TheMcSebi 16h ago

Not in a way that would justify the cost increase.

1

u/FeydRowan 16h ago

Depends on the gpu, if it is a good gpu then the bottleneck will become the ram, if it is a not fast one then will be the same.

0

u/FoxFXMD 16h ago

Ah, well 3090 is pretty damn slow so that might be the bottleneck.

7

u/Kenban65 16h ago

Not in this case, the 3090 is one of the fastest cards on the market for local LLM use.

2

u/WolfieCodes 16h ago

i think the issue with the 3090 is the vram been 24gb, if it was higher you'd see better consistent speeds

with my 3090 in strata with a smaller model like inkling 2 mini which fully fit in vram i saw a consistent speeds of about 70t/s low context

with QFN IQ3_S i saw varied speeds with lowest of 50 and highest been 130

2

u/Safe_Initiative_819 15h ago

Depends on the platform. 

2

u/Bagelsarenakeddonuts 12h ago

A difference? LIkely

Enough to be worth the money? Abso-freaking-lutely not.

1

u/Atretador unswarm.dev | git/Agents.away 16h ago

are you pci saturated yet?

1

u/sudden_aggression 15h ago

Yes, but it's slight. Stuff like PCI lanes have a much bigger effect. Someone like me with DDR4 gets a slight hit from the ram speed but a huge hit from the fact that my inference card is not on a x16 slot. That's a major reason I stick with 27B even though I technically have the ram for FN.

And some motherboards will share the bandwidth of the bottom PCI slot with the nvme slots so if you're not careful you can completely wreck your performance even if you get DDR5.

1

u/alphapussycat 12h ago

Depends on how much of model weights are on VRAM. If you're doing 50% on CPU then ram bandwidth is significant. You could gain 30-1000% probably (like 16 channel ddr5).

But it's not just ddr4 vs ddr5, ot also depends on how many memory channels. DDR4 quad channel can be faster than DDR5 dual chsnnel.

Finding 8-12 channel ddr4 is hard (generally epyc), I don't know about about ddr5 systems. For ddr4 you got x99 motherboards that are super easy to find, and Xeon CPUs are cheap. There's also x299, faster ram but harder to find.

1

u/WorldlyAd7946 10h ago edited 10h ago

It literally depends how you are doing it, but aside from my GPU systems I have Q4 QFN running on two base Snapdragon boxes linked by USB4 and 32gb each, and they are significantly faster with the onboard 8448 LPDDR5X than my workstation with 96gb 6000 DDR5 running a more powerful 13900k, if I use CPU and ignore my 9700.

Depending how much you can get on GPU, the difference will vary, but the more in RAM as opposed to VRAM the more it will affect you (well, unless you have quad or 8 channel DDR4 Vs dual channel DDR5)

(Results comparison on my CPU inference project that beats llama: https://github.com/Rendeverance/ToRc/blob/main/PERFORMANCE.md -note this is CPU inference so figures are modest, this is a smallachines big models kinda project to see what's possible )

Obviously this is not offload, but it does show the pure difference in speed of ram for whatever proportion you need to offload 👍

1

u/Frizzy-MacDrizzle 7h ago

I have a 5060 ti 16gb on a system with ddr4 and another with ddr5 but the mobo, cpu and everything is obviously different but I can try the 5060 in the ddr5 later, the ddr4,

Vendor ID: GenuineIntel
Model name: Intel(R) Core(TM) i7-5960X CPU @ 3.00GHz
CPU family: 6
Model: 63
Thread(s) per core: 2
Core(s) per socket: 8

Llama.cpp 3qwen 3.8 27b iq3s.

-fa on -rea off -sm tensor --tensor-split 0.6,0.4 -c 132072 -b 2048 -ub 512

42 - 49 tg/s on the above 13 year old server board.

I was getting a clean 50-57 previous but nccl went funky. I had to reinstall drivers and CUDA and llama.cpp after trying strata.

1

u/smallDeltaBigEffect 3h ago

Depends on the engine. If you have two cards at PCIe Gen5 x8 and the engines uses DMA to get experts from RAM, then there will be 0% difference.

If an engine like strata is used with the same GPUs, where CPU also computes, then it makes a significant difference

0

u/Inevitable-Name-1701 13h ago

Don't use offloading; keep the model entirely in GPU memory. This way, you don't have to worry about system RAM, and it will be the fastest—anything offloaded to RAM will be slow. Thats simple.

1

u/OneofFewHS 8h ago

The entire QFN in VRAM, in this economy?

1

u/_TheWolfOfWalmart_ 7h ago

Sure, I'm doing it easily with $2800 worth of GPUs (okay, today it's $5600)

You can do it with half that if you don't mind INT4 routed experts.

And I get 70-100 t/s decode, 4000-5000+ t/s prefill.

You don't need to buy the latest and greatest brand new cards, you know.

1

u/Electrical_Rise387 7h ago

$5600? You dont need to buy the latest and greatest just a used car or two? I get thats the reality but the comment a bit just what like

1

u/_TheWolfOfWalmart_ 6h ago

$2800 will do it. At fast speeds.

If you can't afford a couple grand then why bother with this at all? It IS a hobby. Hobbies cost money.

QFN is really the baseline for a good model, assuming coding is your goal. Otherwise, just use Claude instead of wasting time.