Roadmap / The GPU model

Atomics

atomics, atomicrmw with a commutative operation and an unused result

Area
The GPU model
Kind
construct
Level
L1 (modelled in Lean). Next: L2 needs a recorded GPU run (a conformance test, not a proof).
Evidence present above the level
None above the level.
Reference
LLVM LangRef 24.0.0git #atomicrmw-instruction
Quote
No quote yet.
Lean declarations
  • MojoProof.LLVM.RmwOp
  • MojoProof.LLVM.Stmt.checkAtomic
  • MojoProof.Sem.rmw
  • MojoProof.Sem.rmw_comm
  • MojoProof.Sem.exec_atomic
  • MojoProof.Sem.step_atomic
  • MojoProof.Sem.Grid.advance_atomic_comm
Corpus files
None yet.

0 kernel files (.ll) in the corpus.

Tests
  • MojoProofTest.Atomics
  • MojoProofTest.Confluence.atomic_comm
  • MojoProofTest.Confluence.atomic_diamond
Upstream issue
None filed.
Depends on
gpu-model/launch

The rule. atomicrmw op ptr, v seq_cst reads the value at ptr, writes op of it and v, and returns the old value, as one indivisible step.

In Lean. The semantics admits atomicrmw only seq_cst at system scope, with an operation that commutes and associates and with the result unused (Stmt.checkAtomic); then two atomic updates commute (MojoProof.Sem.rmw_comm, Grid.advance_atomic_comm). The parser refuses atomic loads and stores, and other atomic instructions are not in the subset.

Open. L2: no recorded GPU run. L3: no proved kernel has an atomic (the reduction does). Ref: quote to be added.