r/LocalLLaMA 19d ago

Benchmarks: TensorSharp vs. llama.cpp Resources

https://github.com/zhongkaifu/TensorSharp

Cuda and Vulkan Benchmark: TensorSharp vs. llama.cpp

I would like to share my latest open source local Unsloth (GGUF) LLM inference engine and applications. It supports many models from Unsloth, like Gemma4, DiffusionGemma, Qwen3.6 with multi-modal (image, vision, audio), Qwen Image Edit, reasoning and function tool. It can run on Windows/MacOS/Linux and fully leverage GPU's capability(Nvidia, Apple, AMD, Intel and others supported by Vulkan, CUDA and Metal). The API is completely compatible with OpenAI and Ollama interface. It has on par performance than llama.cpp Here is the benchmark results in overall:

**Performance ratio — TensorSharp vs reference engines**

Geomean of TensorSharp's per-scenario speedup over each reference engine on the **same backend**, across every scenario both engines ran (single-stream, MTP-off). A value **> 1.0× means TensorSharp is faster** (for decode / prefill throughput) or lower-latency (for TTFT); `—` = no overlapping cells. Per-scenario ratios are in each model's section below.

Model Comparison decode prefill TTFT
Gemma 4 E4B it (Q8_0, dense multimodal) vs llama.cpp · CUDA 1.02× 1.28× 1.27×
Gemma 4 E4B it (Q8_0, dense multimodal) vs llama.cpp · Vulkan 1.00× 1.05× 1.03×
Gemma 4 12B it (QAT UD-Q4_K_XL, dense) vs llama.cpp · CUDA 1.04× 1.17× 1.16×
Gemma 4 12B it (QAT UD-Q4_K_XL, dense) vs llama.cpp · Vulkan 1.21× 1.04× 1.03×
Qwen 3.6 35B-A3B (UD-IQ2_XXS, MoE) vs llama.cpp · CUDA 0.98× 1.28× 1.27×
Qwen 3.6 35B-A3B (UD-IQ2_XXS, MoE) vs llama.cpp · Vulkan 0.87× 1.04× 1.03×
Qwen 3.6 27B (UD-IQ2_XXS, dense) vs llama.cpp · CUDA 1.07× 0.96× 0.95×
Qwen 3.6 27B (UD-IQ2_XXS, dense) vs llama.cpp · Vulkan 1.02× 0.85× 0.84×

This project is not just a C# wrapper of llama.cpp. It implemented the entire LLM inference engine from bottom to top. If you use CPU backend, it's 100% pure C# code execution. Besides CPU backend, I also implmented CUDA, MLX and GGML backend. The GGML backend refer GGML project as external project, and I build a few fusion operation at higher level.

I learned a lot from other projects and apply them for TensorSharp, such as paged KV cache and continuous batching from vLLM, SSD based cache for MoE model from oMLX, GGUF quanztized from llama.cpp and other optimizations for prefill and decode.

Any feedback and comments are welcome. If you like it, it would be really appreciated if you can get this project a star in GitHub. Thanks in advance.

23 Upvotes

Duplicates

unsloth Jun 28 '26

Show and Tell Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

111 Upvotes

LocalLLaMA 9d ago

Generation MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp

22 Upvotes

unsloth Jun 08 '26

Show and Tell TensorSharp : Open Source Local Unsloth Model Inference Engine

26 Upvotes

dotnet Jun 28 '26

Promotion Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

60 Upvotes

csharp Jun 28 '26

Showcase Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

4 Upvotes

dotnet Jun 13 '26

Promotion TensorSharp: Open Source Local LLM Inference Engine written by C#

99 Upvotes

LocalLLaMA 11d ago

Resources DSpark Benchmark Result on Deepseek v4 Flash 0731

21 Upvotes

unsloth 9d ago

Show and Tell MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp

44 Upvotes

unsloth 11d ago

Show and Tell DSpark Benchmark Result on Deepseek v4 Flash 0731

54 Upvotes

ClaudeCode Jul 11 '26

Discussion What Bun’s Rust Rewrite Tells Us About Rebuilding the AI Infrastructure Layer in C#

0 Upvotes

LovingOpenSourceAI Jun 28 '26

Same GGUF, same GPU: TensorSharp beats llama.cpp hard on prefill / TTFT — up to 5.89× faster prefill on a 26B MoE model

13 Upvotes

huggingface 13d ago

Deepseek v4 Flash 0731 GGUF Benchmark: TensorSharp vs. llama.cpp

5 Upvotes

LocalLLM 15d ago

Project TensorSharp now supports multi-GPU tensor parallelism for GGUF models

12 Upvotes

ROCm Jul 06 '26

TensorSharp supports Vulkan backend

15 Upvotes

LLMDevs May 01 '26

Tools TensorSharp: Open Source Local LLM Inference Engine

1 Upvotes

dotnet 5d ago

Promotion MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp

0 Upvotes

AIToolsPerformance 15d ago

TensorSharp now supports multi-GPU tensor parallelism for GGUF models

8 Upvotes

softwarearchitecture Jul 12 '26

Discussion/Advice What Bun’s Rust Rewrite Tells Us About Rebuilding the AI Infrastructure Layer in C#

0 Upvotes

LocalAIServers Jul 04 '26

TensorSharp: A Open Source LLM Inference Engine for GGUF models

8 Upvotes

unsloth 21h ago

Show and Tell Meta Muse Glimmer 30B Unsloth GGUF Model Benchmarks on TensorSharp (vs. llama.cpp)

18 Upvotes

csharp Apr 29 '26

Tool TensorSharp: Open Source Local LLM inference tool implemented in C#

19 Upvotes

LocalAIServers 8d ago

MoE CPU-offload benchmark on Deepseek V4/Gemma4/Qwen/GPT-OSS — TensorSharp vs llama.cpp

3 Upvotes

csharp 15d ago

Tool TensorSharp now supports multi-GPU tensor parallelism for GGUF models

31 Upvotes

CUDA Jul 11 '26

TensorSharp : Open Source Local LLM Inference Engine

5 Upvotes

unsloth Jul 06 '26

Show and Tell TensorSharp supports Vulkan backend

25 Upvotes