Guldo

Domains

Problems you can test speedups on

Each card is a problem we can measure speedups on, and says what size of speedup its test can prove. Cards marked “Built in” were set up by hand. The others were made by the compiler from a short description, and every number on their cards is read from the compiler's own record.

By kind of speedup

Related problems sit together. Each problem is measured against its own baseline, so results are compared on the same problem, not across the group. Name your problem's class when you propose it.

Lattice problems

Short vectors, learning with errors, NTRU and SIS: finding structure in a lattice. A faster lattice reduction or sieve is a real security result.

gm, mlwe

Factoring and discrete logarithms

Integer factoring, discrete logarithms, and partial-information attacks on them. A faster method here breaks deployed public-key systems.

dlog, factor

AI inference and decoding

Running a fixed model faster at equivalent output: caching, batching, pruning, lower precision. Measured as time, operation counts or GPU time.

aidecode, aiinfer

Cryptography and number theory

Lattice puzzles that modern encryption relies on, factoring, and discrete logarithms: problems where a faster method is a real security result.

Built in

gm: Lattice: a short vector

Given a lattice (a regular grid of points in many dimensions), find a short non-zero point on it. Each test lattice has a short point hidden in it, so a good answer is known to exist.

  • The test: problem sizes [64, 66, 68, 70, 72], 24 questions per size, time limit 120 s per question
  • Set up by hand, not by the compiler. What has been measured is on the Results page and its limits on the Limits page.
Built in

mlwe: Lattice: encryption-style

The same task on lattices of the kind used in some modern encryption schemes.

  • The test: problem sizes [97, 105, 113, 121, 129, 137], 12 questions per size, time limit 60 s per question
  • Set up by hand, not by the compiler. What has been measured is on the Results page and its limits on the Limits page.
Built in

factor: Integer factoring

Given a large number that is the product of two primes, find a factor of it.

  • The test: problem sizes [58, 60, 62, 64], 24 questions per size, time limit 120 s per question
  • Set up by hand, not by the compiler. What has been measured is on the Results page and its limits on the Limits page.
Ready, with notes

dlog

Discrete logarithm: find the exponent x so that g to the power x leaves the remainder h, modulo a prime p.

solve(p, g, h): return an integer x with pow(g, x, p) == h, 0 <= x < p - 1. Any valid x counts; return None for no answer.

What it can prove: speedups from about 1.5 to 3 bits (2.8 to 8.0 times faster) than the baseline.

Usable, but read the compiler's notes below: they say how far to trust the test.

  • The test: problem sizes [28, 29, 30], 24 questions per size, time limit 120 s per question; about 3.07 CPU-hours to score one solver.
  • The baseline: the author has not said what it is or what is known to beat it, so a speedup over it may be easy.
  • Compiler self-test: passed. It checks that the baseline against itself scores about 0, that a solver which never answers scores 0, and that a known 1-bit speedup is recovered.

How often a real speedup of each size would be proven

Real speedup (bits)Proven in all three rounds%
00%
0.50%
10%
1.597%
2100%
3100%
460%
50%
60%

Assumes a solver's speed varies about 0.6 bit from question to question. The real figure is unknown until someone submits.

