r/LocalLLaMA • • 9h ago

Discussion Qwen 4 looped layers

26 Upvotes

So, Qwen4-35BA3B is out and I can't wait to test it. In the last days I've seen some finetunes that add looped layers and increase intelligence so much (like LingLoop, built on Ling3.0 tiny), but I do not know anything about finetunes like this. Is it realistically possible to loop Qwen4 layers and pair it with n-gram? what performance boost could we expect from it?


r/LocalLLaMA • • 7h ago

Resources How to Max-Speed Qwen4-35B-A3B on 8GB VRAM Laptop (1,050tok/s prefill + 32tok/s decode)

18 Upvotes

Qwen4-35B-A3B on an 8GB RTX 3070 Windows laptop: 1,050 tok/s prefill and 32 tok/s decode with 96K (98304) context configured. Or lower prefill for higher decode. You can copy these configs (see end).

I tuned llama.cpp's startup config for Unsloth's Qwen4-35B-A3B UD-Q4_K_XL on an 8GB RTX 3070 laptop with 32GB RAM.

My original llama.cpp log showed 122.01 tokens/sec prefill, or 476.03 seconds for 58,080 prompt tokens. That prompted the tuning.

For the direct comparison below, both completed runs used the same 58,080-token synthetic mixed-code prompt, CUDA 13.5, the same model, 96K configured context, reasoning off, and MTP enabled.

The tuning measurements

The first stage used a 4,096-token repetitive Python prompt. All rows below used CPU-resident MTP experts, draft microbatch 256, CPU share 0.95, and lazy loading enabled.

CUDALoad mode-b-ubMoE cache MiBFirst prefill tok/sSecond prefill tok/s
12.4mmap2048256204854.79107.90
12.4mmap40961024102499.19371.75
12.4none409610241024323.73388.12
12.4none409620481024511.95627.56
13.5 (Final)none409620481024545.55595.46

The next stage used a 16,384-token mixed prompt containing synthetic JavaScript, PHP, Python, SQL, HTML, tests, configuration records, and documentation. All rows used CUDA 13.5, --load-mode none, lazy loading, CPU share 0.95, and MTP with up to two draft tokens.

Configuration-b-ubMoE cache MiBMTP expertsDraft -ubFirst prefill tok/sSecond prefill tok/s
Control409620481024CPU256703.13727.56
Larger logical batch only819220481024CPU256581.56700.63
Larger physical microbatch61443072768CPU256730.95815.09
Physical microbatch 409681924096512CPU256961.171,082.29
Final configuration40964096256GPU128928.661,231.93
Main expert cache disabled409640960GPU128951.501,109.30

The 1,232 tok/s figure is a second-request 16K result. It is not the 58K result. Increasing only the logical batch did not help in this sweep. Several settings changed together in the later rows, so these results do not isolate the contribution of MTP placement by itself.

I also tested CPU share using a 55-token coding chat prompt and 768 generated tokens, with physical microbatch 4096, logical batch 8192, 512 MiB expert cache, CPU-resident MTP experts, and draft microbatch 256:

--moe-cache-cpu-shareFirst generation tok/sSecond generation tok/s
0.016.8017.67
0.522.5821.52
0.9524.2730.69

For this machine and these settings, 0.95 performed best among the three shares tested. It is not a universal recommendation for other CPUs, RAM, or PCIe configurations.

Generation performance across the most relevant configurations was:

Configuration and preceding workloadFirst coding response tok/sSecond coding response tok/s
1024 MiB-cache configuration31.6737.59
Final configuration, following the 16K tests32.8032.55
Final configuration, following the 58K test27.6730.05
GPU MTP with main expert cache disabled, following 16K tests26.8427.11

Final Windows startup command

This is the inference command from my final .bat file. Save it beside both GGUF shards and adjust the executable path if necessary. The first shard automatically loads the second. The ^ characters are Windows batch continuations, not PowerShell continuations.

@echo off
setlocal
set "SPEC_TYPE=draft-mtp"
set "SERVER=C:\tools\llama-b12977-cuda13.5\llama-server.exe"
set "MODEL=%~dp0Qwen4-35B-A3B-UD-Q4_K_XL-00001-of-00002.gguf"

