Bunker LabsResearch facility
- 11 divisions
- 55 experiments
- 8 working
- 0 validated
- 0 archived
BL-06-01 Working experiment · Division 06, Experimental Computing
GPU vs CPU Lab
Is the GPU really faster? This page does the same job twice, on your CPU and on your GPU through WebGPU, and shows both times, the speed-up with and without the cost of copying data, and how closely the two answers agree. A built-in Check compares both sides with answers known exactly.
Control panel
A matrix multiply does N³ multiply-adds.
Ready when you are. Nothing runs until you press Run.
Result Not run
The CPU side runs in Web Workers so the page stays responsive; its time is from the go signal to the last answer. The GPU side is a WebGPU compute shader. Data already on it is the best of three runs once the numbers are in GPU memory; with upload and read-back also counts copying the input there and the answer back, which is what a real job pays. The first GPU run only warms up (shader compilation) and is not counted. Both sides get exactly the same input numbers.
Check Not run
A known-answer test of both sides. Matrix multiply: A[i][k] = i + k and B[k][j] = k − j at 256 × 256, whose product has the exact closed form C[i][j] = i·S₁ − N·i·j + S₂ − j·S₁ (S₁ = N(N−1)/2, S₂ = (N−1)N(2N−1)/6). Every value and every partial sum stays below 2²⁴, where 32-bit floats are exact, so both sides must match it in all 65,536 entries with no error at all. Prefix sum: the running total of 0, 1, 2, … 1,048,575, which is i(i+1)/2 (taken modulo 2³², as the GPU’s 32-bit numbers wrap).
How it stays safe
- Nothing runs until you press Run or Run the Check. Stop ends everything at once: the Workers are shut down and the GPU device is destroyed.
- The CPU work runs in Web Workers, never on the page itself, and the GPU work in short dispatches. Each step has a time limit (45 s for the CPU, 15 s for each GPU step); a step that overruns is stopped.
- Sizes are capped: matrices up to 1024 × 1024 (4 MB each), prefix sums up to 4,194,304 numbers (16 MB). The GPU device is opened for one run and released straight after it.
- Results stay on this page: nothing is uploaded or stored.