Skip to content

p100-series-v5.47

Latest

Choose a tag to compare

@wispoffates wispoffates released this 30 Nov 06:34

llama.cpp tuned for NVIDIA Tesla P100 (Pascal, sm_60): v5.46 rebased onto upstream
918fe468d (+164 commits). Upstream now reads recurrent states in place
from the cache (ggml-org#30139); the series' GDN and conv fusions were re-matched on that graph. Flash-Next MTP decode is about 5 % faster
and gemma4 batched decode 1-4 %. Other GPUs keep upstream's code paths.

What changed since v5.46

  • In-place recurrent states (upstream ggml-org#30139). When a sequence's state already sits at the cache head, it is read straight from
    the cache instead of being gathered first. nemotron launches about 3 % fewer kernels. Upstream has no opt-out.
  • Fusions follow the in-place reads.
    • The GDN decode / replay fusions and the conv-state / conv-replay fusions now also match the in-place graph (state read from the
      cache view, no gather). Without this, qwen36 / ornith decode lost about 3 %.
    • GGML_CUDA_GDN_FUSE=0 still switches them off, with the same outputs either way.
  • FA mask scan bounds. Upstream's indexed-bias FA (ggml-org#33063) turned off the KV range scan whenever the last tile was partial, which
    cost gemma4 prompt edits about 7 % prefill. The series bounds the scan by the mask's rows instead and keeps it.
  • Per-expert weight scales (upstream ggml-org#28898) run through the series' row kernel on Pascal. Upstream's new kernel is about 3.6x
    slower on sm_60 (one thread per element, 64-bit div/mod). Bit-identical.
  • Rounding. Upstream's FA changes (ggml-org#32901 / ggml-org#33063 / ggml-org#32626) move the last digits of 2-token batches and of 8K-context sets.
    gemma4 2-token KLD vs F32 0.000371 -> 0.000418 on the 1K set (inside its error bars), 0.000256 -> 0.000245 at 8K. Every 1-, 4- and
    8-token 1K set is identical to v5.46.

Gate (2x Tesla P100 16 GB; quick checks Q47 / Q47B / Q47C, gate G47 vs v5.46, bisect P47)

  • Op tests: test-backend-ops passes in 46 op groups, including new in-place variants of the GDN / conv fusion tests.

  • KL divergence: 31/31 sets identical to v5.46 (decode, verify 4/6/8, prefill, long sets; GDN_FUSE=0 too). Long context 12/12
    and allocator audit 12/12 pass.

  • Kernel census: no fused kernel lost on any of the 10 entries.

  • Served texts: 38/39 identical, vision 9/9; nemotron's long triage answer differs (coherent, deterministic; every nemotron KLD
    set identical). Multi-turn 21/21 identical, Flash-Next MTP 18/18, fused == unfused.

  • Soaks: gemma4 827 requests, Swift 130, Flash-Next 258, no failures.

  • P47 traced the one moved KLD row to upstream's FA changes (the rebase without any series fix already shows it).

  • Speed vs v5.46:

    change
    Flash-Next MTP decode +5.2 %
    gemma4 batched decode (1 / 2 / 3 streams) +4.0 / +1.8 / +1.0 %
    qwen36 / ornith / nemotron serving decode +1..3 %
    Swift serving decode (4 entries) +0.2..+1.2 %
    llama-bench decode at empty context, qwen36 / ornith -1.8 / -1.1 % (host side; GPU time -2.25 %)

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 %
v5.47 ~5 % on Flash-Next MTP decode, 1-4 % on batched gemma4 decode

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 -j

Developed with CUDA 12.4. Two cards: -sm tensor and GGML_CUDA_P2P=1. See P100-SERIES.md.

Credits

269 code patches: wispoffates (222, 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.