Notes from the compiler (4)
  • narrow ladder: 3 size(s) spanning 2.59 octaves of cost (3+ is needed for the estimator's three difficulty bins to be well populated): widen SIZE_RANGE or let the reference's cost grow faster
  • the first plan's cost predictions missed by more than an octave, so the ladder was re-planned from the confirming data: it is the best available but NOT independently confirmed
  • the cost model was still off by more than one octave at size(s) [30] after 2 refinements
  • the measured median at one size is 1.3 octaves from the smoothed trend (sampling noise at 16 instances per size): the power analysis uses the smoothed trend; raise --n-prof for a steadier profile

Version dlog-v1, fingerprint 4b6669a7acc6.

Check the compiler's arithmetic yourself (it recomputes the whole table from the saved record and says if anything differs):

python3 compile_domain.py recheck dlog
python3 submit_check.py my_solver.py --family dlog

AI workloads

The same protocol applied to models: faster text generation and faster classification, measured on questions fixed in advance.

Ready

aidecode

Text generation from a small language model: produce the next T tokens (words or word pieces), faster than recomputing the whole model for every token.

solve(seed, prompt_len, T): rebuild the model and prompt from `seed` (SplitMix64 stream, layout in domains/aidecode/reference.py), generate T tokens greedily (argmax of the next-token logits; the prompt has prompt_len = 8 tokens) and return the list of T token ids. Every returned token must be, at its position, within 1e-3 standard deviations of the best logit given the prompt and your own earlier tokens (float32 passes; shortcuts do not). Return None for no answer.

What it can prove: speedups from about 1.5 to 4 bits (2.8 to 16.0 times faster) than the baseline.

  • The test: problem sizes [544, 640, 704, 800, 864, 960], 12 questions per size, time limit 30 s per question; about 1.2 CPU-hours to score one solver.
  • The baseline: Recomputes the full forward pass over the whole sequence for every generated token (no KV cache), float64. Known to be beaten by caching each layer's keys and values, which turns the per-token cost from O(t) projections to O(1); the saving grows with T.
  • Compiler self-test: passed. It checks that the baseline against itself scores about 0, that a solver which never answers scores 0, and that a known 1-bit speedup is recovered.

How often a real speedup of each size would be proven

Real speedup (bits)Proven in all three rounds%
00%
0.50%
10%
1.5100%
2100%
3100%
483%
50%
60%

Assumes a solver's speed varies about 0.6 bit from question to question. The real figure is unknown until someone submits.

Version aidecode-v1, fingerprint db2a53ec5b83.

Check the compiler's arithmetic yourself (it recomputes the whole table from the saved record and says if anything differs):

python3 compile_domain.py recheck aidecode
python3 submit_check.py my_solver.py --family aidecode
Ready

aiinfer

Classifying inputs with a small neural network: label a batch of inputs, faster than handling them one at a time.

solve(seed, d, batch): regenerate the model and inputs from `seed` with the SplitMix64 stream documented in domains/aiinfer/reference.py (W1, W2: d x d, W3: 10 x d, scaled by sqrt(3/d); batch inputs of dimension d), run h=relu(W1 x), h=relu(W2 h), logits=W3 h, and return the list of `batch` class labels (ints 0-9). A label counts if its logit is within 0.1 standard deviations of the sample's best logit; at most 1% of labels may miss. Return None for no answer.

What it can prove: speedups from about 1.5 to 3 bits (2.8 to 8.0 times faster) than the baseline.

  • The test: problem sizes [2304, 2688, 3072, 3840, 4544, 5248], 12 questions per size, time limit 30 s per question; about 1.22 CPU-hours to score one solver.
  • The baseline: Float64, one sample at a time (a numpy matrix-vector product per input). Known to be beaten by batching the whole input matrix into one BLAS matmul and by float32; the speedup grows with d because the model regeneration is O(d^2) and the inference O(d^3).
  • Compiler self-test: passed. It checks that the baseline against itself scores about 0, that a solver which never answers scores 0, and that a known 1-bit speedup is recovered.

How often a real speedup of each size would be proven

Real speedup (bits)Proven in all three rounds%
00%
0.50%
10%
1.5100%
2100%
3100%
470%
50%
60%

Assumes a solver's speed varies about 0.6 bit from question to question. The real figure is unknown until someone submits.

Version aiinfer-v1, fingerprint 7be532af75dd.

Check the compiler's arithmetic yourself (it recomputes the whole table from the saved record and says if anything differs):

python3 compile_domain.py recheck aiinfer
python3 submit_check.py my_solver.py --family aiinfer

Three ways to measure an AI speedup

They give different kinds of evidence, and each says what it does not show.

Timed on the CPU

The domains above, such as aiinfer (classify a committed batch with a small neural network, at equivalent accuracy). This is the full protocol: seeds committed first, a public log, a certificate anyone can recompute. The timings still rest on the locked box, which has passed its tests on real Linux machines but has not yet run an official round. A timed AI result is also a claim about the machine it was measured on: for the float32 solver in the aiinfer domain, re-measuring gave about 3.3 bits on a Mac (Apple's matrix library) and about 0.03 bits on a Linux server (a different matrix library), so the numerical library alone can change a speedup completely. Saved timed runs appear on the Results page.

Counted operations

Every tensor operation is charged a cost computed from its shapes, and the solver's own Python adds one unit per instruction. Anyone can re-run any record and must get exactly the same counts, on any machine with the same Python version, trusting no clock. It can show that a solver needs N times fewer operations (a cache, pruning, an early exit). It cannot show that a solver is faster at the same arithmetic (a better kernel). What a lower precision or a smaller memory footprint saves is counted separately, below.

It covers training as well as inference, on a convex task and a non-convex one (aimlp, a small ReLU network). In aitrain, a small classifier is trained until it reaches a target accuracy on a hidden test set that the solver never sees, and the cost is the operations spent. Two training techniques can then be compared with each other instance by instance, with the gap in bits at every size, a significance test only where costs actually vary between instances, an option to require a plan committed in advance, and the option to re-execute every record. The scale is small on purpose; what carries over to large models is the method of comparison, not the numbers.

A second counter adds three more exact costs: the bytes an operation reads and writes, the numeric precision (a tensor can be cast to 32 or 16 bits, which really rounds its values, so a technique that loses accuracy by lowering precision fails the hidden test), and the peak memory alive at once. They are an accounting convention over shapes and declared precisions, with no cache and no fusion, so they are recomputed exactly by anyone; they show “fewer bytes” or “a smaller footprint”, never “faster”. In the saved practice runs a KV cache for text generation saves 4.9 bits of operations against the uncached reference but only 1.1 bits of bytes moved, so counting operations alone would have told only part of the story.

Because a device's time is the sum of each operation's roofline time (the larger of its compute time and its memory time), two runs' exact per-operation costs can be compared for every device at once: faster everywhere, tied, or faster above a stated number of flops per byte. That is exact arithmetic on the recorded counts and needs no device, but it is a model; how well it describes real hardware is measured in the calibration table below.

GPU time

The operator's own clock times a request to a solver running on one pinned device model, with warm-up on public instances and a different instance every run. It can be re-measured on the same model but never re-executed exactly, so it is the weakest evidence here. No GPU measurement has been made. The meter exists and its decision rules have been tested against a simulated device, but it has never been run on a real GPU.

Counted-operations results: the saved runs
Solver (against the reference)DomainSolvedWrong answersOperations saved (reference / solver)CreditExact boundLedgerFiles
aidecode_flops_kv
aidecode in the counted-operations API, SPEEDUP: a KV cache. Same tokens as the reference with O(1) projections per step.
aidecode18/18021x at 40, 29x at 56, 37x at 724.4 bits4.4 bitscost arithmetic re-checksreference ladder · solver ladder
aidecode_flops_lossy
aidecode counted-operations RED TEAM: skips the second layer (fewer operations, wrong tokens). The verifier must reject it.
aidecode0/1818n/a0.0 bits-4.5 bitscost arithmetic re-checksreference ladder · solver ladder
aidecode_flops_ref
The reference run against itself: it should earn nothing.
aidecode18/1801.0x at 40, 1.0x at 56, 1.0x at 720.0 bits0.0 bitscost arithmetic re-checksreference ladder · solver ladder
aidecode_flops_kv
aidecode in the counted-operations API, SPEEDUP: a KV cache. Same tokens as the reference with O(1) projections per step.
aidecode18/18021x at 40, 29x at 56, 37x at 724.4 bits4.4 bitscost arithmetic re-checksreference ladder · solver ladder
aidecode_flops_lossy
aidecode counted-operations RED TEAM: skips the second layer (fewer operations, wrong tokens). The verifier must reject it.
aidecode0/1818n/a0.0 bits-4.5 bitscost arithmetic re-checksreference ladder · solver ladder
aidecode_flops_ref
The reference run against itself: it should earn nothing.
aidecode18/1801.0x at 40, 1.0x at 56, 1.0x at 720.0 bits0.0 bitscost arithmetic re-checksreference ladder · solver ladder
aimlp_flops_adam
aimlp in the counted-operations API, TECHNIQUE: Adam (beta 0.9 and 0.999, bias-corrected) at learning rate 0.03 on the raw features, 400 steps.
aimlp18/18030x at 8, 30x at 12, 30x at 16not scored4.9 bitscost arithmetic re-checksreference ladder · solver ladder
aimlp_flops_mom
aimlp in the counted-operations API, TECHNIQUE: heavy-ball momentum (0.9) on the raw features, learning rate 0.1, 9000 steps.
aimlp18/1801.3x at 8, 1.3x at 12, 1.3x at 16not scored0.4 bitscost arithmetic re-checksreference ladder · solver ladder
aimlp_flops_std
aimlp in the counted-operations API, TECHNIQUE: scale every feature to unit size (divide by its root mean square), run 500 gradient steps at learning rate 1.0, then fold
aimlp18/18024x at 8, 24x at 12, 24x at 16not scored4.6 bitscost arithmetic re-checksreference ladder · solver ladder
aimlp_flops_underfit
aimlp in the counted-operations API, CHEAT: the reference method stopped after 8 steps. It is cheap and (almost always) does not reach the target accuracy, so the judge r
aimlp0/1818n/anot scored-2.3 bitscost arithmetic re-checksreference ladder · solver ladder
aitrain_flops_cg
aitrain in the counted-operations API, TECHNIQUE: no gradient descent at all. Scale every feature to unit size, then solve the least-squares problem for the one-hot label
aitrain24/2401606x at 32, 1598x at 40, 1592x at 48not scored10.6 bitscost arithmetic re-checksreference ladder · solver ladder
aitrain_flops_early
aitrain in the counted-operations API, TECHNIQUE: scale every feature to unit size, hold out the last fifth of the training set, take gradient steps and stop as soon as
aitrain24/240120x at 32, 401x at 40, 259x at 480.0 bits6.6 bitscost arithmetic re-checksreference ladder · solver ladder
aitrain_flops_momentum
aitrain in the counted-operations API, TECHNIQUE: heavy-ball momentum (0.9) on the raw features, learning rate 2.0, 1500 steps.
aitrain24/2408.0x at 32, 8.0x at 40, 8.0x at 483.0 bits3.0 bitscost arithmetic re-checksreference ladder · solver ladder
aitrain_flops_std
aitrain in the counted-operations API, TECHNIQUE: scale every feature to unit size (divide by its root mean square), run 40 gradient steps, then fold the scaling back int
aitrain24/240291x at 32, 291x at 40, 291x at 488.2 bits8.2 bitscost arithmetic re-checksreference ladder · solver ladder
aitrain_flops_underfit
aitrain in the counted-operations API, CHEAT: the reference method stopped after 8 steps. It is cheap and does not reach the target accuracy, so the judge must reject it.
aitrain0/2424n/a0.0 bits-1.7 bitscost arithmetic re-checksreference ladder · solver ladder

Read from the saved ladders: the credit is the estimator's lower bound on the operations saved, in bits (each bit is a factor of two), the ratios are medians over the saved instances, and the last column is re-checked when this page is built. The exact bound is a distribution-free 95% lower bound on the median per-instance gap, a failure being charged the whole budget; it can be well above the credit, because the credit comes from a model built for noisy clock timings and cannot clear zero with only a few instances per difficulty bin, while exact counts have no such noise. A solver that answers wrongly earns nothing, and the reference against itself earns nothing. The sizes in these runs were chosen by whoever ran them, not committed in advance.

python3 tflops.py verify LADDER --rerun all

That command re-executes every record of a ladder (the files are linked in the table; the solvers and the tool ship in the installable package) and demands identical counts. The build only re-checks the cost arithmetic; it never runs a solver.

Head-to-head comparisons: the saved files
Comparison (A against B)Gap, A below B (bits)VerdictRoofline, no device neededFile
Convex training, conjugate gradient on the normal equations against scaled gradient descent: operations+2.456A used fewer operations than B at every measured size (3)n/acomparison file
Non-convex training (a ReLU network), feature scaling against Adam: operations-0.319B used fewer operations than A at every measured size (3)n/acomparison file
Non-convex training, Adam against momentum: operations+4.489A used fewer operations than B at every measured size (3)n/acomparison file
Convex training, feature scaling against momentum: operations+5.187A used fewer operations than B at every measured size (3)n/acomparison file
Convex training, adaptive early stopping against fixed steps: operations+0.112Neither is shown to use fewer operationsn/acomparison file
Text generation, a KV cache held in fp32 against one in fp64: operations-0.011B used fewer operations than A at every measured size (3)device-dependent: the faster side changes at 0.248 to 0.252 flop/bytecomparison file
Text generation, the same pair: bytes moved+0.875A used fewer bytes moved than B at every measured size (3)device-dependent: the faster side changes at 0.248 to 0.252 flop/bytecomparison file
Text generation, the same pair: peak memory+0.669A used a smaller peak memory than B at every measured size (3)device-dependent: the faster side changes at 0.248 to 0.252 flop/bytecomparison file
Training, features and weights in fp16 against fp64: bytes moved+1.684A used fewer bytes moved than B at every measured size (3)device-dependent: the faster side changes at 0.0532 to 0.0555 flop/bytecomparison file
Training, a solver that frees what it no longer needs against one that keeps everything: peak memory+0.756A used a smaller peak memory than B at every measured size (3)identical profiles: a tiecomparison file

Each figure is read from the saved file. A positive gap means A used less; a bit is a factor of two. Every record of every ladder behind these files was re-executed in full when they were made, and each file can be recomputed from its three ladders. They are practice runs on the public practice seed, so not certified results, and an accounting convention: not a time.

guldo tflops-compare check FILE BASELINE_LADDER A_LADDER B_LADDER

The ladders: baseline_aidecode_flops_ref · submission_aidecode_flops_kv · submission_aidecode_mem_kv32 · baseline_aitrain_flops_ref · submission_aitrain_flops_std · submission_aitrain_mem_std16 · submission_aitrain_mem_lean.

Does the roofline model predict real times? The saved device calibrations
DeviceFitted bandwidthFitted computeHeld-out kernels: median error (worst)fp32 against fp16 time ratio, held-out shapesFile
Apple M4 Pro (mps)217 GB/s6.7 TFLOP/s30% (worst 63%)100% on the right side of 1, median 34% offcalibration file
Apple M4 Pro (mps)221 GB/s6.7 TFLOP/s30% (worst 64%)100% on the right side of 1, median 41% offcalibration file
Apple M4 Pro (cpu)83 GB/s2.7 TFLOP/s28% (worst 107%)no fp16 runcalibration file

Each row fits the model's constants from simple kernels alone and then tests them on kernels that were never used to fit them, including a full training step of a technique compared on this site. The figures are read from the saved files. They are one operator's timings on one machine: the check is whether the roofline form describes the device, not a measurement of any submission. A median error of about a third on held-out kernels means the direction of a comparison is dependable and its size is not, and the form fits some devices (a processor with a very different memory system) much worse than others. Two separate calibrations of the first device agree on every fitted constant to within 1.7%. It needs PyTorch, which the package does not install, and takes a few minutes; guldo gpu-roofline agree A.json B.json compares two calibrations of the same device.

guldo gpu-roofline calibrate --out my-device.json

Declared but not registered

A declaration is registered only while its compiled record matches its files. These are not, and why:

  • aifactor: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • aimlp: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • aitrain: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • copper: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • hnp: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • knap: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • lwe: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • ntru: not compiled (no readable compiled.json) (run compile_domain.py compile again)
  • rlwe: decl.py changed since it was compiled (run compile_domain.py compile again)
  • sis: not compiled (no readable compiled.json) (run compile_domain.py compile again)

Add your own

You write three small pieces: how to make a test question from a secret number with the answer hidden inside (derive), how to check an answer exactly (verify), and a plain baseline solver. The first command below creates a working example to edit.

python3 compile_domain.py init mything
python3 compile_domain.py check mything
python3 compile_domain.py compile mything --quick
python3 compile_domain.py compile mything
python3 compile_domain.py show mything

New to this? The guide walks through it, including what the compiler checks, how to verify a certificate, and the limits.

What the compiler turns down

  • Questions that change depending on the clock, chance or the machine
  • A checker that accepts junk such as nothing, 0 or 1, or an answer read straight off the question
  • An answer hidden in the question text, or one answer that fits every question
  • A baseline that gets answers wrong, or that depends on the judge's own code

What it can't do

  • Judge whether your baseline is a good algorithm. A certificate only says "faster than this baseline"
  • Prove a problem has no shortcut
  • Prove speedups above about 5 bits (about 32 times faster) with a 120 s time limit