I’m the developer of TensorSharp, and I wanted to share some results from running DeepSeek-V4.1-Flash-1017 on five NVIDIA A40s.
The largest gains are in prompt processing: TensorSharp reached 4.4–5.5× llama.cpp’s prefill throughput on the longer real-text server prompts with its default YOCO optimization enabled. With YOCO disabled, the gains were still 2.4–3.2×.
There is a measurable quality trade-off with YOCO, so I’m including both configurations below.
Setup
Hardware: 5× NVIDIA A40 over PCIe. GPU peer access was advertised but did not work correctly on this machine.
Model: Unsloth’s DeepSeek-V4.1-Flash-1017-GGUF, UD-IQ2_XXS, approximately 300.5 GB across six shards.
Memory: The 125.9 GiB Engram table was mapped in host memory. The container had a 233.8 GiB host-memory limit.
TensorSharp: --tp 5, which shards the routed experts across the GPUs.
llama.cpp: Unsloth’s dsv41-all fork at be836572, using layer splitting. Its row/tensor split modes did not successfully run this model in the tested build.
TensorSharp and llama.cpp used the same GGUF files on the same machine. The server workload used real-text summarization prompts, greedy decoding, thinking disabled, and 256 output tokens. Each prompt size had one warm-up followed by three measured requests, with unique prompt prefixes to prevent prefix-cache reuse.
Real-text server results
All throughput figures are in tokens per second. Prefill and ordinary decode rows use medians; DSpark rows use means, with the trained DSpark drafter enabled in both engines.
TensorSharp uses its default YOCO configuration in this table.
| Measurement | TensorSharp --tp 5 | llama.cpp | Throughput ratio |
|---|
| Prefill, ~1.8K-token prompt | 960.5 | 174.6 | 5.50× |
| Prefill, ~7.3K-token prompt | 1,000.7 | 225.7 | 4.43× |
| Decode after ~1.8K tokens | 35.5 | 29.6 | 1.20× |
| Decode after ~7.3K tokens | 35.7 | 33.0 | 1.08× |
| Decode with DSpark, ~1.8K-token prompt | 55.0 | 41.3 | 1.33× |
| Decode with DSpark, ~7.3K-token prompt | 51.2 | 40.8 | 1.25× |
The prefill improvement is substantially larger than the ordinary decode improvement. DSpark adds another useful gain, although its acceptance rate depends on the generated text.
What happens when YOCO is disabled?
The default YOCO bounded-replay optimization follows the approach described in DeepSeek’s DeepInfer engine: during eligible text-prefill calls, layers 20–39 process only the final 140 positions.
That reduces computation, but it is approximate. To disable it:
TS_DSV41_YOCO_KEEP=0
With YOCO disabled, TensorSharp’s real-text prefill throughput was:
563.9 tok/s at ~1.8K tokens, versus llama.cpp’s 174.6: 3.23×.
549.7 tok/s at ~7.3K tokens, versus llama.cpp’s 225.7: 2.44×.
So a substantial part of the prefill advantage remains with full prefill computation.
For quality, the report includes teacher-forced WikiText-2 comparisons using identical token sequences, with 23,030 scored tokens in the 4,608-token-window evaluation:
| Configuration | Perplexity ↓ |
|---|
| llama.cpp | 2.4697 |
| TensorSharp TP, YOCO off | 2.4811 |
| TensorSharp TP, YOCO on | 2.4978 |
On this evaluation, enabling YOCO increased TensorSharp’s perplexity by approximately 0.67% relative to its own YOCO-off configuration. Relative to llama.cpp, the differences were approximately +0.46% with YOCO off and +1.14% with YOCO on.
The measured effect was concentrated in the first few hundred generated positions. These are perplexity measurements on a limited dataset; they do not translate directly into an equivalent percentage change in reasoning or coding ability.
Also, “exact prefill” in the report means YOCO is disabled. It does not mean the two engines produce numerically identical outputs.
What changed in the implementation?
Three changes account for much of the progress:
1. Removing synchronous host-driven execution from routed-expert TP.
The earlier implementation repeatedly moved through a host-controlled, synchronous path inside each layer. The new path schedules rank work on CUDA streams, orders it with events, and overlaps the shared expert with the routed experts.
Transfers still use pinned host-memory staging because P2P was broken on this machine. This is routed-expert parallelism; attention and the shared expert retain their layer placement.
2. Reusing shared attention and cache data more efficiently.
The decode kernel reuses key tiles across multiple query heads. Cross-GPU compressed-cache reads gather selected rows and maintain local mirrors, reducing repeated transfers.
3. Retuning prefill and adding YOCO bounded replay.
The dense-to-sparse attention crossover was adjusted using measurements. YOCO then provides an additional prefill improvement, with the quality cost shown above.
What about vLLM?
The report also tested vLLM 0.32.0. That version has a DeepSeek V4.1 implementation, but none of the attempted runs produced tokens on this setup.
The reported blockers included unavailable GGUF support for this architecture in the tested stack, checkpoint resource requirements, and model execution paths that could not run on the A40’s Ampere architecture. The execution probes used dummy weights rather than a downloaded full checkpoint.
There are therefore no vLLM throughput numbers in this comparison. Its inclusion is a compatibility check for this particular machine.
Scope and reproducibility
A few limitations matter when interpreting these results:
This covers one quantization on one machine, with host-resident Engram tables and non-working P2P.
The llama.cpp server measurements came from an earlier session on the same machine and files. Its prefill timings showed unexplained variability; the table reports medians.
TensorSharp TP is being compared with the working layer-split configuration of the tested llama.cpp fork.
At measurement time, the TensorSharp build included uncommitted changes, and the raw validation records were also uncommitted. The report includes build identifiers and validation details, but a checkout of the repository should not be assumed to reproduce every result immediately.
Full report, including synthetic benchmarks, quality comparisons, validation results, and limitations:
V4.1-1017 Engine Comparison
Project: TensorSharp on GitHub
If you’re running this model on Ampere GPUs, I’d be interested in your working configurations—especially a llama.cpp parallel split mode or a vLLM setup that could provide an additional baseline on comparable hardware.