Docs
The project's documents, rendered from the repository. If something here is unclear, that's a bug in the docs, and I'd be glad to hear about it.
Start here
Reference
- What is proved
- Bugs we found in Mojo and MAX
- Trusted base
mojo_kernel: the kernel theorem of an imported GPU kernel- Tactics and commands
- The block checker and its automation
- Bugs and issues ledger
- Dependencies
- The repository
- Related work
Proofs written out
Each document gives the informal proof of one family of theorems, with its premises and scope. The Lean statement is the reference.
- Proof documents
Grid.Soundfrom one run (Grid.sound_of_one_run)- Asynchronous copies and their groups (
AsyncCopy,AsyncOp,Async,Async.Step,Async.Run,Async.lazyRun,Async.Run.lazy,Async.Run.within,Async.lazyRun_init,Async.wait_run,Async.visible,Async.determined,Async.visible_bytes) - A
retto a caller frame (Block.sound_retWith,Block.sound_back) - Race freedom by ownership per barrier interval (
racy_eq_false_of_phased) - The warp butterfly as a reduction tree (
bflyRounds,bflyRoundsAt,bflyOffsets,bflyTree,eval_bflyTree,depth_bflyTree,leaves_bfly,leaves_offsets,leaves_warp,shflSource_group,shflSource_bfly,bfly_warp_error,bfly_add_error,bflyRounds_congr) - A program with contraction off runs as the program under a never-fusing oracle
fmul contractin the block checker (coversC,Block.soundC)- The core: what every machine has (
GPUProof) - The contracted dot-product fold (
dotLoop) - One edge of a
br i1into blocks withphis (Block.sound_to) - The fast race check finds every race (
fast_sound) - Float bounds of layer norm's and RMS norm's outputs with
rsqrt.approx - Float bounds of reductions: any tree, butterflies of any width, block trees, mean, variance, max-subtracted exponential sums, the compiled exponential and log-softmax
- Float bounds of Welford's merge along any tree
- The gemv kernels in the block checker: what each block needs (a plan)
- The global thread index (
Launch.index_ops,Launch.index_oneDim,Launch.index_inj, and on 2-D launchesLaunch.thread_inj,Launch.xy_inj,Launch.cell_inj,Launch.cell_apart; onto:Launch.index_onto,Launch.cell_onto,Launch.index_lt_mul) - PROOF: the kernel theorem from a covered path or loop run per thread (
Kernel.sound_of_chains) - Laminar levels, happens-before and use maps
- The layout laws
- Written tiles give the tensor (
Block.holds_of_tiles) - Loops by induction on the trip count (
Block.sound_loop) - Mixed-radix indices at symbolic sizes
- The naive matmul kernel at every row stride (
NaiveFam.sound) vector_additionwalks the path its index selects (vadd_walk,mojo_obl)- The one-run theorem (
Confluent.one_run) - Skeleton transfer, the output term and payload relations (T3, T4, T5)
- Phi entry along a path (
Block.sound_pathWith_ptrs,Ends.edge) - The precondition of a binary elementwise kernel, and its satisfiability
- The pointer facts of a block summary (
Block.sound_ptrs) vector_addition's accesses are race-free by construction (mojo_race)- The reduction's halving tree and atomic sum (
racy_halving,Grid.sound_halving,rmw_add_perm) - The trace-replay checker
- Schedule independence by ownership (T2′,
Grid.confluent_owned) - Schedule independence (T2,
Grid.confluent) - MojoProof's signature (
sig) - The kernel theorem from one run per address choice (
Kernel.skel_sound,Kernel.Sound.of_blocks) - The spec layer: specifications are mathematics
- Tensor cores: fragments,
ldmatrixandmma(Frag,Frag.bijOn,fragA_inv,fragB_inv,fragC_inv,ldm_inv,quad_inv,mmaFrags_inv,ldmatrix_gather,ldmatrix_fragA,ldmatrix_fragB_cols,ldmatrix_fragB,ldmatrix_fragBt,mmaStep_gather,mma_exact,mma_contract,castDot_ok,fuseAcc_ok,gridAcc_ok,seqAcc_ok,Grid.warpReady,mmaWarp_spec,ldmWarp_spec,Grid.fire_mma) - Theorem 0 at MojoProof's grid (
Sound.of_one_runatsig) - The tile layer
- The warp's dot product: strided loops and a butterfly (
stride,groupDot,warpDot,sum_stride,length_stride,bfly_stride,bfly_matVec,bfly_vecMat,bfly_stride_error,groupDot_error,groupDot_matVec,groupDot_vecMat,warpDot_error,warpDot_matVec,warpDot_vecMat,bflyRounds_nanEq,bfly_stride_nanEq,groupDot_nanEq,groupDot_eq,warpDot_nanEq,warpDot_eq,bflyRoundsAt_nanEq,bflyDeliver_nanEq,bflyDeliver_error)