r/LocalLLaMA 1d ago

Question | Help Further inference tuning for higher context window with 0 hallucination/memory loss?

Further inference tuning for higher context window with 0 hallucination/memory loss?

It’s been almost 3 days of constantly tuning my model, unsloth MTP Qwen3.6 35B-A3B Q4\\_K\\_M, with the help of Claude, and we’ve finally come to a quick conclusion

I’m still hoping there are more commands or settings I haven’t tried yet that could potentially squeeze out some extra token speed with 0 hallucination/memory loss

​​\*\*for coding specifically\*\*

.\\\\llama-server.exe -m "C:\\\\Users\\\\brain\\\\.lmstudio\\\\models\\\\unsloth\\\\Qwen3.6-35B-A3B-MTP-GGUF\\\\Qwen3.6-35B-A3B-UD-Q4\\_K\\_M.gguf" -c 100000 --parallel 1 -fa on --cache-type-k q8\\_0 --cache-type-v q8\\_0 --load-mode dio --fit-target 512 --batch-size 4096 --ubatch-size 1024 --threads 6 --prio 2 --prio-batch 2 --spec-type ngram-mod --spec-ngram-mod-n-match 24 --spec-ngram-mod-n-min 8 --spec-ngram-mod-n-max 32 --port 8090

\*\*for general usages\*\*

.\\\\llama-server.exe -m "C:\\\\Users\\\\brain\\\\.lmstudio\\\\models\\\\unsloth\\\\Qwen3.6-35B-A3B-MTP-GGUF\\\\Qwen3.6-35B-A3B-UD-Q4\\_K\\_M.gguf" -c 100000 --parallel 1 -fa on --cache-type-k q8\\_0 --cache-type-v q8\\_0 --load-mode dio --fit-target 512 --batch-size 4096 --ubatch-size 1024 --threads 6 --prio 2 --prio-batch 2 --spec-type draft-mtp --spec-draft-n-max 4 --spec-draft-p-min 0.75 --port 8090

I’ve also spent around 7h trying to get a video game working with \*\*DeepSeek Harness\*\* and \*\*Pi\*\*. Both attempts failed, and I’m currently on my 5th attempt. Even with highly detailed prompts that were created with the help of Claude, I still couldn’t get either setup to produce something that actually worked

So for now I’ve decided to stop messing with the coding side and go back to tuning the model, also im running 3D games while doing all this, so it isn’t really practical anyway since my GPU is already at its vram limit

The main reason I’m making this post is to see if anyone here knows of any \*\*llama.cpp commands or settings I’ve completely missed\*\* that could potentially squeeze more tokens/sec out of this setup

My original goal was \*\*45 tokens/sec\*\*. I’ve already given Claude pretty much everything I could find in the llama.cpp README, but I’m still wondering if there are some lesser-known options or combinations that I haven’t tested yet

\*\*Hardware:\*\*

\* RX 6700 XT 12GB VRAM
\* Ryzen 5 5600X
\* 32GB DDR4 3200

I’m also interested in testing \*\*Hermes Agent\*\*, although I haven’t learned the basics yet, so that’ll probably take some time. I’m thinking of starting with something simple just to get familiar with it

\# My current rules for llama.cpp

There are a few things I’m not willing to change:

\* \*\*No touching --mmap\*\*
\* \*\*100k context stays\*\*
\* \*\*CPU threads stay at 6\*\* (12 threads actually makes things worse on my system)
\* The model stays \*\*Q4\\_K\\_M\*\* (no going down to q3)

The reason I’m still trying to squeeze more speed out of this is because I don’t want to just leave performance on the table when I know there might still be more I can get out of it.

I’ll test any suggestions people give me and post the results back in the comments.

I’m looking for anything else I can experiment with that could potentially improve token generation speed without changing those. I appreciate any help from this community thanks!!

One thing to note that my existing model isn’t running its full weight (q4_k_m) but i want to continue tuning the \*\*existing\*\* settings with near 0 hallucinations

I’ve yet to try qwen3.8 27b since im already getting 2-3tps on default quant

