Architecture
Optimize the program. Preserve its meaning.
One authored computation. Alternative implementations. A choice made for your constraints.
Conceptual overview. Not a compiler execution, and not a proof of equivalence.
Search, admit, price, elect, lower.
Three planes of the candidate space, one region of rewrites each. Scroll, and watch a plan get elected.
Candidate space
- Hardware
- H100 SXM5
- Authored
- 168 µs
- Elected
- —123 µs
01 Search. Rewrites grow the space outward from the authored program. Each plane holds one region of it.02 Admit. A formulation stays only if its numerics hold against an exact reference. The rest leave the plane.03 Price. Every admitted route across a plane gets a cost.04 Elect. The cheapest admitted route on each plane joins the plan.05 Lower. The plan lowers to one program you can read, kernel by kernel.
- Not admitted
- Admitted alternative
- Elected route
- Across planes
- Demo values · No measured runs.
From a model to an inspectable program.
Five stages. Each one hands the next something you can open.
ContextHardware · workload · numerics
- 01ModelAn authored program: ops, shapes, dtypes.
- 02SearchKernels that could run each op, kept side by side.
- 03SelectionOne route elected, under your conditions.
- 04LoweringMade concrete: launch, memory, rounding.
- 05ProgramEvery row decided, every choice recorded.
- Retained alternatives
- Selected route
- Handed to the next stage
Stage contracts
- 01
Start with an authored program.
The model supplies the computation to preserve. The search is over implementations of that program, not over what the program should compute.
- Input
- Model graph · input shapes · numerical requirements
- Operation
- Make the operations, data dependencies, and admissible inputs explicit.
- Output
- An authored program with a declared semantic contract
- Invariant
- The computation is the reference, not an output of the search.
program := (model, shapes, numerical_contract) - 02
Retain useful alternatives.
Alternative implementations are represented together, so shared structure is never duplicated. Context narrows what is explored; it never justifies an equivalence on its own.
- Input
- Authored program + search context
- Operation
- Apply justified rewrites, share expressions, and retain choices within an explicit search budget.
- Output
- A candidate space and the provenance of its transformations
- Invariant
- A cost estimate is not a proof that two programs have the same meaning.
candidates := search(program, context, rewrite_rules) - 03
Choose under explicit conditions.
A candidate is selected for one hardware target, workload, and numerical contract. The highlighted route describes a choice; it is not a claim of global optimality.
- Input
- Candidate space + selection constraints
- Operation
- Compare admissible candidates under a stated cost model and select an implementation.
- Output
- A chosen plan with its constraints and selection metadata
- Invariant
- The selected plan is read in the context that produced it.
plan := select(candidates, constraints, cost_model) - 04
Make the implementation concrete.
The chosen plan is translated into target-level operations, keeping its correspondence to the selected representation inspectable rather than presenting a code snippet as proof.
- Input
- Selected plan + target description
- Operation
- Resolve layouts, scheduling, and target operations while retaining the correspondence.
- Output
- A target program and a mapping back to the selected plan
- Invariant
- Lowering needs its own correctness argument or validation evidence.
artifact := lower(plan, target) - 05
Every chosen kernel, with its selection context.
The program carries its selection context, revisions, and available evidence. A receipt indexes that evidence; it is never a substitute for it.
- Input
- Lowered program + context + evidence
- Operation
- Package the artifact, reproducible conditions, samples, and checker reports.
- Output
- Program bundle · manifest · result record · receipt
- Invariant
- Missing artifacts and unrun checks stay explicit.
bundle := package(artifact, context, evidence)
Three distinct responsibilities
- Meaning
- A cheaper implementation still has to preserve the declared computation.
- Context
- Hardware, workload, and numerics guide the choice, never its correctness.
- Evidence
- Conditions, artifacts, and available checks support a result. Missing evidence stays explicit.