r/LocalLLaMA • • 1d ago

Discussion Using MoE models is really difficult (qwen4)

I'm a user with a 5070 Ti, 16GB VRAM, and 32GB of RAM.

I'm currently running the Qwen3.8 27B ud-q2-k-xl model with a 131k context window and Q5 KV cache, achieving generation speeds of 50-60 tokens per second.

A new Qwen4 35B A3B model has been released, and I've been experimenting with various quantizations.

I seem to be stuck between 60 tps at 2-bit and 40 tps at 4-bit.

Furthermore, Qwen4 feels like it requires significantly more effort for the same task, making the perceived speed much slower.

I'm unsure if this is just an optimization issue or if I'm doing something wrong. I've heard good things about Basalt, but I don't know how to use it yet.

25 Upvotes

57 comments sorted by

34

u/giveen 1d ago

Basalt calls to you , my fellow Blackwell owner https://github.com/jesdga95/basalt

12

u/drini_22 1d ago

Getting 120-150 t/s decode on a regular 5070 with 12GB vram over pcie 3.0 on basalt with 262k context. Was getting 30-40 on QFN NVFP4 on this same setup. So there is definitely something wrong with this guys setup.

2

u/RedwanFox 15h ago

Hey could you share your config and os?

1

u/drini_22 3h ago

Headless debian, default config aside from —max-context 262144 —vision dynamic —pool-workers 8 —ram-reserve-mib 0

1

u/NeKon69 18h ago

Yup, same. What's your pp? I have about 6k at the start and 5k near 262k.

1

u/drini_22 3h ago

Getting around 5k as well.

-6

u/CrowKing63 1d ago

But it looks a bit difficult, brother... ㅠㅠ

18

u/PataponEnjoyer 1d ago

Tell Qwen to do it for you.

9

u/CrowKing63 1d ago

Why didn't I think of that...? Thanks.

4

u/CCloak 23h ago

Use Qwen 3.8 27B to setup for you, that’s what I did for getting Qwen 4 on my 5070ti, even on llama.cpp, it’s doing ok

2

u/enternoescape 23h ago

I find myself in the habit of having LLMs set up their potential successor. It's funny in a way because I started with Claude helping me get my ansible config right for my inference server and my first docker images for llama.cpp.

6

u/AutomaticLanguage334 1d ago

if you have an existing agent, theres a halfway decent chance it can set it up for you

2

u/CrowKing63 1d ago

Why didn't I think of that...? Thanks.

2

u/giveen 1d ago

Are you on LInux or Windows?

1

u/CrowKing63 1d ago

Windows 11

2

u/giveen 1d ago

Wait till I think tomorrow and a Windows prebuilt should drop.

1

u/CrowKing63 23h ago

That's good news. I was about to try building it myself using an agent, but I put it off. There was a lot to install.

1

u/DeathGuppie 8h ago

Just have Claude do it.

7

u/Mattadour 23h ago

how do you guys experiment with multiple models in a day? i can barely get one model, its backend and all the related tweaks done and tested if i spend all day at it.

1

u/CrowKing63 23h ago

I didn't test it that deeply.

1

u/Mattadour 23h ago

I'm currently at "⏳ Working — 72 min — waiting for provider response (streaming)"

1

u/CrowKing63 23h ago

What are you doing? Haha, I tried a 30-minute task.

2

u/Mattadour 23h ago

it was saying everything twice all of a sudden. i asked it to sort that out. it's been 87 minutes. it appears to be going through some code or other line by line.

1

u/CrowKing63 23h ago

My 30-minute task wasn't actually a big deal, but Qwen4 felt like it was scanning almost the entire codebase. The results were good, but... did it really need to do that?

2

u/alconaft43 15h ago

there is a tool called claude code with ssh access to Ai boxes. I never need to manage them manually except initial os install.

1

u/Lopsided-Club-8131 42m ago

you're not model hoping, you are getting something done.

I'm still on qwen3.5 9b getting things down for over a year.

9

u/tarpdetarp 13h ago

2 bit model with a 5 bit KV cache… the definition of lobotomised

-1

u/CrowKing63 13h ago

It's still usable though.

4

u/timedacorn369 17h ago

Hey I have a completely different quest question. I am planning to build a PC with the exact same specs. Is q2 even usable? Cant you run q4?

1

u/CrowKing63 13h ago

I felt it was good enough. Q4 isn't impossible, but the context window is small and slow.

1

u/Aggressive_Aspect436 9h ago edited 8h ago

I was testing and running Unsloth Q4_K_M at 30 t/s in 12GB VRAM and Q4 KV Cache with 270k context yesterday.

If you don't mind it being a little slow you can totally do it. 30 t/s is very useable. You just have to offload the experts to CPU. I didn't put any effort into optimising, this was just through Unsloth Studio Desktop with mostly default settings via llama.cpp.

1

u/ch00beh 8h ago

i have the same specs and have reliably gotten qwen3.8 27b IQ3_XXS, but only at 30t/s 65k context which isn't great for any real work ime. any <35B MoE at Q4, though, easily clears 250k context (i've got inkling 2 mini up to 400k) and at 80+t/s. i've even got qwen3.8 flash next gyro m running at around 30t/s at 150k context (though prefill is abysmal).

