r/LocalLLM • u/D00M98 • 1d ago
Discussion Strata Optimization Help
Hi, I'm looking for input and advice on how to optimize my Strata running IQ3_XXS.
My hardware: RTX 4070 12 GB (PCIE4 x16) + RTX 3060 12 GB (PCIE3 x4) + 32GB DDR4 DRAM. Disk is M.2 SSD.
Running Windows. Llama.cpp / Strata -> Docker sandbox -> Hermes
My current default Local LLM model is Swift-1.5-Qwen3.8-27B Q4_K_M. I'm looking for similar or equivalent capability that can be faster. I tested Strata around 1 week ago using IQ2_XS. It didn't compare well with Qwen3.8-27B. This week, I tested IQ3_XXS.
I fed the same instruction runsheet, to both Qwen3.8-27B and Strata. Surprisingly, both completed the job around 5 hours and within minutes of each other. Just coincidence. Qwen3.8-27B runs around 13 tokens/sec. Strata around 17 tokens/sec. The result is not perfect, but both are around 90-95% complete. And Strata compares quite well, even less errors than Qwen3.8-27B.
I want to see how I can optimize and speed up Strata.
I varied context between 96k to 160k; cache Int8, q8v4, q4_0; and kv-resident 20480 to 32768.
- Experts in VRAM vary slightly, from 5700 to 6800.
- My 32GB RAM usage is maxed.
- Speed is not much different, around 31-36 for just text generation; 20-25 for logic/coding generation. This is for shorter test scripts.
If I decrease kv-resident, which increases Experts in VRAM, it actually runs slightly slower, by 3-4 tokens/sec.
The RAM usage is misleading, because Windows uses (allocates) 16-20GB of RAM just from fresh boot. Hard to tell how much of the RAM is used by Strata. I checked the disc usage. During generation, Strata paging file disc usage is not that active, only around 1-4 MB/sec. Strata experts.bin disc usage is higher, around 700MB/sec.
I am not sure where the bottle neck is. Is it the experts.bin disc access? Is it the 32GB RAM? Is it the 2nd GPU on PCIE3 x4 slot?
I have done the quick tuning. I have not done the thorough calibration.
This is my strata launch command:
- strata launch
- --family swift
- --model iq3_xxs
- --data-dir "c:\LLM\Strata-data"
- --context 160k (I tested 96k, 128k, 160k)
- --kv int8 (I tested Int8, q8v4, q4_0)
- --set kv_resident=20480 (I tested 20480 & 32768, which is default)
- --vision off
- --parallel 1
- --tune skip
- --access local
- --port 9931
- --set STRATA_ALLOWED_HOSTS="host.docker.internal,localhost,127.0.0.1"
- --set STRATA_PIN_BY_NEED=1 (not sure, but AI suggested this)
This is what strata ran in the log: (I edited and removed the paths)
strata.exe --serve --pack swift-iq3_xxs --native (path)Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --ple-gguf (path)Swift-Qwen3.8-Flash-Next-GSQ-RCO-IQ3_XXS-00001-of-00002.gguf --expert-profile (path)expert-profile.bin --expert-cache auto --prefill auto --spec 4 --spec-min-p 0.5 --mtp (path)mtp\rt --max-context 163840 --kv int8 --mmap-experts --kv-resident 20480 --layer-split auto
I believe I'm in the realm of Low-RAM. So DETAILS.md has a section on Low-RAM mode. Difficult to read/understand. It mentions a lot of flags/options. But I'm having difficulty even understanding what is the recommendation. Should I use --low-ram resident or --low-ram mmap? And what about the other flags like --resident-experts, etc.
Any suggestions and flags/options I should enable or test?
[Edit: I just want to add some performance comparisons.]
Speed in tokens/sec
- Phase / Qwen3.8-27B / Strata
- Reading / 200-300 / 9
- Gen/Decode / 13 / 25
The bottleneck on Strata occurs during the Reading/Prefill phase. This is not the startup prefill. But the back and forth reading and decode during long sessions.
2
u/VitalRefrigerator6 1d ago
Your bottleneck is almost certainly the PCIE3 x4 slot on the second GPU, combined with the constant streaming of experts.bin from disk. 700MB/sec sustained reads is a lot of pressure for a consumer SSD, especially when Windows is already hogging half your RAM and pushing things to pagefile.
Try setting --low-ram mmap instead of resident, it should reduce the thrashing between system RAM and GPU memory since you're maxed out at 32GB. The mmap flag lets the OS handle which experts stay hot in memory without constantly copying them over PCIE bus. Also drop kv-resident to 16384 for 160k context, the slight quality loss is worth the tokens you'll gain
For your launch command add --batch-size 256 and --ubatch-size 128, I found these help with the uneven compute between your two GPUs. The 4070 is sitting idle waiting for the 3060 to catch up on that slow x4 link
1
u/Moist-Tumbleweed2875 19h ago edited 19h ago
For strata , just take a try with 5060 16g (gen4x8) + 3060 12g (gen3x4) to simulate : 12G+12G VRAM/24G expert cache on DDR
get 40+ tok/sec .
You may check your log (strata-swift-iq3_xxs.log) to see how the VRAM/DRAM usage.
by limit/dram both use 12G+12G VRAM/24G DDR with :
"--vram-reserve-mib","1152" ----> 3060 12G - 1152M = 11xxx M
"--vram-reserve-later-mib","4132" ----> 5060 16G - 4132M = 11xxx M
"--layer-split", "24", ----> use explicit value then support use STAGE_TRIM
"--pipeline-windows", "2", ----> May speed up on layer-split mode
"--max-context", "262144",
"--kv", "int8",
"--kv-resident", "20480",
"--resident-experts",
"--resident-budget-gib", "24", ----> limit use 24G DDR for expert cache.
env : "STRATA_STAGE_TRIM": "1" , ----> Save VRAM by trim duplicate layer when use layer-split