interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / seed / tilelab / WOLFRAM.md

78 lines · 5233 bytes Raw Blame History Source

TileLab: independent Wolfram references

Every number in expected.txt was reproduced by Wolfram Language. The program never reads these numbers. The evaluator ran on the hosted service https://agenttools.wolfram.com/mcp (server "Wolfram" 2026.09.15). On 2026-10-28 it was called over direct MCP HTTP, because this session's mcp.json does not mount it.

Planner (calibrated ranking, not a time prediction)

Why the model changed

The first model counted CTA-tile reuse as if the kernel staged tiles in shared memory. CUDApp's omega_gpu_gemm has no shared memory (src/omega_gpu_gemm.h): each warp loads its own 16rt x 8ct operands and band orders CTAs in column bands so packed B stays in L2. A GB10 sweep (35 configurations x 4 shapes, 9 rounds, 0 wrong elements, 3/3 chip mutants caught per run; CUDApp evidence/TILELAB-20261028/sweep/) measured what the chip does instead.

The fit

Model, with BM = 16 rt wm, BN = 8 ct wn, Kp = 32 ceil(K/32), mt = ceil(M/BM), nt = ceil(N/BN): l2 = 2 Kp (M nt + N mt); dram = 2 M Kp ceil(nt/band) + 2 Kp N when band >= 2 and 2 Kp min(N, band BN) <= cap, else 2 M Kp nt + 2 Kp N mt; cost_ns = l2/c + 2 M N Kp/p + dram/bw. FindFit of Log[cost] to Log[p50] on 96 sweep medians (the three shapes above 1024^3; 1024^3 timings are quantized at 0.204/0.306 ms and carry no ranking signal), with cap chosen by grid search over {8, 12, 16, 20, 24, 28, 32, 40, 48, 64} MiB: log-RMSE 0.281 (8-12 MiB), 0.262 (16-28), 0.253 (32-48), 0.260 (64). cap = 32 MiB (the smallest best), giving p = 37.1660364, bw = 1890.5139368, c = 1827.5440363 (bytes/ns, flop/ns). These are fitted ranking constants, not physical bandwidths. An occupancy term rw/(rw+h) fitted h -> 0 and was dropped.

Leave-one-shape-out (refit on two shapes, cap re-chosen on those two, rank the third). Regret is the best measured p50 among the model's top k plus the CUDApp default, divided by the best of all 32 configurations:

held-out shapedefault/besttop-1 + defaulttop-2 + defaulttop-3 + default
4096^31.03401.03401.00001.0000
2048x8192x20481.01841.01841.01841.0184
8192^31.33121.00001.00001.0000

The same fit without the L2 budget reached top-2 + default regrets 1.0000, 1.0184 and 1.0000, but its top-1 at 8192^3 was 1.3248 of the best. Parameter-free ranking (dram bytes, then l2 bytes) reached top-3 regrets of 1.159, 1.074 and 1.325. The 8192^3 default cell is noisy: one cell's nine samples ran from 30.75 to 44.86 ms. So the planner emits its top 2 and the default as measure lines; the chip picks.

Program output reproduced

The query rebuilds the 405-configuration search from the definitions above (cfg, regs = 4(4 rt + 2 ct + rt ct), budget 100, first minimum on ties) with the program's constants (1827.5440, 37166.0364, 1890.5139, cap 33554432).

shapeWolfram pickl2_bytesdram_bytesfloor(cost_ns)
1024^3rt2 ct4 wm4 wn4 band 833554432419430478359
4096^3rt2 ct4 wm4 wn4 band 322147483648671088644908534
2048x8192x2048rt2 ct4 wm4 wn4 band 321073741824503316482463141
100^3rt2 ct4 wm4 wn4 band 05120051200123
8192^3rt2 ct4 wm4 wn4 band 161717986918467108864039339273

The top-2 measure lines match Wolfram's Ordering[cost, 2] for these shapes and for 3072^3, 4096x1024x4096 and 1024x8192x8192. With a register budget of 20, zero configurations fit, so the program refuses with rc 2.

Streaming softmax (m, s, p)

The fixture has 32 scores: x_i = (mod(37 i + 11, 64) - 32)/4 and v_i = (mod(53 i + 7, 41) - 20)/8, for i = 0..31. It is split into four tiles of 8. The merge rule is (m1,s1,p1) + (m2,s2,p2) = (m, s1 e^(m1-m) + s2 e^(m2-m), p1 e^(m1-m) + p2 e^(m2-m)) with m = max(m1, m2).

The tolerance is 2e-6 relative (2000000 ppt), and it applies to the f64 host evaluation only. Exact real associativity does not make float merges bitwise associative. The GB10 tolerance is a separate figure, owned by CUDApp#153.

Held-out chip check (not used in the fit)

GB10, 29 configurations per shape, 9 rounds (CUDApp evidence/TILELAB-20261028/holdout/). The best of the planner's three measure lines equalled the best of all 29 on every shape: 3072^3 (2.043 ms, default 1.099x slower), 4096x1024x4096 (0.918 ms, default 1.225x), 1024x8192x8192 (3.581 ms, default 1.039x). One session, one chip.