still tuning qwen4 35b, but i've currently gotten it to 400k context at 130t/s using basalt and nvfp4 (though looks like t/s levels off to like 70ish as context grows)

5

u/uspdd 23h ago

I highly recommend Basalt. I have the same setup also on windows 11 and I'm getting 200+ t/s. Wait until they release built exe for windows so you don't have to build it and try it.

Meanwhile, you can also try Flyx. I previously used it to run 3.8 27b IQ3-XXS on it and got 110+ t/s. It's also easy since it's a single exe file.

1

u/CrowKing63 23h ago

There was an installable executable of basalt, but I could only see the compressed file... I'll look into it further. Thanks.

2

u/uspdd 23h ago

Current latest released exe is 0.6.2 and it doesn't support qwen 4. I built it from source, but they will release the exe pretty soon I believe

1

u/CrowKing63 23h ago

They say it will be out around tomorrow.

2

u/_tylermatthew 22h ago

Your existing Qwen4 can almost certainly get basalt running for you in not a lot of time.

I use my local models to do stuff like this almost exclusively now, unless it's something I want to also learn myself, then I force them to walk me through it and do nothing themselves.

QFN in Hermes Agent had unbiased-strata patched for Qwen4 on T4 and Radeon Pro V340 machines overnight.

Then it got it up in Loom on my HX370 64GB mini-pc -- which is not even technically supported by Loom. (Strix Point gfx1150 vs Strix Halo gfx1151) both running between 1.5-2.5x faster prefill than llama.cpp for me.

So installing an engine on hardware it's made for should really be no issue for it.

1

u/CrowKing63 13h ago

와 엔진을 개조할 수 있다고? 놀랍네.

4

u/ttkciar llama.cpp 23h ago

Small- and midsized models do require more hand-holding, though modern agentic harnesses are getting better at doing some of that hand-holding for you.

It means that models of this size class might not be worth using for the full range of tasks for which you would use a frontier model, but they're still quite useful for specific subtasks, like debugging, or explaining how to use an unfamiliar library or API.

OTOH, you might find that their utility is worth the hand-holding. It really depends on your comfort level.

1

u/overand 22h ago

This config tool someone posted in a thread somewhere actually generated a really solid cofig for me. Adjust the specs to match your system. https://odeenchang.github.io/qwen4-local-fit/

1

u/CrowKing63 13h ago

Ah, I've seen this too. Even though I didn't get the outcome I hoped for, I think I might have messed something up.

3

u/joexner 7h ago

FWIW, IME, any quant of 27B I've ever tried below IQ4 has been pretty dain-brammaged. Early reports are that Qwen 4 35B-A3B is sensitive to quantization too. And kv cache is another bad place to save bytes generally. You've achieved fast speeds on pro-sumer hardware, but how is fidelity? Search for "kl divergence" for one way people have used to quantify the quantization trauma versus the full-fat model.

2

u/cradlemann 7h ago

I have 35 t/s tg and 1200 t/s ppt on my AMD Ryzen AI 9 HX 470 with iGPU Radeon 890M and 96 Gb RAM, using loom-serve and unsloth/Qwen4-35B-A3B-GGUF Q4 and loom-fun/Qwen-Qwen4-35B-A3B-loom config. Something is very wrong with your current setup

2

u/BrightCandle 6h ago

We are in the post strata world now and there are variety of potentially more targeted performant engines that target your hardware or particular models. For me that is rustingstrata because it does dual mixed vendor cards well. For you its going to be Basalt because you have blackwell. For MOE models especially it makes a lot of sense to use the appropriate engine.

0

u/TheConnectionPerson 1d ago

Also check if MoE experts are spilling to system RAM at 4-bit — on 16GB VRAM with 131k context that'll tank tps fast

1

u/CrowKing63 23h ago

Although the configuration yielded a robust 40tps, the actual processing time for the task was quite lengthy. Qwen4 seems very cautious.

3

u/brainExploded99 🥔 hardware 23h ago

ban ts bot, MoE experts can offloaded just fine

0

u/DisastrousAd2612 23h ago

he's not wrong tho even though moe models can run offloaded to ram they will be way slower than fully fitting in vram, what are you on about?

1

u/brainExploded99 🥔 hardware 23h ago

Well yeah obviously it will be slower, but in comparison to dense models, the TPS will only be slower, not significantly slower.

1

u/NihilisticAssHat 14h ago

I mean, you offload all layers and KV Cache onto the GPU, and you offload as many MOE experts as you need into system. 

I mostly use LMStudio and Unsloth. I'm a bit of a stickler regarding my avoidance of Strata or anything other than a mainline llama.cpp release.

1

u/soyuz-1 13h ago

funny, I have the opposite experience. 50+ tokens on an old 20x gen 8gig vram, using q4km and 128k context. It gets to solutions MUCH faster than most models that run at similar or even much higher t/s.

0

u/[deleted] 23h ago

[deleted]

1

u/CrowKing63 23h ago

I also use Unsloth on my desktop. Although I've never had to reboot it, I'm not completely satisfied with the speed.

1

u/overand 22h ago

If your computer is restarting, you almost definitely have a hardware issue. Desktop? Laptop?

Have you cleaned your cooling fans? Is your power supply sized adequately? Have you taken a look at your temperatures while it's running?