1# matmul: a deterministic shared-memory tiled f32 matrix multiply and
2# matrix-vector product on the GPU (CUDA and Metal), in exact mode: every f32
3# op correctly rounded and FTZ, never fused, and a fixed accumulation order
4# (C[i][j] = ((0 + a0 b0) + a1 b1) + .. in k order; y[i]: lane l sums k = l,
5# l + 32, .. in order, then the warp butterfly), so the bits equal
6# mesh-ref::matmul's CPU reference on every GPU (kcheck GM*). The seed of GPU
7# inference (docs/plan-disagg-inference.md); tensor cores are the later fast mode.
8# The matrices live in the program's scratch (device memory: A, B, C of up to
9# 3072 x 3072, then x and y), generated on the device from a counter hash
10# (mesh_ref::matmul::value), copied to the view's window on request.
11# Ops: 3 SET arg = field << 24 | value (0 M, 1 K, 2 N: 1..=3072; 3 seed of A,
12# 4 seed of B and x); 4 GEN arg = which << 24 | chunk (0 A, 1 B, 2 x; 65536
13# elements a chunk); 5 MM arg = C tile (64 x 64, row-major tiles); 6 MV arg =
14# 64-row block of y = A x (A M x K); 7 COPY arg = which << 24 | chunk (0 C, 1 y:
15# 65536 floats into the window at 0x1000).
16# View: 0x0 magic, 0x4 M, 0x8 K, 0xc N, 0x10 seed A, 0x14 seed B, 0x18 tiles done.
17name = "matmul"
18abi = 6
19view_bytes = 0x41000
20nodes = "fit"
21warps = 8
22shared_bytes = 0x2000
23scratch_bytes = 0x6c08000
24policy = "on_demand"
25fanout = 32
26counters = ["tiles", "rows", "gens", "copies"]
27fields = ["m:u32:0x4", "k:u32:0x8", "n:u32:0xc", "seed_a:u32:0x10", "seed_b:u32:0x14", "tiles:u32:0x18"]
28backends = ["cuda", "metal"]