#1718·colibri

[datapoint] Tesla P40

Author: ggeorgovassilisCreated Sep 23, 2026Updated Sep 23, 2026

Summary

colibri's CUDA backend is correct on Pascal sm_61, and on a single Tesla P40 the dense-trunk GEMV probe (the open question from issue #1652 and PR #1657) measures faster on the GPU than the CPU (0.370 ms vs 0.689 ms), so COLI_PLACE=auto places the whole dense trunk (DeltaNet + attention + lm_head) in VRAM, the same "win" verdict as the P100 and the opposite of the M10. The P40's 24 GB of GDDR5 holds all 10,240 experts resident on one card (10240/10240, 100 % VRAM hit rate, 0 CPU misses) from the first cold run; the P100's 16 GB held 7291/10240 and paid a cold-start penalty (7.46 to 12.02 tok/s from cold to warm). The P40 has no such cliff: cold is 9.63 tok/s, warm is 9.67 tok/s, a 0.4 % gap. Once warm it is slower than the P100 (9.67 vs 12.02 tok/s) on ~346 GB/s GDDR5 versus the P100's ~732 GB/s HBM2.

The change from the P100 datapoint

P100 (previous) P40 (this datapoint)
GPU 1x Tesla P100-PCIE-16GB 1x Tesla P40
Compute capability 6.0 (Pascal, GP100) 6.1 (Pascal, GP102)
VRAM 16 GB HBM2 24 GB GDDR5
Memory bus 4096-bit HBM2 384-bit GDDR5
Memory bandwidth ~732 GB/s ~346 GB/s
Tensor cores none none (still gated compute_major >= 7)
dp4a no (sm_60) in silicon (sm_61+) but unused: colibri has no dp4a kernel, so the portable quant_matmul still runs
FP16 2x FP32 rate (unused: model is int4/int8) none (no native FP16, unused anyway)
SMs / clock 56 SM @ ~1.33 GHz 30 SM @ ~1.53 GHz
CPU 2x Xeon E5-2640, no AVX2/FMA unchanged
Driver 580.173.02 unchanged

Environment

  • GPU: 1x Tesla P40 (sm_61, Pascal/GP102, no tensor cores, no native FP16, dp4a present in silicon but no kernel uses it), 24 GB GDDR5 (~346 GB/s), driver 580.173.02 (host CUDA 13.0)
  • CPU: 2x Intel Xeon E5-2640 @ 2.50 GHz (Sandy Bridge), 12 physical cores / 24 threads; avx, sse4_1, sse4_2 present, avx2, fma, avx-512 absent (unchanged from the M10 and P100 runs)
  • RAM: 128 GB (64 GB / 64 GB across the two NUMA nodes)
  • Storage: NVMe SSD (mounted at /mnt/ssd2 on the test machine)
  • Docker: 29.7.2 with the nvidia container toolkit; all runs in the colibri-cuda:11.8 image built from the repo's docker/Dockerfile (CUDA 11.8)
  • Model: Kreuzzelg/qwen36-35b-a3b-colibri-i4-gs64 (Qwen3.6-35B-A3B, int4 / gs=64, colibri-native container, 22 GB), the same model and heat.bin as the M10 and P100 runs

Build

bash
make -C c qwen36 CUDA=1 CUDA_ARCH=sm_61 ARCH=native

CUDA_ARCH=sm_61 replaces sm_60; ARCH=native is still required (no AVX2 on this CPU, so a -march=x86-64-v3 binary would SIGILL). nvcc 11.8 --list-gpu-arch confirms compute_61 is present. The WMMA/tensor-core path is still correctly skipped (compute_major >= 7 gate; the P40 reports sm_61), and there is no dp4a kernel, so the portable quant_matmul path is what runs, as it did on the M10 and P100.

Correctness

make cuda-test CUDA=1 CUDA_ARCH=sm_61 on the P40, exit 0, all 9 test executables pass. This is the first sm_61 validation:

  • backend_cuda_test: q8/q4/q2/f32/e8 correctness ok on 1 device(s)
  • ragged_attention_test: ragged_relative_rms=0 ragged_g64_relative_rms=0 (exact)
  • cuda_fmt_trap_test: __trap() refusal agrees on silicon for every fmt (the launch aborted … launch failure lines are expected: the __trap() refusal test re-execs itself to prove the refusal path)
  • fp8_warp_test / fp8_cuda_test: 0 mismatches
  • mxfp4_cuda_test: 0 mismatches including the exponent-255 cases
  • absorb_determinism_test, weights_owned_test, alloc_footprint_test: OK

Same portable-kernel correctness as on Maxwell and GP100; nothing sm_61- specific failed.

The GEMV probe

The startup probe from PR #1657 times one [8192 x 2048] int8 GEMV both ways:

Card GPU GEMV CPU GEMV Probe verdict
4x M10 (Maxwell, sm_50) 2.303 ms 0.860 ms trunk stays on the CPU
1x P100 (Pascal, sm_60) 0.298 ms 0.676 ms trunk to VRAM
1x P40 (Pascal, sm_61) 0.370 ms 0.689 ms trunk to VRAM

On the P40 the probe keeps the placement and auto loads the entire dense trunk (the same 1828.5 MB it loads on the P100):

[place] probe: one [8192 x 2048] int8 GEMV takes 0.370 ms on CUDA dev 0, 0.689 ms on the CPU -> trunk to VRAM
[place] auto: dev 0 holds 1828.5 MB of trunk (lmhead yes, 30 dnproj layers), 19.44 GB left for experts
[qtier] dev 0: budget 19.44 GB for experts (~11028 experts) after trunk
[lmh] lm_head [248320 x 2048] int8 resident on CUDA dev 0 (0.47 GB)
[dnp] 30 DeltaNet-Projektionen auf GPU (0.70 GB VRAM)
[dense] 190 trunk matrices on GPU (dnout/attnproj/shexp, 0.61 GB VRAM)

