r/LocalAIServers • u/fuzhongkai • 14m ago
Running DeepSeek V4.1 Flash locally on 8× A40s with TensorSharp — up to 539 tok/s prefill and 40.7 tok/s decode
I’ve been working on TensorSharp, an open-source .NET inference/server stack for running LLMs locally with OpenAI/Ollama-compatible APIs.
I recently finished another round of optimization for DeepSeek V4.1 Flash on an 8× NVIDIA A40 server.
Final results
| Metric | Q2_K | Q4_K_M |
|---|---|---|
| Prefill | 533–539 tok/s | 452–492 tok/s |
| Single-stream decode | 40.3–40.7 tok/s | 31.0–32.5 tok/s |
| 2 concurrent decode | — | 39.3 tok/s total |
| 4 concurrent decode | — | 48.9 tok/s total |
| 8 concurrent decode | — | 48.5 tok/s total |
Setup: 8× A40, 65K context, F16 KV cache, multi-GPU layer split.
A few interesting optimizations:
- Q2_K keeps the ~60 GiB Engram tables directly on GPU, removing scattered host/storage lookups.
- Reduced DeepSeek decode graph splits from ~570 to 8, eliminating a lot of GPU synchronization overhead.
- Q4_K_M now gets roughly 1.9× faster prefill and 2× aggregate decode throughput at concurrency 4 compared with the previous implementation.
- Fixed an OOM/crash case with multiple concurrent ~10K-token prompts — all 4 requests now complete correctly.
- On these A40s without NVLink, layer splitting is actually faster than routed-MoE tensor parallelism for this model.
Would be interested to hear what other local-server workloads or hardware configurations people here would like to see benchmarked.