The GPU model
Scope
What the semantics says a GPU does beyond one thread's LLVM IR: the launch and its threads,
address spaces, shared memory, the barrier, warp shuffles, atomics, and the tensor-core and
asynchronous-copy operations the corpus's kernels call. Each card names the Lean declarations
that model the construct (lean), or not stated yet where the semantics has none. Construct
cards climb the construct ladder of roadmap/README.md: L1 modelled, L2 tested against a GPU (a
conformance test, not a proof), L3 used by a proved kernel.
Reference: the PTX ISA version 9.5 and LLVM 24.0.0git's LangRef, the versions docs/TRUST.md records, and the NVPTX usage guide of the same LLVM version. No copy of them is in the repository, so every quote is empty and each card says "quote to be added".
Cards
- launch: the grid, the blocks, their threads and special registers.
- address-spaces: the space of a pointer and of a memory block.
- shared-memory: the shared blocks of a block of threads.
- barriers: the block barrier and the happens-before it gives.
- warp-shuffles:
shfl.syncwith the full mask. - atomics:
atomicrmwwith a commutative operation and an unused result. - mma: the tensor cores' multiply-accumulate; modelled as a warp-collective step, not yet run by the grid.
- ldmatrix: a warp's load of matrices from shared memory; modelled, not yet run by the grid.
- cp-async: asynchronous copies and their groups; modelled per thread, not yet run by the grid (exec runs the commit and wait as no-ops and faults at the copies).
Open
A construct passes L1 only with a recorded GPU run of a test of it, a conformance test and not
a proof; STATUS.md lists the cards that have one. The launch is at L3: the GPU runs of
tests/gpu/ test it on their launches (one- and two-dimensional, z sides 1) and the proved
kernels use it. The barrier, shuffles, shared memory and atomics wait for a GPU run and a
proved kernel that use them; mma, ldmatrix and cp.async have a model the grid does not
run yet, and wait for its dispatch.
Status of the cards
From roadmap/status.yaml, which the roadmap script writes from the code.
| Card | Kind | Level | Evidence above the level | Next | Corpus kernels |
|---|---|---|---|---|---|
| address-spaces: address spaces, the generic, global, shared and local spaces of a pointer | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |
| atomics: atomics, atomicrmw with a commutative operation and an unused result | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |
| barriers: the block barrier, bar.sync over the threads of a block | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |
| cp-async: cp.async, asynchronous copies from global to shared memory and their groups | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |
| launch: threads and the launch, the grid and blocks of threads and their special registers | construct | L3 | - | top level | 0 |
| ldmatrix: ldmatrix, a warp's load of 8x8 matrices from shared memory | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |
| mma: mma, a warp's tensor-core multiply-accumulate | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |
| shared-memory: shared memory, the static and dynamic shared blocks of a block of threads | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |
| warp-shuffles: warp shuffles, shfl.sync of an i32 across the lanes of a warp | construct | L1 | - | L2 needs a recorded GPU run (a conformance test, not a proof) | 0 |