The P40's GPU GEMV (0.370 ms) sits between the P100 (0.298 ms) and the CPU (0.689 ms), and is ~1.24x slower than the P100. The qtier budget line shows ~11028 experts fit after the trunk, more than the model's 10,240.

Results (single P40, 200 tokens, greedy)

Prompt: repo c/prompt.txt ("Explain the difference between a stack and a queue in three sentences."), N_NEW=200, COLI_GPUS=0, CUDA_EXPERT_GB=auto, OMP_NUM_THREADS=12. Single run per config (n=1), same harness as the P100 datapoint.

Config Decode tok/s TTFT Experts resident VRAM hit % CPU misses Peak RSS
P40, cold (no heat) 9.63 1.44 s 10240/10240 100.0 0 22.82 GB
P40, warm (heat.bin) 9.67 1.42 s 10240/10240 100.0 0 23.36 GB
P40, probe OFF (placed) 9.62 1.42 s 10240/10240 100.0 0 23.37 GB

COLI_TRUNK_PROBE=0 (probe OFF) is identical to auto (9.62 vs 9.67 tok/s): on this card the probe already places the trunk, so disabling it changes nothing, and the output stays byte-identical.

The P100 cold run hit 71.3 % (19662 CPU misses) with 16 GB holding 7291/10240 experts; the P40 cold run is already at 100 % hit with 0 CPU misses because 24 GB holds all 10240. Cold (9.63) and warm (9.67) are within 0.4 % of each other, versus the P100's 61 % swing.

Three-card decode comparison (single stream, warm)

Card VRAM Bandwidth Experts resident Warm tok/s
4x M10 8 GB/GPU ~48 GB/s 3245/10240 2.45 (all four)
1x P100 16 GB ~732 GB/s 7291/10240 12.02
1x P40 24 GB ~346 GB/s 10240/10240 9.67

Per-token phases, warm (ms/token)

Phase P40 (1 GPU) P100 (1 GPU) M10 (4 GPU, 12 thr)
DeltaNet trunk 37.5 33.4 169
attention 9.2 7.9 55
MoE 40.3 28.1 91
lm_head 8.8 7.4 69
total ~96 ~77 ~384

dn-sub on the P40 (warm): proj 15.7 + conv 8.8 + l2n+rec 6.9 + norm+out 5.9 ms/token, close to the P100's 12.9 + 8.8 + 6.7 + 4.8 (the projection phase is ~1.2x slower, the rest near-identical), so the dense trunk costs roughly the same on both cards once it is on the GPU.

The P40 is slower than the P100 on every phase that reads GPU-resident weights, but not uniformly: MoE 40.3 vs 28.1 ms/token (1.43x), DeltaNet 37.5 vs 33.4 (1.12x), lm_head 8.8 vs 7.4 (1.19x). The raw GEMV probe is 1.24x slower (0.370 vs 0.298 ms), matching the 1.24x end-to-end warm gap (12.02 vs 9.67 tok/s). The raw bandwidth ratio is ~2.1x (346 vs 732 GB/s).

Output parity

p40_cold.out, p40_warm.out, p40_probeoff.out are byte-identical (md5 3f3d8e16dcfd6f84ceba5983c809fa33, 793 bytes), the same md5 as the M10 and P100 datapoints. Placement, heat state, and the probe on/off all produce the same coherent reasoning text.

Conclusion

  • Correctness on Pascal sm_61 is confirmed (full cuda-test suite, exit 0).
  • The #1657 probe stays on the "win" side: the P40's GPU GEMV (0.370 ms) beats the CPU (0.689 ms), so the dense trunk loads into VRAM, with byte-identical output in all three run modes.
  • The P40 is the first card in the series to hold all 10,240 experts on one GPU (10240/10240, 100 % hit, 0 CPU misses); the cold-to-warm gap is 0.4 %, versus the P100's 61 %.
  • The P40 is slower than the P100 once warm (9.67 vs 12.02 tok/s), on ~346 GB/s GDDR5 versus ~732 GB/s HBM2, with no tensor cores and no used dp4a on either card.

Reproducer

Runs are on the test machine; ~/colibri is a checkout of the colibri repo and /mnt/ssd2/models/colibri holds the model. The colibri-cuda:11.8 image is built from the repo's docker/Dockerfile.

bash
docker run --rm --gpus '"device=0"' -v ~/colibri:/src \
  -v /mnt/ssd2/models/colibri:/models -w /src/c colibri-cuda:11.8 bash -lc \
  "COLI_CUDA=1 COLI_GPUS=0 CUDA_EXPERT_GB=auto OMP_NUM_THREADS=12 \
   OMP_WAIT_POLICY=ACTIVE OMP_PROC_BIND=close COLI_PLACE=auto \
   SNAP=/models/qwen36_i4_gs64 TOK=/models/qwen36_i4_gs64/tokenizer.json \
   N_NEW=200 COLI_TIMERS=1 HEAT_FILE=/models/qwen36_i4_gs64/heat.bin \
   ./qwen36 256 4 prompt.txt"

Probe-off control: add COLI_TRUNK_PROBE=0. Cold run: drop HEAT_FILE=….

Build: make -C c qwen36 CUDA=1 CUDA_ARCH=sm_61 ARCH=native (tested at 0e84b37, the same merged #1657 probe commit used by the M10 and P100 datapoints, on branch trunk-vram).