The fmul instruction
- Area
- LLVM IR constructs
- Kind
- construct
- Level
- L3, the top level.
- Evidence present above the level
- None above the level.
- Evidence
- Reference
LLVM LangRef 24.0.0git #fmul-instruction- Quote
The ‘fmul’ instruction returns the product of its two operands.
- Lean declarations
MojoProof.LLVM.Parser.instMojoProof.LLVM.InstMojoProof.Sem.execMojoProof.Sem.floatBinMojoProof.Sym.exec_fbinMojoProof.Sym.exec_fbinC
- Corpus files
tests/corpus/gemv/gemv_f32_gemv_kernel_float32_float32_float32_False_b79a852b.nvptx.lltests/corpus/gemv/gemv_f32_gevm_kernel_float32_float32_float32_1024_1308aaae.nvptx.lltests/corpus/gevm_t512/gevm_f32_t512_gevm_kernel_float32_float32_float32_512_7a789db0.nvptx.lltests/corpus/layernorm/ln_rowwise_block_t0_r1_ax0_w1_bs1024_c4d21970.nvptx.lltests/corpus/layernorm/ln_rowwise_block_t0_r1_ax0_w1_bs128_847b1b53.nvptx.ll
5 kernel files (
.ll) in the corpus.- Tests
MojoProofTest.RuleMojoProofTest.CorpusMojoProofTest.Modelled
- Upstream issue
- None filed.
- Depends on
- No other card.
Rule
LangRef's section on fmul (the quote is the first sentence of its overview). The importer reads fmul as Inst.fbin with FBinOp.fmul (Parser.inst); the semantics gives it a meaning in MojoProof.Sem.exec, with MojoProof.Sem.floatBin. MojoProofTest/Modelled.lean runs a kernel of it (its row fmul), and the run returns. The block checker (MojoProof/Sym/Rules.lean): Sym.exec_fbin (on a float element type, but fmul contract); Sym.exec_fbinC (on a float element type, fmul contract included, with coversC); refused (fmul contract without coversC, or a non-float element type): SState.stmt takes a contracted fmul only with its contract flag and no fbin on a non-float element type.
Corpus
69 of the 116 corpus files use it (1878 uses); corpus lists the first 5 in path order.
The programs of the library's mojo_kernel theorems use it (tests/corpus/vmul/vector_multiply_vector_multiply_vector_multiply6A6A_227fc544da3deaff.nvptx.ll).
GPU runs
A conformance test, not a proof. The records of GPU runs of corpus kernels whose IR uses it: tests/gpu/naive/record.txt, tests/gpu/vmul/record.txt. In each, the grid evaluator ran the imported corpus program on the inputs of the GPU run, and its output buffer agreed with the GPU's, bit for bit over the whole buffer, on every launch the record lists. That covers the forms of the construct those kernels use, on those inputs and launches, and nothing else.
Proved kernels
Used by a proved kernel, not proved on its own. The kernel cards with L2 evidence whose Kernel.Sound theorems are about a program whose IR uses it, with those theorems: naive-matmul (MojoProofTest.NaiveKernel.correct, MojoProofTest.NaiveOff.correct); vmul (MojoProof.Kernels.vmul.correct). A theorem's program is the corpus file mojo_import or mojo_corpus binds it to; the other files a kernel card cites do not count. Each such theorem covers the forms of the construct in the IR of the program it is about, at the launches and on the memories its premises admit.
Out of scope
Forms of the instruction the corpus does not use are read by the same parser case, but no corpus file exercises them. That the semantics gives fmul the meaning LLVM gives it rests on reading LangRef (docs/TRUST.md T7), and on the GPU runs above for their inputs, not on a check against LLVM.
Open
L3 is the top of the construct ladder. It says the construct is used by a proved kernel, not that it has a theorem of its own: the forms of it that no proved kernel's IR uses are covered by no theorem.