Repository navigation
Sharplight 0.3
The second stable release of Sharplight and Sharplight Studio. 0.3 adds a native CUDA execution provider next to Vulkan, CPU and
Metal, brings LLM serving to vLLM's level on the same GPU, runs mixture-of-experts models far larger than GPU memory (experts in
system memory or on disk), adds video enhancement, many new speech, audio, vision and image models, and makes the task API
consistent across every model kind.
Packages: NuGet 0.3.N (N = the git height of release/v0.3; the GitHub release v0.3.N carries the Studio installers).
dotnet add package SharplightAll performance numbers below were measured on one NVIDIA RTX PRO 4500 Blackwell (32 GB) under Linux, against the other engine on
the same GPU with the same model files and the same statistic. Sections refer to
docs/benchmarks.md.
Highlights
- CUDA execution provider (
Sharplight.Cuda, driver API only; NVRTC and the CUDA runtime libraries ship as
Sharplight.Cuda.Runtime, no CUDA toolkit needed). Tensor cores, hand-written f16 / bf16 / FP8 / MXFP4 / NVFP4 GEMMs, CUDA graphs,
FlashAttention-2-style prefill and tensor-core decode attention, programmatic dependent launches, stream-K. The generated kernel
library is shared with Vulkan, and Vulkan stays a first-class provider (within a few per cent of CUDA on most workloads). - LLM serving at vLLM's level (vLLM 0.33, same GPU, same weights): throughput 0.99-1.03x at 16 and 64 streams with about half
the time to first token (§104); at 256 streams with mixed request lengths 1.04-1.22x (§105). Every serving run checks its batched
text against single-sequence output. - Quantized formats on tensor cores: block-scaled FP8 (on by default where the weights and GPU support it), native MXFP4 expert
GEMMs (gpt-oss), native NVFP4 / W4A4 on Blackwell (§106), K-quant GGUF GEMMs on CUDA and Vulkan cooperative matrices. - Models larger than the GPU: routed experts on the CPU (like llama.cpp's
--n-cpu-moe, 1.2-1.6x llama.cpp on Vulkan and
0.99-1.6x on CUDA, §107 / §111) and experts on disk for models larger than RAM + VRAM (DeepSeek-V3.1 Q4_K_M, 405 GB, on a
62 GB RAM / 32 GB GPU machine; io_uring reads with a cache, §85-§87). - Batched generation far ahead of llama.cpp on the same GPU: 1.6-3.2x tokens per second at 16-64 sequences on Vulkan, 1.1-2.0x on
CUDA (§107). - Video enhancement: SeedVR2 3B / 7B (
IVideoEnhancer, kindvideo-enhancement) on CPU, Vulkan and CUDA, faster than the official
PyTorch inference (3B, 33 frames: 240p→480p 8.9 vs 10.1 s, 360p→720p 24.8 vs 35.3 s, ~49 dB parity), with memory constant in clip
length (960p output runs where the reference runs out of memory on 32 GB; §108, §110). - 16-bit convolutions: channels-last f16 / bf16 implicit-GEMM convolution, 2-3x faster on CUDA and Vulkan (VAE decoders, video
VAEs, CNNs), and an automatic bf16 fallback for components whose activations overflow f16 (SDXL's VAE: 11.2 → 67.8 dB at the
same speed; §110, §112). - Serving features: vLLM-style automatic prefix caching (also for hybrid recurrent models), image and audio inputs in the batched
engine, window-sized KV caches, KV cache types f16 / q8_0 / q4_0 / FP8 (E4M3, opt-in), a KV admission policy at KV saturation
(queue by default, or preempt with recomputation; §109), adaptive step budgets. - Multi-node pipeline parallelism (preview):
Sharplight.Distributedsplits a model over remote segment workers (TCP / mTLS).
New models
- Text: Gemma 4 (incl. vision tower), Gemma 3 from Hugging Face, Qwen3.5 / Qwen3.8, Qwen3-Coder-Next, gpt-oss 20b / 120b, huge MoE checkpoints verified with experts on disk (DeepSeek-V3.1, DeepSeek-V4-Flash, GLM-5.2;
Kimi K3 on a truncated checkpoint). - Speech to text: Cohere Transcribe, Voxtral Mini 4B Realtime, Nemotron 3.5 ASR streaming, Qwen3-ASR 0.6B, VibeVoice ASR.
- Text to speech: Qwen3-TTS, VibeVoice 1.5B, OmniVoice (with the Higgs Audio v2 codec), Sesame CSM-1B, Dia-1.6B, VoxCPM2.
- Audio and music: Stable Audio Open 1.0, Stable Audio 3, ACE-Step 1.5 turbo text-to-music.
- Vision: GLM-OCR (text, formulas, tables) with PP-DocLayoutV3 layout and a
DocumentReaderpipeline, Depth Anything 3, RF-DETR,
DINOv3, MobileNetV3, EfficientNet / EfficientNetV2. - Image generation and editing: Qwen-Image-Edit 2509 / 2511, InstructPix2Pix, SDXL refiner, SD-Turbo, FLUX.2 Klein 9B and base 4B,
undistilled Z-Image. - Video: SeedVR2 3B / 7B enhancement.
Sharplight Studio
- CUDA provider on Linux x64 / arm64 and Windows x64, with a per-GPU provider choice.
- Model feed as an install source (signed, verified resumable installs, stable and unstable channels), a first-run welcome flow
with starter models, licence acceptance for restrictive licences, storage overview and safe cleanup. - New load options: CPU offload and experts on disk, block-scaled FP8 and FP4 (W4A4), step floor, prompt rows per slot,
KV admission policy and the FP8 KV cache; options that do not apply to the device or model are disabled with the reason. - Enhance page for video-enhancement models with a live before/after comparison (blend slider or split divider, always the
newest finished frame while running, scrub and play). - Pages for the new speech, TTS, audio and music models (multi-speaker scripts, voices, lyrics), a Search page with hybrid search and
answers with citations, the embedded API server for every resident task model. - Headless UI tests in CI, published-build smoke tests, page screenshots for every page.
Breaking changes since 0.2
The task API is now the same across every model kind (CHANGELOG.md lists every member):
- Text embeddings and reranking are task clients (kinds
text-embedding,text-reranking):ITextEmbedder.EmbedAsync/
EmbedTokensAsyncandITextReranker.RerankAsyncreplaceEmbed/EmbedTokens/Score; register withAddTextEmbedder(...)/
AddTextReranker(...).EmbeddingModel,Reranker,EmbeddingLoadOptions,RerankerLoadOptionsand the hosting embedding /
reranker loaders are removed;SharplightEmbeddingGenerator.Loadis removed. - Seeds are
long?everywhere. Seeds within theintrange reproduce earlier output bit for bit. - Audio and music generation follow the image / video shape:
GenerateAsync(request, options)returns a result with audio and
seed,GenerateStreamingAsyncyieldsAudioGenerationUpdates,Defaultsrecords replaceDefaultSteps/Supports*; steps,
guidance and seed moved from the request to the options. TheIProgressparameters are gone. - Typed
DefaultsonIImageGenerator,IVideoGenerator,IVideoEnhancerreplaceGetService(typeof(...Defaults)). - Vision and audio per-request options are immutable records (
with). - Renamed:
UpscaleOptions→ImageUpscalingOptions,EmbedOptions→TextEmbeddingOptions,
IVoiceActivityDetector.ProbabilitiesAsync→ComputeProbabilitiesAsync;IImageUpscaler.UpscaleAsynctakes an
IProgress<double>parameter. VideoEnhancementUpdatepositional order is(Phase, Batch, TotalBatches, Result, Frames).- Performance A/B environment switches were removed with their non-default paths (
SHARPLIGHT_CUDA_PDL_SHARED,
SHARPLIGHT_CPU_POOL,SHARPLIGHT_EXPERT_CACHE,SHARPLIGHT_STREAM_*,SHARPLIGHT_SHARED_ARENA,SHARPLIGHT_VK_TRANSFER_QUEUEand
others; full list inCHANGELOG.md). - Block-scaled FP8 is on by default where it applies (
TaskLoadOptions.BlockScaledFp8,--fp8-block-scaled).
Where Sharplight is behind
- Prompt processing on Vulkan against vLLM: 0.70-0.90x on Qwen3-8B (bf16 and FP8) at 512-8192 tokens.
- Inter-token latency tail at 16 streams against vLLM: p99 48-85 ms against 21-28 ms (mean 2-5 % higher).
- gpt-oss-120b with experts in system memory on CUDA: prompts 0.85x of llama.cpp (0.96x with all experts page-locked).
- Gemma 4 31B on CUDA, one sequence: 0.98x of llama.cpp; GLM-5.2 from disk 0.75x of llama.cpp in a first run.
- TensorRT is ahead on 6 of 19 ONNX cases by 1.08-1.23x (onnxruntime is behind Sharplight on all 23 measured cases).
- FP8 KV cache: functional and opt-in; its serving numbers against vLLM are still being measured.
- Only one GPU model (NVIDIA RTX PRO 4500 Blackwell) has been benchmarked; AMD, Intel and Apple hardware pass the test suites but have
no published numbers.
Known issues
- Unsigned packages: Windows SmartScreen and macOS Gatekeeper warn on first start of Studio.
- Metal is a preview (verified on GitHub's virtual M1 runner only).
- SeedVR2: no VAE tiling yet (1080p output does not fit 32 GB), recompiles at 720p and above, no FP8 / GGUF weights; the 7B model has not
been re-timed after the convolution work. - CosyVoice streaming on the CPU differs from the non-streaming output (relative RMS 0.43); under investigation.
- Studio: the comparison view keeps preview frames within a 1 GiB budget; very long clips drop their oldest preview frames (the
written file is complete).