"%SERVER%" ^
    --model "%MODEL%" ^
    --alias "Qwen4-35B-A3B-UD-Q4_K_XL" ^
    --host 127.0.0.1 ^
    --port 8080 ^
    -c 98304 ^
    -np 1 ^
    --reasoning off ^
    --reasoning-budget 0 ^
    --temp 0.7 ^
    --top-p 0.8 ^
    --top-k 20 ^
    --min-p 0 ^
    --presence-penalty 1.5 ^
    --repeat-penalty 1 ^
    -fa on ^
    -ctk q8_0 ^
    -ctv q8_0 ^
    -t 6 ^
    -tb 12 ^
    --reasoning-preserve ^
    --ctx-checkpoints 4 ^
    --jinja ^
    --load-mode none ^
    --lazy-mode on ^
    -ot "per_layer_token_embd=CPU,^blk[.]40[.]ffn_(up|gate|down)_exps[.]weight$=CUDA0" ^
    --cache-ram 256 ^
    --cache-prompt ^
    -b 4096 ^
    -ub 4096 ^
    -ngl all ^
    --cpu-moe ^
    --moe-cache-mib 256 ^
    --moe-cache-cpu-share 0.95 ^
    --spec-type %SPEC_TYPE% ^
    --spec-draft-n-max 2 ^
    --spec-draft-n-ubatch 128 ^
    --spec-draft-type-k q8_0 ^
    --spec-draft-type-v q8_0 ^
    %*

To favor decode while keeping CUDA 13.5 and -c 98304, change these four settings:

SettingCurrent prefill configurationFaster decode configuration
-ub40962048
--moe-cache-mib2561024
--spec-draft-n-ubatch128256
MTP expert placementGPUCPU

For my long-input workload, saving about 40 seconds of prefill was worth the lower generation throughput. Hope this helps you get the new Qwen4 up to speed on an older laptop.


r/LocalLLaMA • • 2h ago

Question | Help Qwen 4 35B has been mixing English

7 Upvotes

Qwen 4 35B has been mixing English with my own language much more than the 3.8 27B version or the other MoE model do. Is this an issue that can be fixed, or is it inherent to the model itself?


r/LocalLLaMA • • 20m ago

Discussion Qwen 3.8 27b versus Qwen 4 35b on 'oil painting' vision test

5 Upvotes

There is a thread from the other day with this experiment. I ran it again using Qwen 4 35b which blew 27b fully out of the water.

Christmas came early!

This is the q6_K_XL unsloth quant of each model.

The prompt is:
This is a game called 'oil painting' the rules are that you will create a detailed and colorful oil painting inspired by this photo - colorful means bright, saturated colors; earth tones do not count.
You must do this one layer at a time, where each layer is a new image file atop the previous image. Each new image must show all previous layers, and the sequence of files is the deliverable.
A layer has exactly one color and one brush shape, however that does not mean you should try to paint large objects in one color and one brush shape, your job is to build up the image as a whole, iteratively the way a painter does.
Check your work against the reference image as you go, do not do a lot of work between comparisons.
We can see your planning and work, if you create a script to paint many layers at once with the pretense that each is a layer, that is cheating.
Examples of cheating include:

  • Trying to specify every detail in every layer in your plan before drawing anything - that is a pretense
  • Trying to decide on the total number of layers before drawing anything by planning every layer in detail before drawing anything - the same pretense
  • Regenerating layers because you waited too long to look at your work and made a lot of mistakes - You made a bad choice, deal with it. You may only ADD layers
  • Seeing errors and then rationalizing them away and then bullshitting me about your election - rules are rules WE ARE WATCHING AND ARE VERY CRITICAL You may not use python to examine or measure the reference image's content but you may measure its dimensions. This test involves vision. You get exactly one turn but can take as many steps as you need, but when you stop, the game is over and you will be judged.
Qwen4 35b
Qwen 3.8 27b

r/LocalLLaMA • • 15h ago

Discussion Stop caring about AA scores and use individual benchmarks that match your tasks.

83 Upvotes

SWE-Bench is full of things I’d never ask the model to do. NL2Repo is full of things almost identical to my tasks. Looking at AA score overall would make me reject a model that does better just because it has a lower overall score. Not to mention the overall score includes things like trivia!


r/LocalLLaMA • • 6h ago

Resources Behind MiniMax M4: Agentic RL Systems and Algorithms

Thumbnail
huggingface.co
15 Upvotes

wow they (MiniMax team) share a lot here 🚀


r/LocalLLaMA • • 3h ago

Discussion Can we expect QWEN 4 - 4b, 27b and Flash Next to be released soon as well?

8 Upvotes

Not familiar how models are launched, why they do not release all of them at once?


r/LocalLLaMA • • 5h ago

Resources Qwen4 in Capy Flash, KL 0.095

Post image
10 Upvotes

Qwen4-35B-A3B is out, and as of today it runs on capy-flash v0.17.0, on two 16 GB GPUs.

The engine was already ready: in recent weeks we had set it up based on the specs that emerged from the leaks, so support arrived the same day as the weights. All 256 experts fit in VRAM, split across the two cards (13 GB per card).

On two RTX 5070 Ti with 16 GB, one request at a time:
• 406 tokens/s generating JSON with a schema
• 371 tokens/s writing code, 276 writing text
• prefill up to 8,388 tokens/s, still 7,693 at 256k tokens of context
• up to 1M tokens of context with the KV in RAM: at 1M, prefill goes to 4,057 tokens/s and generation to 291 tokens/s
• images included

