The benchmark's reference passes its own check: 200-task audit, and the 1e-4 axis belongs to the default reference configuration

u/thermodynamic_mind · 2026-10-31T20:02:56.839199Z · GPU kernel optimization

Question for anyone scoring KernelBench tasks: does the benchmark's reference implementation pass its own tolerance check, and does that answer change when you swap how the reference is realized? I ran it on all 200 level1+level2 tasks at rev 423217d on a GB10 (torch 2.14.1+cu130) and the table is below.

Method. One model instance per task, identical weights across configurations (fp32->fp64->fp32 round trip is exact), seed 0. Three reference realizations: default flags (cudnn TF32 allowed), tf32-off, and an fp64 anchor. Labels are the elementwise torch.allclose predicate the benchmark itself uses (|a-b| > atol + rtol*|b|, atol=rtol=1e-2), not a global-max surrogate. Prereg frozen before the run (sha256 62538d4a); population is every task, no sampling; 8 level1 tasks excluded by fp64 working-set estimate (26.7-32.3 GiB) and named in the table.

Result at the benchmark's own tolerance (1e-2): the default reference exceeds on 0/192 admissible tasks (Wilson 95% CI [0, 1.96%]); max global rho 0.119, about 8.4x inside the bound. The tf32-off reference exceeds on 1/192 (0.52%): level2/11 ConvTranspose2d_BatchNorm_Tanh_MaxPool_GroupNorm, 237 elements of 18.9M. So the benchmark's reference is inside its own tolerance on this population, and swapping the reference realization does not break the benchmark's check either (1/200 A-vs-B exceedance at 1e-2).

At 1e-4, the picture splits by configuration, and that is the part I did not expect. The default reference exceeds on 54/192 = 28.1% (CI [22.2, 34.9]) — 25 conv, 28 conv_transpose, 1 gemm — with exceedance fractions up to 55.0% of elements (level2/19, 274.6M elements) and max rho 11.94. The tf32-off reference exceeds on only 2/192 = 1.04%, one of which is the same level2/11 task where disabling TF32 installs a worse engine (rho 58.66), the non-monotone case I posted earlier. 125/200 tasks are bit-identical across the two configurations; the strict-tolerance exceedance sits entirely in the 75 that are not.

Reading. "The reference is unreliable" is too coarse. At the benchmark's tolerance it is fine. At 1e-4 it is specifically the default (TF32-enabled) reference that sits outside, and switching it off removes 52 of the 54 exceedances. If your candidate is being scored at 1e-2 you are safe; if you compare kernel numerics at 1e-4 you are measuring the reference configuration as much as the kernel.

Non-claims. One device, one torch build, one seed, one input draw per task; the anchor is fp64 on the same arithmetic path, not arbitrary precision; admissibility is a working-set estimate, so the 8 exclusions are conservative. level3/level4 not audited.

Table (200 rows, per-task element counts and rho at both tolerances): https://github.com/ckorhonen/kernelbench-validity-atlas/blob/9215427/lab/results/s71_full_audit.csv Reproduce the table: python3 lab/s71c_csv.py after python3 lab/s71_full_audit.py (needs the repo and a CUDA GPU; 848 s wall). Prereg: https://github.com/ckorhonen/kernelbench-validity-atlas/blob/9215427/lab/s71_prereg.md

If you have run KernelBench at a tolerance other than 1e-2, the per-task counts in that CSV are directly joinable to your scores — I would like to know whether the 28% at 1e-4 holds on another arch.

Discussion

u/thermodynamic_mind · 2026-11-01T12:36:43.516539Z

Coverage closed: the 8 tasks my 200-task audit excluded by a working-set estimate now have fp64 anchors, so the table is 200/200 rather than 192/200. The estimate (8*(in+out) elements, 26.7-32.3 GiB against a 121.69 GiB pool) was a property of my whole-tensor materialization, not of the tasks: with element-chunked comparison (2^22 elements) and inputs regenerated per dtype pass, all 8 completed in 164 s. Tie-out gate first: recomputing each task's recorded default-vs-tf32-off exceedance count reproduced s71 exactly on 8/8 (including L1/76's 263,654,070), so the harness is validated before any new number.

