Roadmap / LLVM IR constructs

The intrinsic family Intrinsic.ldmatrix

Area
LLVM IR constructs
Kind
construct
Level
L0 (card written). Next: L1 needs a Lean model.
Evidence present above the level
None above the level.
Reference
PTX ISA 9.5 #warp-level-matrix-instructions-ldmatrix
Quote
Collectively load one or more matrices from shared memory for mma instruction
Lean declarations
Not stated yet.
Corpus files

5 kernel files (.ll) in the corpus.

Tests
  • MojoProofTest.Rule
  • MojoProofTest.Corpus
  • MojoProofTest.Modelled
Upstream issue
None filed.
Depends on
No other card.

Rule

PTX ISA's section on the instruction NVPTX lowers it to (the quote is the section's first sentence). The importer accepts a declaration of this family only if Intrinsic.ofDecl recognizes its name and signature (Intrinsic.name, Intrinsic.sig). The family is parsed, not modelled: MojoProofTest/Modelled.lean's kernel of a call (its row Intrinsic.ldmatrix) stops with unsupported: ldmatrix in a grid. The declarations: MojoProof.LLVM.Intrinsic.ofDecl, MojoProof.LLVM.Intrinsic, MojoProof.Sem.intrinsic. The block checker (MojoProof/Sym/Rules.lean): refused: SState.stmt takes calls of special registers and of minmax only.

Corpus

24 of the 116 corpus files use it (564 uses); corpus lists the first 5 in path order. The members called: llvm.nvvm.ldmatrix.sync.aligned.m8n8.x4.b16.p3, llvm.nvvm.ldmatrix.sync.aligned.m8n8.x4.trans.b16.p3.

Out of scope

Members of the family the corpus does not call. The NVPTX backend's documentation of the NVVM intrinsics is not quoted (no local copy); that the intrinsic is the PTX instruction cited rests on reading the PTX ISA (docs/TRUST.md T7).

Open

L1 needs a semantics of the construct: the run of its test kernel stops with unsupported: ldmatrix in a grid. L2 then needs a recorded GPU run of a test of it; there is none.