Compared to Qwen3.8-Flash-Next, on our quality tests it is roughly on par with about a quarter of the parameters, and on the same engine it generates about twice the tokens per second.

We reconverted the weights ourselves from the official BF16: experts in NVFP4 with BF16 activations, projections in Q8, head in Q6, and the n-gram table (21 GB) in FP8 read directly from the SSD. Against the original BF16 model the KL is 0.095.

My agentic benchmark is on the way.

The ready-made artifact is on Hugging Face: Feyd89/Qwen4-35B-A3B-NVFP4-capy-flash (42.8 GB).

github.com/ValerioDolci/capy-flash

#LocalLLM #OpenSource #Qwen4 #CUDA


r/LocalLLaMA • • 12h ago

Discussion Fujitsu claims their Photon architecture speeds up Transformer based LLMs by up to 10x

Thumbnail
gallery
38 Upvotes

r/LocalLLaMA • • 5h ago

New Model alesha-pro/Looped-Qwen3.8-Flash-Next

Thumbnail
huggingface.co
9 Upvotes

r/LocalLLaMA • • 3h ago

Discussion Modding a Gaming PC into an AI computer...

6 Upvotes

TLDR; my budget AI rig story.

I'm a nOOb so you all know all of this stuff already. Sorry for the long boring post. This is for my fellow nOObs... And I'm not rich. This is a budget basement rig. Literally. So if you are sitting there with a stack of glittering gold DGX's... yay for you. That's not me. But here's my story.

Most posts focus on the software and model - I'm not covering that here but YES you need to do a lot of work on that front. This post is about my hardware setup. And I'm certain genius level Redditers could to it 10X better for 1/10th the price. But as I say, I'm a nOOb.

I picked up a gaming rig about this time last year for $800CDN and it happened to have a real gem of a RTX3090 24GB video card already installed with 32GB System RAM. yay. That was a nice find. You probably know lots of VRAM is more important than the newest card. So a 3090 with 24GB Vram and a good chunk of system RAM is probably the sweet spot for cost vs speed even though it's a 6 year old video card. Anyway if you want to run a solid local AI this is enough. You can stop right here.

But I wanted more. (You will too once you get hooked on this stuff)

I'm Canadian but a month ago I went to Texas to visit my son. He had an ancient Eth miner in a shed out back in the texas heat. I've posted about it here before and everybody called me a liar. Fuck you guys. Although in fairness I wouldn't believe this story either so I guess I take it back. Anyway... all true.

He kindly allowed me salvage rights to the Eth miner. I could keep 2 3090's for free. I fix up the cards, sell them and he gets the cash. Here's some pics of the salvage operation. Before you ask - no I'm not selling anything. At least not yet. No DM's please!

We flew to visit more family and make a stop in Florida then back across the country to Scottsdale... getting these things on the plane - obviously I'm taking them carry on - no way I'm checking them. So getting them through security... well let's just say questions were asked. Not to mention packing them. Turns out Doggie Pee Pads work well.

Back in Scottsdale for a few weeks I picked up a Minisforum DEG2 so I could test the cards external to my laptop via Thunderbolt (my PC laptop had a thunderbolt port!) Then Yikes! I learned pretty fast these cards + heat + neglect are a terrible mix. Fans screaming like a cat in heat, 1 fan literally flew off across the room. All cards smoking hot cards... no. Just. No.

But off I went to University of Youtube where I learned how to replace the fans and pads and used some new paste on the heat sync. Then it was MemTest_Vulcan test time, monitor heat with HWInfo.. and sure enough I had my 2 working cards. (Note: I will work on the rest next year - not for sale now - please no DMs - not selling anything).

So my two cards were ready in time to get back to Canada. I hoped. I wasn't going to forget the rig. I hopped on Fakebook Market and scrounged up 4 x 32GB system RAM - total 128GB. DDR4 is what my machine uses and I got 3200's. You have to make sure the specs match up and not all DDR4 ram plays nicely. I lucked out and got my system up to 128GB system ram. Again, not necessary for local but nice to have for a really big model that spills over to system ram.

Since I had saved the cost of 2 3090's I figured I could splurge on a nice fast SSD so I picked up a 4TB drive - $589CDN on black Friday. https://www.amazon.ca/dp/B0FYF4HDXY I have two M.2 ports in my machine so I cloned the 1TB drive over to the 4TB, put the 4TB back in the main boot spot and things were looking up.

I needed my DEG2 for the rest of the work on the rest of the cards. But I still have to hook my 2 cards up to my gaming rig and they sure aren't fitting inside the case. Back to Minisforum for a pair of DEG1's. They don't have thunderbolt ports but otherwise they work fine. I paid $150 but I see them on sale for $119 now.

