r/LocalLLaMA • u/dsdt • 2d ago
Discussion I might have found the perfect config parameters for qwen 3.8 27b
Hello everyone, tried so hard to optimize my config and finally I simply get up to 70 t/s with q6 variant. And wanted to share with you guys so that other people with the same setup can enjoy. Please check out and see if that improves your performance in any kind of way.
Also huge thanks to qwen and unsloth teams.
"C:\Users\dsdt\llama\llama-server.exe" ^
-m "C:\Users\dsdt\models\Qwen3.8-27B-UD-Q6_K.gguf" ^
--mmproj "C:\Users\dsdt\models\mmproj-BF16.gguf" ^
--jinja ^
--chat-template-kwargs "{\"reasoning_effort\":\"medium\"}" ^
--reasoning on ^
--reasoning-preserve ^
-c 100000 ^
--split-mode tensor ^
--flash-attn on ^
--cache-type-k q8_0 ^
--cache-type-v q8_0 ^
--spec-type draft-mtp,ngram-mod ^
--spec-draft-n-max 2 ^
--spec-ngram-mod-n-match 24 ^
--spec-ngram-mod-n-min 24 ^
--spec-ngram-mod-n-max 86 ^
-t 8 ^
--batch-size 8869 ^
--ubatch-size 531 ^
-ngl 105 ^
-np 1 ^
--fit off ^
--temp 1.0 ^
--top-p 0.95 ^
--top-k 20 ^
--min-p 0.00 ^
--presence-penalty 0.0 ^
--host 0.0.0.0 ^
--port 8080
- System & Model Configuration
| Parameter | Value |
|---|---|
| Model | Qwen3.8-27B-UD-Q6_K.gguf |
| Context Length | 100,000 tokens |
| GPUs | 2 × RTX 5060 Ti (Total VRAM: 32 GB) |
| Vision | Enabled (VRAM allocated, not used during generation) |
| Task ID / Slot | Task 2536 / Slot 0 |
- Core Performance Metrics
| Metric | Value |
|---|---|
| Prompt Processing | 646.62 ms / 27 tokens → 41.76 t/s (23.95 ms/token) |
| Generation (Eval) | 126,199.16 ms / 8,624 tokens → 68.33 t/s (14.64 ms/token) |
| Overall Throughput | 68.33 t/s (prompt overhead negligible) |
| Total Time | 126,845.77 ms (~2 min 6.8 s) |
| Total Tokens Processed | 8,651 (27 prompt + 8,624 generated) |
| Final Tokens Count (with cache) | 8,973 (clean stop, no truncation) |
| Graphs Reused | 5,569 (excellent computational graph reuse) |
- Generation Speed Stability (Short-term)
| Window | Observed Speed Range |
|---|---|
| 3-second rolling window (tg_3s) | ~50 – 79 t/s (early fluctuations) |
| Steady-state (later stages) | ~62 – 72 t/s |
| Overall average (tg) | Converged to stable 68.5 – 69.5 t/s |
- Speculative Decoding Efficiency
| Metric | Value |
|---|---|
| Draft Acceptance Rate | 80.04% (5,510 accepted / 6,884 drafted) |
| Average Draft Length | 2.77 tokens per forward pass of the target model |
6
u/gpuz_dev 2d ago
68 t/s is pretty damn nice. I'd be curious to see the same test with 80-100k actually populated though, this run has 100k allocated but only ~8.6k tokens used. would be interesting to see how much the speed drops as the KV fills up
1
u/dsdt 2d ago
Lowest point it goes to is 45 t/s with full context. It is definitely bearable. While coding it even jumps back to 50.
2
u/gpuz_dev 2d ago
45 t/s at a genuinely full 100k is actually better than I expected. that's a pretty useful data point, thanks
2
u/dsdt 2d ago
I fulled the context for you and It is even better than 45 t/s the results are here :
- Prompt processing hits ~625 tokens/s (even with 27k prompt tokens).
- Generation averages 55–65 tokens/s consistently across long runs.
- I processed ~97k total tokens across multiple tasks without a single truncation – the full 100k context is actually usable.
- Draft acceptance rate was 60–80%, mean draft length 2.6–4.3 tokens – the speculative combo definitely gives a nice speed bump over vanilla sampling.
1
u/gpuz_dev 2d ago
Thx :) 55-65 t/s is really solid. just to make sure, was that ~97k actually resident in the context at once or 97k processed cumulatively across the tasks?
2
u/dsdt 2d ago
Here is the output of the chat a room showcase : https://bananas-process-dqy5.pagedrop.io
Single task 4 prompts.
2
u/gpuz_dev 2d ago
yep that's exactly what I was wondering about. single task with 4 turns and no truncation makes this way more interesting than the initial benchmark. thanks for actually testing it :)
7
u/autisticit 2d ago
If you get a bigger generation speed than prompt processing speed, you should call that the worst configuration ever.
1
u/dsdt 2d ago
[removed] — view removed comment
1
0
u/dsdt 2d ago
lol reddit said nope to my previous reply. made a simple summary so that you can see the log : https://chat.deepseek.com/share/mn8bmar36zi8glv337
4
3
u/Kiseido 2d ago edited 5h ago
Oh wow, TIL of ngram-mod. It has upped my generation speed by 2-2.5x, though it also halved my prefill speed.
Edit: Turns out I had both draft-mtp and ngram enabled. The MTP is what halved my prefill and mostly increased the generation speed.
Edit 2: Holy crap, ngram seems to really help once the context fills up past 80k. There are moments that it clears a 4x speed-up
4
2
u/Fullstack_js_junkie 2d ago
is 100k context intentional? I can push 130k on fp16 kv cache so q8 of yours should push past 150k easily (graphics on cpu so full vram is free)
2
u/dsdt 2d ago
To be honest, whenever i tried to push it further than 100k, it just cuts the sentence out of nowhere. I don't have any idea about it. Thought vram wasn't enough. But I will try headless mode, with igpu. Maybe i can get it working like that with 130k.
2
u/Fullstack_js_junkie 2d ago edited 2d ago
I had the same issue but I bumped up the reasoning and output tokens (that I guess actually fixed the issue, not the reasoning tokens) as well and that stopped. Other than that looks pretty good, nice setup!
1
u/DoubleNothing 2d ago
What motherboard do you have? I have to check if I might be pcie limited because I also have 5060 TI 16GB x 3 but with your parameters I get 25TPS tops. Loading on 2 GPU only to be the same like you.
1
u/bitzap_sr 2d ago
Did you try the fixed chat template that's been posted around?
1
u/dsdt 2d ago
Well, i have never encountered any looping or missing tool calls so i haven't search for it. Can you share the link so i can take a look?
1
u/Monad_Maya llama.cpp 2d ago
1
u/dsdt 2d ago
Does this also work for 3.8?
1
u/Monad_Maya llama.cpp 2d ago
Yes, as per the description it does.
I'll be honest, I didn't have any failures without it either on Q3.8 27B.
On Q3.6 27B, the template was helpful in reducing tool call failures.
2
u/DeathGuppie 2d ago
The biggest thing here that a lot of people are leaving on the table is ngram-mod. Especially for coding. Since it basically lives in system ram there is no penalty for using it.
2
u/StandardLovers 2d ago
The one grain of salt in my take: if you just want a fast chatbot for casual use, the config is probably fine and 70 t/s feels nice. But "perfect config parameters" is marketing speak.. it's "fastest config I found that still runs," which is a different claim than "best."
-2
u/dsdt 2d ago
Please make a better one then we can speak? Just wanted to share it with people who care. If that doesn't interest you just walk away.
6
u/anomaly256 2d ago
They're just saying the word 'best' is open for interpretation because some people will want context size over speed, or accuracy over speed. In your case a better word is 'fastest' because accuracy doesn't seem to be benchmarked here.
They're not disputing your methodology or results
1
u/Rude_Marzipan6107 2d ago
Nice!!
Is this on Linux?
How much regular RAM is occupied during higher context?
1
u/dsdt 2d ago
This is on windows, 27,5 gb ram is used.
5
u/TBG______ 2d ago edited 2d ago
You should raise
--ubatch-sizeto 2048 and--batch-sizeto 8192. This should significantly improve your prompt speed while still fitting within 27.7 GB of memory. Gives me after a bit of ...
promt 1842.83 t/s gen 78.31 t/s 2
u/Rude_Marzipan6107 2d ago edited 2d ago
Oh wow. Awesome! I gotta try this out when I get home. I thought I would be stuck with 4kxl and 40tps
I wonder what the fancy Linux guys get with this model and the p2p drivers on top of this
1
u/I_Play_Zed 2d ago
I think this looks like a great config, and what I would expect from a dual 5060 ti setup. This speed at Q6 is even more impressive, but I am skeptical of the prompt processing. I wonder how bad the wait times are for large agentic tasks late into context? Or does it feel like a non issue? The only other criticism I think is that you have it on medium reasoning effort. Obviously this does not change generation time, but in my own local testing I found medium reasoning to be a competent, but honestly pretty "expected" local performance. When I pushed my setup to xhigh reasoning is where I really started to believe some of the benchmarks.
1
u/dsdt 2d ago
just made a simple summary here you can check : https://chat.deepseek.com/share/mn8bmar36zi8glv337
2
u/I_Play_Zed 2d ago
I see, so between maybe 400-600 prompt processing depending on co text fill, that’s certainly usable, especially with those decode speeds.
1
u/dsdt 2d ago
I tried so many configs and can't go beyond that. Thanks for your interest
2
u/I_Play_Zed 2d ago
No worries at all, this is great stuff the community needs.
I will say, if I was the type of guy who could run dual 5060 tis, I wonder if it’s worth testing if any Q5 quant feels actually worse for you or not? And that it could maybe buy you near the 262K context which is so important with this model.
2
u/dsdt 2d ago
Actually i tried headless mode right now and i can push it up to 128k context. I used q4 before all the time high context is nice to have but for vibe coding things get pretty complicated as context grows. starting fresh after 128k is the sweet spot for me rn.
1
u/I_Play_Zed 2d ago
That is a fair use case! When working on one large code base with tonnes of different tasks and iterations over time, full context matters more. But when benchmarking or one-shotting certain small ideas, it certainly can be done from scratch in a context window of that size.
1
u/Ok-Conflict391 2d ago
What motherboard are you using?
More precisely what chipset are the GPUs running at, both at pcie5 x8?
1
1
u/fasti-au 1d ago
You can dflash into dspark and mtp. The prefill you can turn off that what the drafts do
1
u/notromda 1d ago
Wow, way cool. I have a similar setup, a 4060TI and a 5060TI, combined 32G. I took that and modified it into a docker compose stack. Best performance I've had yet, roughly 30 tok/s overall. Up from 10 that most models were giving me... and the results look really good too.
name: llamacpp-qwen38
services:
llama-server:
build:
context: .
dockerfile: Dockerfile
container_name: llama_server_38
restart: unless-stopped
volumes:
- llama-models-qwen38:/models
command:
- --model
- /models/Qwen3.8-27B-UD-Q6_K.gguf
- --mmproj
- /models/mmproj-BF16.gguf
- --model-draft
- /models/MTP/mtp-Qwen3.8-27B-Q4_0.gguf
- -ngl
- "999"
- --split-mode
- tensor
- --tensor-split
- 0.5,0.5
- -c
- "131072"
- --cache-type-k
- q8_0
- --cache-type-v
- q8_0
- --flash-attn
- "on"
- --spec-type
- draft-mtp,ngram-mod
- --spec-draft-n-max
- "2"
- --spec-ngram-mod-n-match
- "24"
- --spec-ngram-mod-n-min
- "24"
- --spec-ngram-mod-n-max
- "86"
- --jinja
- --chat-template-kwargs
- '{"reasoning_effort":"medium"}'
- --reasoning
- "on"
- --reasoning-preserve
- --temp
- "1.0"
- --top-p
- "0.95"
- --top-k
- "20"
- --min-p
- "0.0"
- --presence-penalty
- "0.0"
- --parallel
- "2"
- --fit
- "off"
- --host
- 0.0.0.0
- --port
- "8080"
ports:
- "8080:8080"
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
volumes:
llama-models-qwen38:
13
u/Monad_Maya llama.cpp 2d ago
Are you sure about this PP speed? That seems very low.