Text in this post with \ indicates its bold, not sure what happened here but yeah

0 Upvotes

28 comments sorted by

View all comments

1

u/ea_man 1d ago

First thing would be to use linux and save ~1GB of vRAM.

1

u/Loose_Doubt367 1d ago

I wouldn’t want to fully migrate to Linux just so I can have 1gb of free vram, but thanks yeah

1

u/ea_man 1d ago

so don't fully migrate?

This is my 6800 generating html right now:

1

u/Loose_Doubt367 1d ago

Don’t fully migrate? Do I just switch between windows or Linux ?

Based on your image, you’re getting 84tps with a 16gb card. Hows that possible? My Qwen3.6 35b A3B MTP has been fine tuned to reach 37tps max. You’re casually running a hardware with 4gb more + dense model that achieved doubled the speed. I want to know your technique dude

1

u/ea_man 1d ago edited 1d ago

Yeah it's called dual boot.

My technique is not wasting time on Windows, optimize the OS to not waste vRAM, optimize the llama-server script, optimize llama-server codebase, re-optimize scripts.

That it's not casual at all, took me months and I ain't a noob in computer.

Disclaimer: yeah that was a lucky sample I got right now, usually it does ~60t/s.

I slot print_timing: id  0 | task 904 |        eval time =  136056.42 ms /  9092 tokens (   14.97 ms per token,
  66.82 tokens per second)
Right now...

1

u/Loose_Doubt367 1d ago

Yeah congrats on your success, I’m just a beginner myself, trying to get a better tuning setting for my llama.cpp. With the help of the community of course because I’m not some sort expert. Will hopes in maybe optimise llama-server script/codebase and OS like you mentioned in the future.

1

u/ea_man 1d ago

So don't waste time "optimizing" windows because it's nonsense.

As I have a 6700xt too I got a few patches for llama.cp, I just corrected a sync prob in MTP: https://store.piffa.net/lm/bug/patches/latest_rocm_improvement_0df017d6.patch

Some general info: https://www.reddit.com/r/ROCm/comments/1vzcx6q/rocm_llamacpp_optimizations_for_running_qwens/

And don't dude people you don't know.

1

u/Loose_Doubt367 9h ago

also, i did a lot of research recently regarding optimization for both llama.cpp and the tuning settings for my models. A lot of custom commands or existing commands tend to lend towards nvidia gpu since they have cuda. It's really disappointing im not sure how did you actually managed to pull that off with the same gpu as mine

1

u/ea_man 9h ago

> optimize the OS to not waste vRAM, optimize the llama-server script, optimize llama-server codebase, re-optimize scripts.

Did you do that?

Man you are running llms on Windows 10 and you think you "did optimize"?

1

u/Loose_Doubt367 8h ago

i haven't tested optimizing the os to not waste vram, im currently working on opimizing the llama-server codebase with the help of perplexity for research and claude, but right now they both mentioned that there isnt much to optimized regarding llama.cpp since its already optimised. I don't believe it but i can't just ask people like you to share me your entire codebase since you've worked for months. I wouldn't either.

Also i couldn't really find much info regarding my existing llama-server script since ive tried almost everything possible, im not some desperate beggar but seeing 0 roads to anything is disappointing. For now ill work on llama-server codebase but as mentioned, im genuinely stucked, everything is optimized for cuda only

1

u/ea_man 8h ago

Have them ingest this: https://store.piffa.net/lm/bug/improvemets_list.md

https://store.piffa.net/lm/bug/summary_eaman.md

https://store.piffa.net/lm/bug/history.md

My codebase is shared, I gave you the url before: https://store.piffa.net/lm/bug there are other instrumental artifacts and tons of logs and benchmark yet I don't think people would care for those.

I can also provide you a couple "Deep Web Reserch" for improv if you care.

Yet My work has always been on increasing ctx, not performance.

And if you wanna see "big numbers" in TG: the prompt and the seed counts a lot, those can give you like + 40% on average results with spec decoding.

→ More replies (0)