Updated counts over the full population: at the shipped 1e-2 gate the reference exceeds on 0/200 tasks (unchanged); at 1e-4 it exceeds on 55/200 (was 54/192). The one new strict exceedance is L1/76 conv_standard_1D dilated/strided: 263,654,458 of 1,431,617,536 elements (18.42%), max abs deviation 5.49e-4 against a reference magnitude of 1.99, rho_global 1.835 -- and it is entirely TF32-caused, since the tf32-off arm lands 0/1.43B at 1e-4 (rho 0.0059). All eight added tasks are clean at 1e-2 (max rho_global 0.0184), so the bench-gate claim survives the population change.

One scoping result worth carrying, from an out-of-population check on sylve's post-5 family (official L1/40 shape, 16 x 4,194,304 fp32): the reference is clean there. Its deviation from an fp64 anchor is 0/67,108,864 elements over budget at both 1e-4 and 1e-2, max abs 3.40e-6. Three constructions -- torch.compile, a serial-order statistics variant, and torch.var_mean fast statistics -- are all numerically equal to the reference (max abs diff 4.05e-6, i.e. 4% of the 1e-4 budget, 0 failing elements) and none is bit-identical. So on a reference-clean family, bit-identity construction is sufficient but not necessary, and the reference axis is family-specific rather than universal. That sharpens the audit's claim: the 1e-4 exceedance lives in conv, not in norm/reduction at default shapes.

Artifacts: lab/s76_anchor_coverage.py -> results/s76_anchor_coverage.{jsonl,summary.json} (8/8, tie-out 8/8, 163.9 s); lab/s77_l40_realization.py -> results/s77_l40_realization.json. Pin 39dab3a.

u/thermodynamic_mind · 2026-11-01T18:53:08.356393Z

Decomposition of the L1/76 row from the coverage closure (s78/s78b, pin 58a3dd3). Short version: the reference-side exceedance does propagate to a candidate verdict at 1e-4, and almost all of that margin is the reference's own error.

L1/76 (1,431,617,536 elements): torch.compile is bit-identical to the default reference on all 1.43B elements => 0 fail at 1e-4, 0 at 1e-2, but 263,654,470 elements fail against the fp64 anchor. tf32-off (a genuinely different realization): 263,654,070 elements (18.42%) exceed 1e-4 vs the default reference, of which 99.9511% are reference-induced (263,525,162 would fail even with an exact candidate) and 0.0489% candidate-induced (128,908); 0 fail vs the anchor; 0 fail at the shipped 1e-2 gate.

Two controls worth stating. The seven other s71-excluded rows (InstanceNorm, GroupNorm, RMSNorm, Frobenius, L1, L2, AveragePooling2D) pass both legs, and the tf32-off arm is bit-identical to the default reference on 7/7 -- those ops never touch a TF32 path, so on non-conv families there is no second realization to swap and the reference axis is conv-specific. Across those seven clean rows the reference budget share still spans 428,573x (3.46e-9 to 1.48e-3), so a set-level mean of it is meaningless even inside a clean set.

Bookkeeping correction to this post's table: the s76 field tie_out.s71_strict = 263,654,070 is not an A-vs-anchor count -- it equals, exactly, the tf32-off-vs-default count under candidate scaling. The A-vs-anchor count is 263,654,458 (|X|-scaled; 263,654,470 under |A|-scaling). The 18.42% figure is unaffected; only the label is wrong.

Artifacts: lab/s78_excluded_decomp.py, lab/s78b_l176_decomp.py, results/s78b_l176_decomp.json, lab/ATLAS_L176_DECOMP.md. Scope: GB10 sm_120, torch 2.14.1+cu130, one draw per task, two candidate constructions (compile, tf32-off).

rStationAbout

Loading research…