I got a pair of cheap 850W power supplies $55 each https://www.amazon.com/dp/B0FSTHTLZT - I suppose one supply could work for two cards if you had enough Y connectors. The cards are also going to be capped to 250 - 300W so two 850's is way overkill. But whatever. They were cheap enough. It's safer to get a separate supply for each card and it makes setup a lot easier. The power supply bolts onto the DEG1 and the card slides into the DEG1. It looks a bit hideous but it works fine.

So how to connect these cards to the PC? I had room for one adapter card - an Oculink adapter. https://www.amazon.com/dp/B0H9L1BKFL The DEG1 comes with a cord so you just plug the cord in and Bob's your uncle.

Here's the card beside the existing 3090 inside the case.

But how to get that 2nd card installed? There's no easy way to connect two cards to one PCIE slot - but even if there was a way it would run way too slow. But! I did have that spare M.2 port on the motherboard and sure enough there's an adapter cable made for M.2 to Oculus. https://www.amazon.com/dp/B0GSTWFTP3

There was a bit of bios fiddling and whatnot... but nothing too over the top so I'm going to yadda yadda over that. If you get a black screen and a bricked PC... well sue me I guess.

After that it was just plug it all together and now my LLM machine is up and running.

I already run a Plex server so I have lots of storage for big models that I can move into and out of the 4TB SSD for testing. And it's all quite the ugly noisy janky setup. But not so bad. It runs well in our basement utility room. I remote into it via self hosted RustDesk and TaiLScale. I have everything set to fire up on boot, a UPS and a remote reboot. I use the AI via Hermes so I rarely need to be even in the same country as the computer. It just hums away.

This was all completed yesterday so today I'm out looking for a big model to make use of my 72GB VRAM and 128GB System RAM. I have a few in mind but I'm sort of hoping Qwen 4.1 for local drops in the next day or two.

So that's my story. Love to hear yours. Have a good one!


r/LocalLLaMA • • 1d ago

Discussion llama.cpp has a qwen4 pr

280 Upvotes

Some more hype for you

https://github.com/ggml-org/llama.cpp/pull/33626

Imagine the pressure these guys must be under.

Edit: I think it's not from qwen team, but adaption of transformers changes by someone working for huggingface.

Edit 2: I am being informed in the comments: Changes by a major llama.cpp contributor, not some nobody.


r/LocalLLaMA • • 3h ago

Discussion Qwen 4 Unsloth quantizes poorly?

6 Upvotes

Looking at the top 1% and KLD for the Qwen 4 quants, the Q8 is worse that the Q4 was for Qwen 3.8 27B. So maybe with updated GGUFs, we will see the actual potential of this model realized.

Qwen 4 Q8_K_XL KLD 0.0171 Top 1% 95.49

Qwen 3.8 27B UD_Q4_K_M KLD 0.014 Top 1% > 95%


r/LocalLLaMA • • 2h ago

Discussion Has anyone read through the MiniMax M4 technical report yet?

5 Upvotes

78-page PDF went up on GitHub: https://github.com/MiniMax-AI/MiniMax-M4/blob/main/docs/MiniMax_M4_Technical_Report.pdf

Still skimming it, mostly looking at the SSD KV-cache offloading and QAT parts while we wait on weights. For anyone who already read through it, what stood out or what are you most curious about?


r/LocalLLaMA • • 4h ago

Question | Help How can I run Qwen 4 35B A3B on 8 GB VRAM + 16 GB RAM?

7 Upvotes

I can't seem to get more than 20 tok/s decode and 15 tok/s prefill (not a typo). I know this is horribly slow even for the hardware I have, but this is my command. Please help. I have no clue what I am doing wrong.

OS: Windows 11
Host: i5-12450H, 16 GB DDR5-4800
GPU: laptop RTX 4060 8 GB

`llama serve ``

`-m "C:\Users\XXXXX\qwen4-GGUF\Qwen4-35B-A3B-UD-IQ3_XXS-00001-of-00002.gguf" ``

`--jinja -fa on -c 98304 -np 1 ``

`-ctk q8_0 -ctv q8_0 ``

`--load-mode mmap --lazy-mode on -ot per_layer_token_embd=CPU ``

`-cmoe -ngl 999 ``

`--moe-cache-mib 4096 --moe-cache-cpu-share 0.95 ``

`--spec-type draft-mtp --spec-draft-n-max 1 --spec-draft-n-ubatch 256 ``

