← All posts

One flipped bit turned −53 into −3.5 million

A small experiment on a free Colab GPU: how a single silent hardware fault looks, and how a cheap checksum catches it.


I wanted to see what a silent GPU error actually looks like. Not in a paper, not in a table of incident counts, but on a screen in front of me, with numbers I could poke at.

The trouble with "silent" is that there is nothing to see. A GPU with a bad transistor doesn't crash. It doesn't throw an exception or log a warning. It hands back a number that is wrong, and the program keeps going. If that number is inside a training run, the error gets folded into the gradients and you might never find out which step it came from.

So I wrote a small script to fake one and then try to catch it. It runs on a free Colab GPU (a Tesla T4), and the code is on GitHub.

The setup

Take two random 2048 × 2048 matrices, A and B, and multiply them on the GPU to get C. Matrix multiply is the right thing to test, because it's most of what an LLM does all day.

Then I simulate a hardware fault: pick one value in C and flip one bit in it, the way a weak transistor might. I picked bit 27 of a 32-bit float, which sits inside the exponent.

Here's the actual output:

GPU: Tesla T4

Clean multiply   -> corrupted columns detected: []
Injected fault   -> C[1234,567] changed -53.6947 -> -3518934.7500 (no crash, no error)
Faulty multiply  -> corrupted columns detected: [567]

Multiply: 4.02 ms | Check: 0.36 ms | Overhead: 9.0%

One bit. −53.69 became −3,518,934.75. Nothing complained.

sign exponent (8 bits) mantissa (23 bits) bit 27 flipped → value × 2¹⁶
Where the fault landed. One exponent bit is worth a factor of 65,536.

That number is exactly −53.6947 × 65,536. Bit 27 is the fifth bit of the exponent, so flipping it on multiplies the value by 216. It's a nice reminder that "one bit" is not a small error. It depends entirely on which bit. A flip in the low mantissa bits would change the fourth decimal place and you'd probably never notice. A flip in the exponent makes the number ridiculous. The dangerous ones are in between: wrong enough to matter, not wrong enough to look broken.

Catching it without redoing the work

The obvious way to check a multiply is to do it twice and compare. That doubles your compute bill, which nobody will accept.

The trick I used is old (it goes back to Huang and Abraham's algorithm-based fault tolerance work in the 1980s) and kind of beautiful. If C = A·B, then the column sums of C have to equal the column sums of A multiplied by B:

expected = A.sum(dim=0) @ B   # a vector times a matrix: cheap
actual   = C.sum(dim=0)       # just adding up columns: cheap
bad      = where(|expected - actual| is too big)

Both sides are cheap. Summing columns is one pass over the data. A vector times a matrix is n² work instead of n³. And if a column doesn't match, you know which column holds the bad value. In the run above it pointed straight at column 567, which is where I'd put the fault.

One honest caveat: floating point means the two sides never match exactly, so you need a tolerance. Set it too tight and rounding noise looks like corruption. Set it too loose and small faults slip through. I used a 1% relative tolerance, which happily catches an exponent flip and would miss a flip in the last few mantissa bits. Picking that threshold well is a real research problem, and other people are already working on it (adaptive thresholds for mixed precision, for example).

The overhead number surprised me

Matrix multiply 4.02 ms Checksum 0.36 ms
Average of 20 runs, 2048 × 2048 FP32 on a Colab Tesla T4. The check is about 9% of the multiply here.

The check took 0.36 ms against 4.02 ms for the multiply, about 9%. That's fine for a demo, but it's way more than the arithmetic says it should be.

Count operations: the multiply is about 2n³ floating point operations. The check is a handful of n² operations. At n = 2048 the check should be roughly 0.1% of the arithmetic, not 9%.

0.0001%0.001%0.01%0.1%1%10%100% measured time: 9% arithmetic share: 0.1% 25651210242048409681921638432768 matrix size n (n × n)
The line is the checksum's share of the arithmetic, which is roughly 2/n. The dot is what I actually measured. The gap between them is the interesting part.

The gap is because the check isn't limited by arithmetic. Summing columns and doing a vector-matrix product are memory-bound: the GPU spends its time reading B and C out of memory, not doing maths. A big matrix multiply reuses each value many times, so it's compute-bound and runs close to peak. My check is also written in the laziest possible way, as separate PyTorch calls, each with its own kernel launch.

So 9% is an upper bound from a lazy implementation, not the real cost. The real fix is to compute the checksum inside the multiply kernel itself, while the data is already sitting in fast on-chip memory. That's roughly what the serious work in this area does, and it's where the overhead gets down to around 1% or less.

What this demo doesn't show

I want to be careful here, because it's easy to oversell a toy:

But it does make the core idea concrete. Silent errors are real and they can be huge. You can catch a lot of them with checks that cost much less than the work they protect. And you can do that from the outside, as someone renting the GPU, without any special access from whoever owns it.

That last part is what I'm working on next: taking checks like this, making them realistic (proper fault models, not hand-placed bit flips), and running them across real rented GPUs from many providers. We've written about why that's harder than it sounds in What 35 million GPU-hours tell us, and the full plan is in Where the research goes from here. All of it feeds Zenith, the third stage of the product.

References


If you rent GPUs and have a story about a run that went strangely wrong, we'd genuinely like to hear it. Drop us an email.