Roadmap / The GPU model

Warp shuffles

warp shuffles, shfl.sync of an i32 across the lanes of a warp

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
PTX ISA 9.5 #9.7.10.6
Quote
No quote yet.
Lean declarations
  • MojoProof.LLVM.Shfl
  • MojoProof.LLVM.Intrinsic.shflName
  • MojoProof.LLVM.Intrinsic.shfl_args
  • MojoProof.Sem.shflSource
  • MojoProof.Sem.shfl_erase
  • MojoProof.Sym.Seg.sound
Corpus files
None yet.

0 kernel files (.ll) in the corpus.

Tests
  • MojoProofTest.Confluence.shfl_diamond
  • MojoProofTest.Confluence.shfl_value
  • MojoProofTest.Confluence.shfls_same
  • MojoProofTest.SymSeg.gemv_segments
Upstream issue
None filed.
Depends on
gpu-model/launch

The rule. llvm.nvvm.shfl.sync.<mode>.i32 gives each lane of the warp the operand of a source lane computed from the mode (idx, up, down, bfly), the lane operand and the clamp; a lane whose source is out of range gets its own operand.

In Lean. With the full member mask and the whole warp taking part, the shuffle completes when every lane waits at it with the same mode and mask, and each lane gets the operand of the source lane MojoProof.Sem.shflSource computes. Another mask is unsupported. A shuffle orders no memory access. The block checker's summary of a block stops at a shuffle; the statements up to it are a segment (summarizeTo), and a thread's steps over a segment reach the shuffle's wait, with its operands' values (MojoProof.Sym.Seg.sound, for every program; tested at the gemv kernels' reductions). No schedule through a shuffle is proved.

Out of scope. Partial member masks, and shuffles of other types than i32.

Open. L2: no recorded GPU run. L3: no proved kernel shuffles. Ref: quote to be added.