Submissions to the GPU MODE ranked leaderboards. Problems and reference implementations come from gpu-mode/reference-kernels; submission goes through popcorn-cli and runs on their hardware, so nothing here needs a local GPU.
The pmpp_v2 set is the only one still open — every timed competition on the
platform has closed (checked 15 Oct 2026: AMD Feb 2026 closed 7 Apr, NVIDIA
Blackwell NVFP4 closed 21 Feb, Helion 15 Mar, Princeton 17 Apr, BioML 9 May,
Linear Algebra 30 Jun – 30 Jul, despite the popcorn-cli README still
advertising it as new). pmpp_v2 carries a deadline of 2100-12-31, which is
how the platform marks a permanently open practice ladder.
Picking a problem is mostly about reading what the reference actually does, because the reference is what you have to beat:
| problem | reference calls | headroom |
|---|---|---|
matmul |
a @ b → cuBLAS |
very low; cuBLAS is near optimal |
sort |
torch.sort → CUB radix sort |
very low |
conv2d |
F.conv2d → cuDNN |
low |
histogram |
torch.bincount |
medium |
grayscale |
torch.sum(data * weights, -1) |
high — materializes an H×W×3 temporary |
prefixsum |
cumsum(data.to(float64)) |
high — full float64 materialization |
vectorsum |
data.to(float64).sum() |
high — same, and bandwidth-bound |
The three marked high are the ones where the reference spends memory bandwidth
on a temporary that a fused kernel never has to write. matmul is the obvious
problem to reach for and the worst first choice, because the reference there is
already a tuned library call.
Sum an fp32 vector; the reference reduces in float64.
The win is deleted traffic, not a better reduction. At the largest benchmark size (52,428,800 elements) the reference writes and re-reads a 419 MB float64 array, so it moves about 1.05 GB where a fused pass moves the 210 MB of input. On a purely bandwidth-bound op that ratio is the available speedup.
The constraint is precision. The input is scaled by up to 10 and offset by
up to ±100, so the true sum reaches ~5e9 while individual addends are O(100). A
running fp32 accumulator carries about 7 decimal digits, so past ~1e7 each new
addend starts falling off the bottom of the mantissa. Emulated in plain
arithmetic at 2M elements — 26× smaller than the top benchmark — a running fp32
accumulator is already 2.6e-5 off the float64 answer, against an fp32
assert_close tolerance near 1.3e-6:
n=2,000,000 fp64 sum = 200,017,990.30
fp32 running = 200,012,880.00
relative error = 2.555e-05
So the float64 accumulator in vectorsum/submission.py is load-bearing. Worth
noting that the baseline submission shipped with the problem accumulates across
blocks with fp32 tl.atomic_add, which by the same argument should drift
outside tolerance at the top sizes, and nondeterministically.
Shape. Each program holds a float64 vector accumulator in registers and
walks several tiles, paying the tl.sum reduction tree once at the end rather
than once per tile; that also makes the summation blocked rather than
sequential, which is better conditioned. A second kernel reduces the
per-program partials in float64 and writes one fp32 scalar. No global atomics.
RGB to grayscale, Y = 0.2989 R + 0.5870 G + 0.1140 B.
Same shape of win, cleaner. The reference is torch.sum(data * weights, -1),
where the multiply is a separate op and so materializes a full (H, W, 3) fp32
temporary. At the top size (16384 x 16384 x 3) that temporary is 3.22 GB:
input 3.22 GB, output 1.07 GB
reference traffic = 10.74 GB (read, write tmp, read tmp, write)
fused traffic = 4.29 GB
ratio = 2.50x
Three multiplies and two adds per pixel is far too little arithmetic to hide that, so the op is pure traffic and fusing it is the whole answer.
Unlike vectorsum, precision is a non-issue: the reduction is over three values
in [0, 1] and the checker allows rtol=atol=1e-4. Measured worst-case fp32
error over 200k pixels is 1.01e-07, three orders of margin, so there is
nothing to buy with float64 here. Reaching for it anyway would cost bandwidth
for no accuracy — which is the same trade as vectorsum, read in the opposite
direction.
Also high headroom (cumsum(data.to(float64)) materializes the same kind of
temporary) and its checker is unusually forgiving, scaling tolerance by
sqrt(n) — rtol = 1e-5 * sqrt(n), so about 0.058 at the 33.5M top size.
It is a bigger lift than the two above, because a correct device-wide scan needs a multi-block algorithm: block-local scans, an exclusive scan of the block sums, then an offset pass. Left unwritten rather than half-written.
Submitted and ranked. Both pass; neither is competitive yet.
| reference | mine | vs reference | leader | rank | |
|---|---|---|---|---|---|
grayscale_v2 |
5.57 ms | 598 µs | 9.3x | 590.12 µs | 12 / 45 |
vectorsum_v2 |
292 µs | 42.3 µs | 6.9x | 37.32 µs | 24 / 79 |
Final after six tuning batches (ranked scores 597.5 µs and 43.1 µs). The first submissions, in Triton, ranked 34th and 67th at 616 µs and 52.6 µs.
The framing below was wrong in a way worth recording. It measures headroom
against the reference, and the reference is a weak bar: torch composing two
ops is not what the field is doing. Beating it 9x reads well and ranks 34th,
because the top 30 on grayscale are packed into a 590-614 µs band — they have
all already hit the roofline. The bar that matters is the board, not the
reference.
Where the remaining gap is:
- grayscale, 10.8% off. The stride-3 gather is the suspect, and the comment
in the kernel rationalising it ("absorbed by L1/L2") is the error. The leading
filenames —
block64.py,submission_v6_b128.py,greyscale_v2_fma.py,cuda.py— are tuned block sizes, FMA and hand-written CUDA doing proper vectorized loads. 616 µs is 6.97 TB/s against ~8 TB/s of HBM, so ~87% of peak; the last 13% is the access pattern. - vectorsum, 1.92x off. Prime suspect is the float64 accumulator, since B200 deprioritises FP64 hard. Second is the extra kernel launch for the partial reduction: 5-10 µs of launch overhead against a 37 µs target is decisive. A single-pass kernel with compensated fp32 summation would likely beat it while still clearing the tolerance.
Six benchmark submissions per hour, so each batch is chosen, not swept.
| batch | finding |
|---|---|
| 1 | Forced occupancy, 8 loads in flight, partials instead of atomics, 1024-thread blocks: all 48.2-49.0 us from 52.4. None is the lever. grayscale flat at 598 across block sizes; two pixel groups per thread 738. |
| 6 | 256-bit loads (ld.global.v8.f32, sm_100) assemble and pass but are slower: 49.9. grayscale with --use_fast_math -Xptxas -O3,-dlcm=cg: 599. Stopped here. |
| 5 | Call-path overhead is not the gap. Raw-pointer ctypes launcher instead of pybind: 42.3 vs 42.3, 599 vs 598. Python was never on the critical path. |
| 4 | Hints and mechanisms exhausted: .cg 48.5 (no effect), .lu 42.4 (= .cs), .cs on other geometries 42.9-45.1, bulk-copy (TMA) 48.6, grayscale evict-first stores 599. Two plateaus: ~42.3 and ~598. |
| 3 | Evict-first streaming loads (__ldcs) on grid-stride: 48.2 -> 42.3 us. The 209 MB stream was thrashing L2. Both cp.async pipelines slower (55.7, 52.6); no-smem and streaming-load grayscale both slightly worse (602, 601). |
| 2 | Block-contiguous access is slower than grid-stride on B200: 59.0 vs 48.3 for the same config, 68.4 with unroll 8 under the register cap. Streaming loads + in-place squeeze are worth ~2 us. grayscale 128 threads: 599. |
Written against the published spec and not yet run — correctness and rank come from the leaderboard itself, which needs a one-time registration:
curl -fsSL https://raw.githubusercontent.com/gpu-mode/popcorn-cli/main/install.sh | bash
popcorn register # GitHub or Discord; proves you are a human
# correctness first, on their GPU
popcorn submit vectorsum/submission.py --leaderboard vectorsum_v2 --gpu B200 --mode test
popcorn submit grayscale/submission.py --leaderboard grayscale_v2 --gpu B200 --mode test
# then rank
popcorn submit vectorsum/submission.py --leaderboard vectorsum_v2 --gpu B200 --mode leaderboard
popcorn submit grayscale/submission.py --leaderboard grayscale_v2 --gpu B200 --mode leaderboardRun --mode test first: it checks against the reference on their GPU before
anything is ranked.