For years, silently incorrect math inside llama.cpp meant that Tesla P100 GPUs, available today for around $80, delivered worse output than they should. The good news: a three-line patch restores near-perfect numerical fidelity at no performance cost.
The issue, spotted by a researcher comparing benchmarks between a quad-P100 box and an RTX 3090, traced back to an optimization flag in llama.cpp's CUDA code that enabled FP16 computation on GPUs deemed fast at it. The GTX 10-series and P40 (sm_61) had been exempted for a long time because they lack dedicated FP16 hardware. The P100, ironically, does have fast FP16 silicon — Nvidia designed it for high-precision scientific computing — but the flag included it, causing degraded math that produced a median Kullback-Leibler divergence of 0.0023 versus FP32 reference. After the patch, that value drops to 0.000001, an improvement of over 2000×, and next-token agreement jumps from 96.5% to 99.9%: roughly one wrong pick in every 29 tokens disappears.
Performance-wise, the fix brings no penalty. Prefill remained identical within noise, while decode actually sped up by about 1.4%. The reason is that real inference workloads on P100 are bound by HBM2 memory bandwidth (732 GB/s) and GEMM operations, not by the FP16 vector path. The "fast" path was buying nothing except inaccuracy.
The implications stretch beyond a bug fix. On the second-hand market, the 16GB HBM2 P100 is often overlooked in favor of the P40, which costs about $300 despite its slower GDDR5 at 346 GB/s, because the P40 was perceived as more capable for LLM workloads. We now know that part of that price gap was artificial, created by a years-old software error. For anyone assembling on-prem inference nodes on a tight budget, the P100's cost-effectiveness jumps sharply, making it a suddenly competitive option for running quantized models where data sovereignty and infrastructure control matter.
The episode exposes a familiar but underappreciated dynamic in the open-source LLM framework ecosystem: deep testing focuses on recent architectures (Volta, Ampere, Ada), while previous-generation GPUs, plentiful on the secondary market, can carry numerical defects for years that quietly degrade output quality. In this case, the anomaly was isolated with the help of an automated agent, confirming that empirical verification on real — even older — hardware is a necessary complement to trusting community software. The author verified that other architectures (sm_61, Volta and newer) are unaffected; the open question is how many other cards, in other niches, are silently crunching wrong numbers.
For those evaluating on-prem deployment, the message is twofold: a three-line patch can save hundreds of dollars in unnecessary hardware, and mastering your inference stack — including the arithmetic layer — impacts model fidelity as much as quantization choices. AI-RADAR provides analytical tools to navigate such trade-offs, but the ultimate lesson is that control also means verifying the lowest-level math.
💬 Comments (0)
🔒 Log in or register to comment on articles.
No comments yet. Be the first to comment!