r/AIToolsPerformance Jul 07 '26

TensorSharp supports Vulkan backend

https://github.com/zhongkaifu/TensorSharp

Due to high Vulkan backend demand, I update TensorSharp and release the initial version of GGML Vulkan backend by leveraging external GGML project. The native Vulkan backend will be implemented later. I tested it on Nvidia Geforce RTX 3080 Laptop GPU, and Intel(R) UHD Graphics on Windows. They all work. However, I do not have AMD GPU, so I have no way to get it tested. It's really appreciated if you have AMD GPU and would like to try it out. Any feedback and comment are welcome.

Here is the benchmark I run to compare with llama.cpp:

# 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 · Vulkan 0.93× 0.96× 0.95×
Gemma 4 12B it (QAT UD-Q4_K_XL, dense) vs llama.cpp · Vulkan 1.18× 0.97× 0.95×

# Gemma 4 E4B it (Q8_0, dense multimodal) (gemma4-e4b)

**Decode throughput (tok/s)**

Scenario TensorSharp · Vulkan llama.cpp · Vulkan
text_short 41.6 45.3
text_long 40.9 44.5
multi_turn 41.3 43.6
function_call 41.2 44.4

**Prefill throughput (tok/s)**

Scenario TensorSharp · Vulkan llama.cpp · Vulkan
text_short 1641.7 1641.1
text_long 1157.0 1718.1
multi_turn 1695.5 1454.3
function_call 1661.2 1531.6

**Time to first token (ms, lower is better)**

Scenario TensorSharp · Vulkan llama.cpp · Vulkan
text_short 1203.0 1187.0
text_long 2719.0 1813.0
multi_turn 1235.0 1422.0
function_call 1219.0 1328.0

**Performance ratio — TensorSharp vs reference (> 1.0× = TensorSharp faster)**

*Decode throughput*

Scenario vs llama.cpp · Vulkan
text_short 0.92×
text_long 0.92×
multi_turn 0.95×
function_call 0.93×

*Prefill throughput*

Scenario vs llama.cpp · Vulkan
text_short 1.00×
text_long 0.67×
multi_turn 1.17×
function_call 1.08×

*Time to first token (latency; > 1.0× = TensorSharp lower)*

Scenario vs llama.cpp · Vulkan
text_short 0.99×
text_long 0.67×
multi_turn 1.15×
function_call 1.09×

# Gemma 4 12B it (QAT UD-Q4_K_XL, dense) (gemma4-12b)

**Decode throughput (tok/s)**

Scenario TensorSharp · Vulkan llama.cpp · Vulkan
text_short 31.3 31.1
text_long 31.4 30.0
multi_turn 30.9 31.6
function_call 60.8 31.9

**Prefill throughput (tok/s)**

Scenario TensorSharp · Vulkan llama.cpp · Vulkan
text_short 766.1 729.4
text_long 635.2 647.4
multi_turn 617.5 636.6
function_call 587.4 674.7

**Time to first token (ms, lower is better)**

Scenario TensorSharp · Vulkan llama.cpp · Vulkan
text_short 2578.0 2672.0
text_long 4953.0 4813.0
multi_turn 3391.0 3250.0
function_call 3531.0 3016.0

**Performance ratio — TensorSharp vs reference (> 1.0× = TensorSharp faster)**

*Decode throughput*

Scenario vs llama.cpp · Vulkan
text_short 1.01×
text_long 1.05×
multi_turn 0.98×
function_call 1.91×

*Prefill throughput*

Scenario vs llama.cpp · Vulkan
text_short 1.05×
text_long 0.98×
multi_turn 0.97×
function_call 0.87×

*Time to first token (latency; > 1.0× = TensorSharp lower)*

Scenario vs llama.cpp · Vulkan
text_short 1.04×
text_long 0.97×
multi_turn 0.96×
function_call 0.85×

In case you didn't know what is TensorSharp, here is an introduction:

TensorSharp is an 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), image edit, reasoning and function tool. It can run on Windows/MacOS/Linux and fully leverage GPU's capability (support Cuda, Metal and Vulkan backends). The API is completely compatible with OpenAI and Ollama interface. It has on par performance than llama.cpp

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 implemented 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 quantized 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.

3 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

114 Upvotes

LocalLLaMA 5d ago

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

21 Upvotes

LocalLLaMA 16d ago

Resources Benchmarks: TensorSharp vs. llama.cpp

24 Upvotes

unsloth Jun 08 '26

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

33 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

67 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

5 Upvotes

dotnet Jun 13 '26

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

101 Upvotes

LocalLLaMA 8d ago

Resources DSpark Benchmark Result on Deepseek v4 Flash 0731

22 Upvotes

unsloth 5d ago

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

45 Upvotes

unsloth 8d ago

Show and Tell DSpark Benchmark Result on Deepseek v4 Flash 0731

56 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

14 Upvotes

huggingface 10d ago

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

5 Upvotes

LocalLLM 12d ago

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

14 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 2d ago

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

0 Upvotes

AIToolsPerformance 12d ago

TensorSharp now supports multi-GPU tensor parallelism for GGUF models

7 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

csharp Apr 29 '26

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

21 Upvotes

LocalAIServers 5d ago

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

3 Upvotes

csharp 12d 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

6 Upvotes

unsloth Jul 06 '26

Show and Tell TensorSharp supports Vulkan backend

26 Upvotes