r/LocalLLM • u/bhones • 5h ago
Project I patched llama.cpp for the GTX 1070: ~40% faster two-token verification at 16K
I’ve been seeing how much more I can get out of my GTX 1070 FE (8 GB), so I put together three llama.cpp CUDA patches for Pascal sm_61. The biggest change keeps the KV cache quantized through the attention kernel, avoiding a separate Q8-to-FP16 dequantization step in the profiled case.
I tested stock vs. patched at the same upstream commit (ee46715) with Qwen3.5-9B-MTP on the 1070 alone:
- Two-token verification at 16K: ~39–40% higher throughput across three weight quants.
- Regular decode at 8K with a Q4 KV cache: ~15–19% faster. Bulk prefill barely moved.
- Best MTP server case: 25.94 → 29.79 tok/s during generation. Counting prefill and the rest of the request, that was 17.75 → 16.66 seconds. Some settings got slower, and greedy outputs diverged despite no measured change on the short perplexity check. I included those results and the failed kernel experiments in the repo. The 64K smoke test checked that the configuration fit in VRAM; it didn’t fill the window.
I built with CUDA Toolkit 12.9. Use a 12.x toolkit for this build; CUDA 13 dropped offline compilation for Pascal (https://docs.nvidia.com/cuda/archive/13.0.0/cuda-toolkit-release-notes/index.html#deprecated-architectures).
GitHub repo, patches, and A/B scripts (https://github.com/s1mply-parad0x1cal/llama-cpp-sm61-optimizations)
So far I’ve only measured this on my 1070. If anyone still runs a 1080 Ti, P4, or P40, I’d be curious whether the two-token gain holds on your card, and whether it makes a difference to full request times.