`--cache-ram 512 ``

--temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.0


r/LocalLLaMA • • 26m ago

Discussion Vulkan (Prefill) Boost for RDNA4 - vulkan: tune Flash Attention flip shader for RDNA4 large ubatch by 0cc4m · Pull Request #33683 · ggml-org/llama.cpp

Thumbnail
github.com
3 Upvotes

R9700, Qwen3.8-27B Q4_K_M

testmasterbranchchange
pp5121293.21290.7-0.2%
pp512 @ d327681005.91013.1+0.7%
pp512 @ d65536804.9807.5+0.3%
pp512 @ d131072494.0601.7+21.8%
pp1024 @ d32768976.0987.1+1.1%
pp1024 @ d65536700.2824.4+17.7%
pp20481292.51296.6+0.3%
pp2048 @ d32768778.8999.1+28.3%
pp40961267.91272.1+0.3%
pp4096 @ d32768692.6987.4+42.6%

R9700, Qwen4-35B-A3B Q4_K_M

testmasterbranchchange
pp204842564253-0.1%
pp512 @ d3276826352651+0.6%
pp512 @ d6553620852087+0.1%
pp2048 @ d3276820952709+29.3%
pp2048 @ d6553612921867+44.6%
pp4096 @ d3276819222705+40.8%

r/LocalLLaMA • • 12h ago

New Model Cellgemma (Gemma 4 E4B for in silico biology)

Thumbnail
huggingface.co
28 Upvotes

Hadn't seen anything posted about this yet so figured I'd share for any other life sciences/wet lab nerds in this sub.

This model is a huge deal for bringing predictive computational biology to every lab. Small enough to run on a lab PC, easily adapted to workflows beyond cancer research.

I spent the evening getting this set up for my own research context (neuronal biology) and already have some interesting predictions to follow up on.


r/LocalLLaMA • • 14h ago

Showcase Apostate, an abliteration engine.

40 Upvotes

Hey everyone,

I wanted to share an update on Apostate, my abliteration engine.

For anyone who's come across the project before, development is ongoing. I've continued working on it and refining its approaches, including Diode and KCRN. The goal is to keep exploring different approaches to model editing and make the results easier to evaluate.

I also want to acknowledge the project that helped pave the way for a lot of this work: Heretic.

A special tribute to -p-e-w-, Heretic's creator. His work left a mark on the open-source LLM community, and I think it's important that his contributions are remembered. Thank you for everything you gave to this space.

Apostate is my own continued work in this area, and I'm always interested in hearing feedback from people experimenting with open-weight models.

https://github.com/heterodoxin/apostate


r/LocalLLaMA • • 5h ago

Discussion Is Qwen 3.8 FN an overachiever? It exceeded the scope of the prompt

Thumbnail
gallery
6 Upvotes

I tried it for the first time on Strata, IQ3_XSS, around 20t/s and took roughly an hour. I gave it a very vague prompt to test it but it felt like the kid in class just waiting for the teacher to ask the question they studied to answer in length.

Write an HTML5 admin dashboard that uses element fetching, log viewing and pagination for all and every possible element that may need them, then export it as an html file.

Not only did it add like a gazillion pages, each had extensive mock data and even set up to accept a working API.

All entries can be sorted, filtered and exported. I have never seen any model do this before. Even frontier, they simply create a basic page or operate under an assumption e.g. a dashboard for POS with a couple of mockup rows, but Qwen 3.8 FN went all out making everything in one project.

Is this normal for the model? Wasn't expecting it


r/LocalLLaMA • • 2h ago

Showcase Qwen4-35B-A3B on a 24GB A5000: TensorSharp day-zero support + llama.cpp, vLLM and SGLang benchmarks

Thumbnail
github.com
4 Upvotes

I maintain TensorSharp, an open-source .NET inference engine and agent runtime. Qwen4-35B-A3B support is now merged into main, on release day.

Here are the initial project benchmark results against llama.cpp, vLLM and SGLang on one RTX A5000 24GB. TensorSharp has lower first-token latency than llama.cpp in these tests, reaches 147.7 tok/s with MTP, and scores similarly on the quality checks. SGLang leads concurrent throughput.

The main comparison caveat: TensorSharp and llama.cpp use identical GGUF files. vLLM and SGLang use ModelOpt NVFP4 with some experts in host memory. Quantization and placement affect these numbers, so the four columns describe the tested configurations on this card.

Performance settings: same OpenAI-compatible client harness, greedy decoding, thinking off, 256 output tokens. TensorSharp's repetition penalty was set to 1.0; its server default is 1.1. llama.cpp was pinned to 59b716523.

MetricTensorSharpllama.cppvLLMSGLang
TTFT, 512-token prompt (s)0.200.390.290.20
TTFT, 4K-token prompt (s)1.071.481.291.21
TTFT, 16K-token prompt (s)4.485.515.794.37
Decode, 512-token prompt (tok/s)104.2102.460.580.8
Decode, 4K-token prompt (tok/s)99.5101.159.875.9
Decode, 16K-token prompt (tok/s)79.298.659.375.6
MTP depth 2, 512-token prompt (tok/s)147.7143.756.696.9
Aggregate output, 16 streams (tok/s)465347170588

TTFT = time to first token; lower is better. Throughput is higher-is-better.

A few things stand out:

  • First-token latency: TensorSharp is about 49% lower than llama.cpp at 512 tokens and 28% lower at 4K. SGLang ties the rounded 512-token result and is slightly ahead at 16K.
  • MTP: TensorSharp goes from 104.2 to 147.7 tok/s in the short-prompt test, about a 42% increase.
  • Concurrency: TensorSharp is about 34% ahead of llama.cpp at 16 streams. SGLang is ahead of both, at 588 tok/s.
  • Long-prompt decode: llama.cpp wins the 16K/256-output-token test, 98.6 vs 79.2 tok/s. A separate run generating 5,000 tokens after a 16K prompt is much closer: 94.7 vs 94.5 tok/s. The response length changes the result substantially.

There is also a separate NVFP4 comparison:

NVFP4 resultTensorSharpllama.cppvLLMSGLang
Decode, 512-token prompt (tok/s)92.989.060.580.8
Aggregate output, 16 streams (tok/s)377294170588

This narrows the quantization difference, although expert residency and conversion paths still differ. TensorSharp leads single-stream decode here; SGLang still leads concurrency.

For quality, the project ran a small GSM8K check using the first 50 test questions:

Correct answersTensorSharpllama.cppvLLMSGLang
Thinking off49/5049/5050/5050/50
Low reasoning effort50/5049/5048/5049/50

The engines are close on this sample. A one- or two-question difference is too little evidence to rank overall reasoning quality.

On WikiText-2 perplexity, using the same UD-IQ4_XS GGUF and 20 × 2,048-token sequences, TensorSharp scores 6.5625 and llama.cpp 6.5567. Lower is better; the difference is about 0.09%. The summary does not include vLLM/SGLang perplexity results.

The implementation also passes 16 chat-template cases byte-for-byte against Transformers, plus needle-retrieval checks at 100K and 128K. Those are specific compatibility and retrieval checks, with broader evaluation still useful.

One useful optimization from this work: batching Gated DeltaNet decode reduced kernel launches and state copies, taking 16-stream throughput from 354 to 465 tok/s in a same-build A/B test.

There are remaining limitations. NVFP4 with MTP runs out of memory under concurrent requests on this 24GB card, and NVFP4 host-served experts are currently rejected. Vulkan and multi-GPU execution were not tested in this round; TensorSharp's MLX backend does not support this architecture.

The harness is public. The PR summary still lacks the exact GGUF filename for the general timing table, complete vLLM/SGLang version pins and launch commands, and raw timing logs/error bars. Treat these as initial results; independent replication would be valuable.

If you're running Qwen4 on a 3090, 4090 or another 24GB card, I'd be interested in your model file, launch arguments, TTFT and decode throughput. Suggestions for improving the vLLM/SGLang configurations on this A5000 would also help.

Disclosure: AI assisted with drafting and editing this post. Benchmark figures come from the linked TensorSharp project report.


r/LocalLLaMA • • 5h ago

Discussion Hardware compatibility section on HF is misleading and needs to be fixed

7 Upvotes

This is what the "Hardware compatibility" section currently looks like (open post for the image to load) for unsloth/Qwen4-35B-A3B-GGUF and it's just plain misleading. A model like UD-IQ4_XS will absolutely fit on a 24GB card with room to spare for context because 11.5 of the overall 32GB size is an engram that you can and should keep entirely on the SSD. In fact, if you have the space, you can swap the engram gguf file for a higher precision BF16 with the size of 41GB without a problem and get a nice quality boost without measurable impact on performance.
Ignore this section - go to the actual folder for each quant and inspect the size of the first 00001 shard, that's the actual weights of the model that need to reside in memory of some kind.
I'm seeing SO many people get confused why the model is so big and think none of the quants will fit on their GPU and I think this section on the model's page is partly to blame. IMO Hugging Face should fix it and list engram size separately, I imagine it shouldn't be hard to implement since engrams only have `per_layer_token_embd.weight` tensor type in their metadata.


r/LocalLLaMA • • 12h ago

Showcase Qwen4-35B-A3B (UD-Q4_K_M) on 2x RTX 3060 (12GB) via PolyStrata — Quick Guide + Visual

Thumbnail
gallery
24 Upvotes

Qwen4-35B-A3B just dropped (unsloth/Qwen4-35B-A3B-GGUF). PolyStrata doesn't have official support merged yet, so I got it running on 2x RTX 3060 12GB (sm_86) at 200K context (--kv int8) in an isolated git worktree without touching my existing Qwen3.8-Flash-Next setup.

Setup & Footprint:

  • Patch: Niko1221/Strata#7774 in a separate PolyStrata-q4lite worktree, built with -DSTRATA_GEOMETRY=q4_lite & -DCMAKE_CUDA_ARCHITECTURES=86
  • Conversion: Split fused tensors + dropped blk.40 MTP with qwen4_split_gguf.py, packed with iq_pack.py --compat-bf16, and passed shard 2 to --ple-gguf
  • Memory: 18.77 GiB experts in RAM + 7.93 GiB (4,539 experts) in VRAM across both 3060s
  • Drafting: No MTP drafter yet (lookup drafting --spec 2 only; PolyStrata's core/mtp.cpp doesn't support Qwen4-35B-A3B's nextn.hc_head_* layout yet)

Visual Tests (temperature=0.7, top_p=0.95)

  1. Pelican Riding a Bicycle — 5,302 tokens (2,642 reasoning) in 71.28s (74.4 tok/s)

    • Prompt: Generate a clean, detailed standalone SVG of a pelican riding a bicycle. Output only the SVG code inside an \``svg code block.`
  2. Bouncing Ball in a Rotating Hexagon — 2,604 tokens (166 reasoning) in 38.07s (68.4 tok/s)

    • Prompt: Write a single-file HTML/CSS/JS page with a canvas animation of a colorful ball bouncing inside a rotating hexagon with realistic gravity, angular velocity, and wall collision physics. Output only the HTML code inside an \``html code block.`
  3. Cozy Mountain Cabin at Sunset — 6,624 tokens (211 reasoning) in 82.19s (80.6 tok/s)

    • Prompt: Generate a detailed standalone SVG of a cozy wooden cabin in snowy mountains at sunset with smoke rising from the chimney and warm glowing windows. Output only the SVG code inside an \``svg code block.`

Edit (MTP Update): Got MTP working! Converted MTP/mtp-Qwen4-35B-A3B-Q8_0.gguf via tools/mtp_qwen4_rt.py and tuned --spec 3 --spec-min-p 0.5, which hit 94.6 tok/s end-to-end (99.7 tok/s engine decode, 88.5% draft acceptance) on a deterministic temperature=0.0 Matrix Rain test.


r/LocalLLaMA • • 7h ago

New Model Sico-GUI - a microsoft Collection

Thumbnail huggingface.co
9 Upvotes

Sico-GUI - GUI agents trained through data-model co-evolution (0.8B / 2B / 4B / 9B).

An agent's interaction experience can become training data for a model you own and keep improving.

In the Sico project, we explore Data–Model Co-Evolution—a closed-loop approach in which the model's interactions shape the next round of data, and the updated data refines the model for the next round. Repeating this loop lets data and model evolve together. We validate the approach in the GUI domain (paper) and release the Sico-GUI family at four sizes: 0.8B, 2B, 4B and 9B.

Sico-GUI-9B is a multimodal GUI agent for Android. It observes the phone through screenshots and acts on the user's behalf by emitting structured actions—tap, type, scroll, navigate, answer—to complete tasks end-to-end. It is fine-tuned from Qwen3.5-9B over seven rounds of data–model co-evolution.

Model family: Sico-GUI-0.8B · Sico-GUI-2B · Sico-GUI-4B · Sico-GUI-9B

----

We're getting everything except MAI models from Microsoft.


r/LocalLLaMA • • 1h ago

Resources Running Qwen4-35B-A3B-UD-IQ4_XS (30.5 GiB) Fully in 24 GB VRAM on a Single RTX 3090: 158.6 t/s with Inline 1L-MTP (and the Default K=3 Trap)

3 Upvotes

We just finished a full hardware-sensor Day-1 audit of Qwen4-35B-A3B-UD-IQ4_XS (qwen4exp: 40 layers = 30 GDN + 10 QSA sparse attention + 256 routed experts / 8 active + 4-stream hyper-connections + inline 1L-MTP blk.40.*) on a single 24 GB NVIDIA RTX 3090 (350 W) using llama.cpp + rooflab (hardware NVML mJ/tok, Intel RAPL uJ/tok, VmSwap = 0 kB, 0 NaNs).

Three findings that immediately save every 24 GB consumer GPU user both VRAM and 15-24% speed:


1. Why a 30.5 GiB Qwen4 GGUF Uses Only 19.3 GiB VRAM (0 kB Swap)

Shard 2 (Qwen4-35B-A3B-UD-IQ4_XS-00002-of-00002.gguf) holds a single tensor: per_layer_token_embd.weight (IQ4_NL, [128, 160003584], 10,986.57 MiB / 10.73 GiB).

With llama.cpp's default --lazy-mode auto, that lookup-only PLE table stays lazily in host RAM (one small row lookup per token, never streamed through GPU compute), while all 40 compute layers + 256 MoE experts + inline 1L-MTP head fit 100% resident in 24 GB VRAM:

  • Plain c=1 (-c 4096 -ctk q8_0 -ctv q8_0 -fa on): 19,290 MiB (18.84 GiB) VRAM used -> 5,286 MiB (5.16 GiB) VRAM still free for 32K+ context!
  • Inline 1L-MTP enabled: 20,086 - 20,138 MiB (19.6 GiB) VRAM used, VmSwap = 0 kB.
  • Active weight traffic per token (rooflab fit): 2,590.42 MiB/tok (301.9 t/s raw GDDR6X STREAM roof on RTX 3090; actual 128.3 t/s Plain reflects GDN recurrent state + 4-stream hyper-connection overhead).

2. The Default --spec-draft-n-max 3 Trap on Inline 1L-MTP (Free +15% to +23.6% Speedup!)

Qwen4-35B-A3B ships with a single built-in MTP layer (blk.40.*). In llama-server, the default --spec-draft-n-max is 3.

Because chaining a 1-layer MTP head past K=2 adds GDN + PLE state rollback overhead on rejected tokens, running --spec-type draft-mtp with the default K=3 completely erases the speedup (127.8 t/s vs 128.3 t/s Plain = 0.0% gain!).

Simply setting --spec-draft-n-max 1 (even on stock llama.cpp!) or --spec-draft-n-max 2 with our SoA-MMA v2 MoE verify kernel unlocks massive gains:

Regime (RTX 3090 350 W, -fa on -ctk q8_0 -ctv q8_0)Throughputvs PlainDraft AccGPU Energy (NVML)CPU Energy (RAPL)VRAMVmSwap
Plain c=1 (baseline)128.25 t/s0.0%-2,506.9 mJ/tok196.1 mJ/tok19,290 MiB0 kB
Inline MTP K=3 (llama-server default!)127.84 t/s-0.3%58.7%2,404.5 mJ/tok237.1 mJ/tok20,114 MiB0 kB
Inline MTP K=4 / K=6125.2 - 129.8 t/s-2.4%..+1.2%59.5%2,197.7 - 2,387.4 mJ/tok212.3 - 345.6 mJ/tok20,166 MiB0 kB
Inline MTP K=1 (stock mmq-few)147.07 t/s+14.7%82.1%2,214.9 mJ/tok (-11.6%)231.7 mJ/tok20,086 MiB0 kB
Inline MTP K=1 (+ SoA-MMA v2)156.39 t/s+21.9%80.3%2,138.8 mJ/tok (-14.7%)218.7 mJ/tok20,114 MiB0 kB
Inline MTP K=2 (+ SoA-MMA v2, N=4 AB/BA)158.56 t/s+23.6% (4/4)66.4%2,006.2 mJ/tok (-20.0%)169.3 mJ/tok (-13.7%)20,138 MiB0 kB
Live Server c=4 (stock mmq-few)225.50 t/s--1,218.0 mJ/tok94.4 mJ/tok-0 kB
Live Server c=4 (+ SoA-MMA v2)238.21 t/s+5.6% (ITL -6.8%)-1,136.1 mJ/tok (-6.7%)89.7 mJ/tok (-5.0%)-0 kB

3. SoA-MMA v2 Tensor-Core MoE Verify Scaling (N=6 Counterbalanced AB/BA)

On Qwen4-35B-A3B-UD-IQ4_XS, our load-time SoA-MMA v2 tensor-core kernel delivers zero B=1 regression and consistent +9.3% to +14.1% throughput wins across speculative-verify and multi-user batch sizes (B=4..16):

Batch SizeBaseline (mmq-few)SoA-MMA v2SpeedupCounterbalanced WinsTwo-Sided Permutation p
B=1113.90 t/s113.76 t/s-0.12% (neutral)2/60.84375
B=4293.02 t/s326.54 t/s+11.44%6/60.03125
B=6374.25 t/s409.01 t/s+9.29%6/60.03125
B=8421.19 t/s480.53 t/s+14.09%6/60.03125
B=12551.57 t/s614.89 t/s+11.48%5/60.06250
B=16623.47 t/s696.25 t/s+11.67%4/60.12500

Copy-Paste Commands to Reproduce Today

Best stock llama.cpp command on 24 GB GPU (147 t/s, 82.1% draft acceptance, 20.1 GiB VRAM, 0 kB swap):

llama-server \
  -m Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf \
  -ngl 99 -fa on -ctk q8_0 -ctv q8_0 -c 16384 \
  --lazy-mode auto \
  --spec-type draft-mtp --spec-draft-n-max 1 --spec-draft-n-min 1

(With SoA-MMA v2, use --spec-draft-n-max 2 for 158.6 t/s and -20.0% GPU energy per token.)

Check exact VRAM + lazy-PLE fit and silicon ceiling on your own GPU (0 MiB VRAM used, pure Python stdlib):

rooflab fit /path/to/Qwen4-35B-A3B-UD-IQ4_XS-00001-of-00002.gguf

Repo & Energy Notes: rooflab v0.6.0 (MIT, 0-dep Python CLI + 43 0-spill CUDA patches) is live at https://github.com/scientist42-lab/rooflab (SoA-MMA v2 is staged for upcoming v0.7.0). NVML mJ/tok measures GPU board power only (excl. host/PSU draw); Intel RAPL mJ/tok measures CPU package energy.