Repository navigation
llama.cpp tuned for NVIDIA Tesla P100 (Pascal, sm_60): v5.45 rebased onto upstream
af5c58347 (+136 commits). Drafting qwen35-family servers now keep
their recurrent state with upstream's GDN replay (ggml-org#31669), which needs about 70 % less recurrent-state memory. The series'
GDN and conv fusions were rebuilt for the replay graph. gemma4, nemotron and glimmer give bit-identical output to v5.45. Other GPUs
keep upstream's code paths.
What changed since v5.45
- Upstream GDN replay (ggml-org#31669). All Swift entries and Flash-Next MTP replay pending tokens into the recurrent state instead of
storing per-draft snapshots (2394 -> 653 MiB on Swift). Upstream has no opt-out. - Fusions on the replay graph.
- The GDN decode fusions take the replay's pending gathers.
- The replay conv window (gathers, concat, transpose, conv, silu) runs as one kernel.
GGML_CUDA_GDN_FUSE=0switches them off, with the same outputs either way.GGML_CUDA_GDN_FUSE_MASK(bisect) andGGML_CUDA_GDN_DEBUG(diagnostics) are new knobs.
- Bit-exact in-kernel q/k norm.
- The fused GDN kernel now rounds exactly like the separate norm, so fused == unfused.
- v5.45's fused path rounded differently, so qwen36 / ornith / Swift decode outputs change.
- KL divergence vs F32 is equal or better: qwen36 decode 0.00154 -> 0.00129, ornith 0.0131 -> 0.0100.
- Prefill is identical. Flash-Next MTP acceptance goes 0.55 -> 0.59.
- Batched segmented copies under
-sm tensor.- Reading or writing a split tensor stored in segments is now one 2D copy per segment and device. This covers state saves /
restores and the fused qkv weights at load. - Before, it was one copy per repeat: a Swift state save made about 12x more host copies.
- The bytes are the same, and the save files are byte-identical. Opt-out:
GGML_META_SEG_2D=0.
- Reading or writing a split tensor stored in segments is now one 2D copy per segment and device. This covers state saves /
Gate (2x Tesla P100 16 GB; gates G46 vs v5.45, G46B confirm)
-
Op tests:
test-backend-opspasses in 47 op groups, including the newGDN_REPLAY_FUSIONandCONV_REPLAY_FUSIONcases. -
gemma4 / nemotron / glimmer are bit-identical to v5.45. This covers KL divergence, served texts and the kernel census.
-
Every fused path equals the unfused one: served texts on all 4 Swift entries, Flash-Next MTP 18/18.
-
Long context 6/6, allocator audit 12/12,
--parallel 2checks: all pass. -
Soaks: gemma4 819 + 393 requests, Swift 122 + 122, Flash-Next 250, no failures.
-
Copy batching (G46B):
- Slot save files are byte-identical with and without it, on 8 tensor-split entries.
- KL divergence, served texts, multi-turn outputs and Flash-Next MTP are identical.
- The kernel census shows the same kernels and only fewer host copies (Swift device-to-host -92 %).
-
Speed vs v5.45:
v5.45 v5.46 gemma4 / nemotron / glimmer / qwen36 / ornith serving flat Swift serving decode (4 entries) -2..-5 % Swift multi-turn follow-up prompt (median) 670 ms 677 ms Flash-Next decode within load-to-load noise The Swift decode cost is the replay's extra work: gathers and conv windows each step. The copy batching recovers the multi-turn
prompt time. Folding the gathers into the GDN kernel is planned for v5.47.
Performance vs stock llama.cpp
Serving decode with production settings, as measured for v5.28-v5.32: gemma4 1.68x, Swift 27B 1.68x, qwen36 / ornith 1.52x,
glimmer 1.65x, nemotron 1.33x, Qwen 3.8 Flash-Next 1.71x. Since then:
| Release | Gain |
|---|---|
| v5.33 | ~8 % on batched gemma4 decode |
| v5.35 | 2-5 % on qwen36 / ornith |
| v5.37 | 28 % on nemotron prefill |
| v5.38 | 7-10 % on qwen36 / ornith, ~3 % on Swift decode |
| v5.44 | 6-8 % on qwen36 / ornith, 3-4 % on gemma4 serving decode |
| v5.45 | 1.35-1.72x on Flash-Next prompt reading |
| v5.46 | -70 % recurrent-state memory on drafting servers; Swift decode -2..-5 % |
Step-by-step numbers: docs/p100/PERFORMANCE.md.
Build
cmake -B build -DGGML_CUDA=ON -DCMAKE_CUDA_ARCHITECTURES=60 -DCMAKE_BUILD_TYPE=Release
cmake --build build -jDeveloped with CUDA 12.4. Two cards: -sm tensor and GGML_CUDA_P2P=1. See P100-SERIES.md.
Credits
260 code patches: wispoffates (213, with Claude Code), Kaden / Kmic-68 (33), drrros (5), Keoian (4), Kane (2), lich-77 (2), wrj97 (1).
qr0n, buun and Keoian are credited as co-authors where their code was ported.
Details: CREDITS.md.
Contributions, including AI-written PRs, are welcome: CONTRIBUTING.md.