interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

branch main Branches Tags History

CUDApp / evidence / GEMM-TUNE-20261027

f582659 evidence: GEMM-TUNE-20261027 chip gate at merged head eba7c0f (PASS 218, 6/6 red) GemmTune (Drake Stapleton's agent) committed 2026-10-27
..
01-gate/
02-control-uncached/
03-ab-r1-2/
03-ab-r3-4/
03-ab-r5-6/
03-ab-r7/
04-abS-r1-2/
04-abS-r11-12-13/
04-abS-r14/
04-abS-r3-4/
04-abS-r5-6/
04-abS-r7/
04-abS-r8-9-10/
05-gate-merged-eba7c0f/
exploration/
00-prep.log71756
AB-PLAN.md8514
AB-PLAN.sha25665
AB-PLAN.sha256.v065
AB-PLAN.sha256.v165
AB-PLAN.sha256.v265
README.md11513
ab-cells.wl11886
ab-counts.txt1945
ab-s.sh790
ab-wolfram-S.wl20849
ab-wolfram-main.wl13012
ab-wolfram-output.txt6466
ab.sh766
abS-cells.wl19723
abS-counts.txt2014
abS-wolfram-output.txt6170
explore1.sh777
explore2.sh780
explore3.sh1057
extract.sh1470
gate.sh539
gemm_ab.c7288
gemm_ab.v1.c6772
hold.sh2046
perf-gemm-tiles.patch18109
prep.sh1726

README.md

GEMM-TUNE-20261027: C3 general GEMM tile/raster tuning, paired A/B on the chip

Lane GemmTune, 2026-10-27. Arm A = main 20bd490 (merge of #112). Arm B = perf/gemm-tiles af9c854 (this branch's code commit; this evidence directory is added on top and changes no code). Chip identity is not claimed.

Change (arm B), all in src/omega_gpu_gemm.{c,h} and tests/gpu_gemm_test.c

  1. Packed scratch is GPU-cached, persistent and grow-only (packed_locked). The packs write device-private fragments, so caching them is safe; A, B and C stay uncached. AIEN_OMEGA_GEMM_PACK_CACHED=0 restores the uncached scratch (control).
  2. Banded CTA raster for MAIN: band (0 or a power of two up to 32; 3 and 64 refused by cfg_ok, host-tested). With band > 1 the grid is (band*gy, ceil(gx/band)), tile column = cy*band + (cx & (band-1)), row = cx >> log2(band), and CTAs past the tile columns EXIT (CTA-uniform; MAIN has no barrier). MAIN gets one more argument word (tile columns, OMEGA_GPU_GEMM_ARGS_WORDS 10).
  3. main_regs() with MAIN_REGS_DEFAULT 100 and the hardware GPR-limit opt-in, so rt 4 configurations are accepted.
  4. Default configuration: rt 2, ct 4, wm 2, wn 4, band 8 (stall unchanged: 4 bf16, 2 e4m3). Chosen from the EXPLORATORY holds in exploration/ (never verdict-bearing).

Kernel identity (AB-PLAN amendment 2): MAIN issues HMMA (bf16) and native QMMA (e4m3, via the QMMA patch); no shared memory is staged, so the 16 KB QMD shared-memory cap does not bind this kernel.

Gates at arm B (exact head af9c854)

whatresultlog
make test-gpu-gemm (simulator)C3 gemm sim: PASS (239 checks)00-prep.log
build/gpu_gemm_test --host-onlyC3 gemm host: PASS (209 checks) (incl. band 3 / band 64 refused)RESUME / rerun: one command
chip build/gpu_gemm_test --ceiling 120.58,238.65, beside the live 35BC3 gemm chip: PASS (218 checks), 208 shapes x both types x 4 layouts, 6/6 chip red checks caught (bf16 and e4m3 mutants 1-3, 4095 wrong each)01-gate/run.log, 01-gate/hold.log
chip gate again after git merge origin/main (#113, #119), head eba7c0f, library rebuilt with make -BC3 gemm chip: PASS (218 checks), 6/6 chip red checks caught, tc_peak and qmma_probe exit 005-gate-merged-eba7c0f/
ceilings, 01-gate holdbest gpu_tc_peak_test 119.66 TFLOP/s (bf16), best gpu_qmma_probe_test 239.05 TFLOP/s (e4m3)01-gate/run.log
control: AIEN_OMEGA_GEMM_PACK_CACHED=0chip PASS 218; 4096^3 MAIN 18.77 ms bf16 / 9.80 ms e4m3 against 4.77 / 2.96 ms cached (the switch reproduces the #112 baseline)02-control-uncached/

Every hold: flock -w 900 /tmp/aien-gb10.lock, timeout 840; hold.log has 18091 health and compute apps before and after (only pid 79557 every time, status ok).

A/B (plan AB-PLAN.md, frozen before timing; sha256 history in AB-PLAN.sha256*)

Two runs, both reported. Primary metric main_ns, secondary main_ns + pack_ns. r = median_B / median_A. FASTER: r <= 0.95 and max_B < min_A. REGRESSION: r >= 1.05 and min_B > max_A. Otherwise NO CHANGE. Samples with 18091 in_flight > 0 before or after the call are discarded.

  • Main run (plan as written, 7 rounds, driver at nice -n 19, spin 0): 03-ab-r*. 476 samples, 25 discarded, 0 failed, every cell >= 5 kept. Verdicts on main_ns: 9 FASTER, 25 NO CHANGE, 0 REGRESSION; main+pack: 4 FASTER, 30 NO CHANGE, 0 REGRESSION. Geometric mean of r: 0.759169 (main), 0.842637 (main+pack). Full table: ab-wolfram-output.txt. Finding: main_ns is host wall time from submit to marker. With spin 0 the wait is a 50 us sleep-poll, and at nice 19 with load1 16-34 many samples of both arms sit at about 3.0 ms whatever the shape. Cells under a few ms are not resolved by this run.
  • Run S (AB-PLAN amendment 3, declared before it ran: same arms, cells, rules; driver v2 --spin-us 300000 at default nice): 04-abS-r*. Rounds 1-7 left e4m3 512x8192x2048 with 4 kept B samples, so per plan line 26 rounds 8-14 ran too. 952 samples, 114 discarded, 0 failed, every cell >= 10 kept. Verdicts on main_ns: 25 FASTER, 9 NO CHANGE, 0 REGRESSION; main+pack: 14 FASTER, 20 NO CHANGE, 0 REGRESSION. Geometric mean of r: 0.3456 (main), 0.5647 (main+pack). Full table: abS-wolfram-output.txt.

All medians, ratios, TFLOP/s and ceiling fractions come from WolframLanguageEvaluator. The scripts are ab-wolfram-main.wl and ab-wolfram-S.wl; their inputs are the sample lists ab-cells.wl / abS-cells.wl, extracted by extract.sh (bookkeeping only). The key expressions: r = Median[b]/Median[a]; TFLOP/s = 2 M N K / Median[ns] / 1000; fraction = TFLOP/s / ceil with ceil = <|"bf16" -> 119.66, "e4m3" -> 239.05|>; GeometricMean[N[Median[B]/Median[A]] & /@ data].

Table (run S columns first; main-run r and verdicts at the right; times in us; TFLOP/s on main_ns; B / ceiling uses this session's ceilings 119.66 / 239.05):

typeM x N x KlayS kept A/BS med A usS med B usS rS verdictS TFLOP/s AS TFLOP/s BB / ceilingS r (main+pack)S verdict (main+pack)main-run rmain-run verdictmain-run r (main+pack)
bf161x8192x2048212/13255.998.50.385NO CHANGE0.130.340.00280.925NO CHANGE0.861NO CHANGE0.507
bf1616x12288x2048212/13461260.70.566NO CHANGE1.753.090.02580.784NO CHANGE2.035NO CHANGE1.155
bf1664x1024x2048213/12111.929.80.266FASTER2.49.020.07541.52NO CHANGE0.599NO CHANGE0.671
bf1664x2048x512212/1375.824.30.321FASTER1.775.520.04610.805NO CHANGE2.377NO CHANGE1.354
bf1664x8192x8192013/111457.3721.50.495NO CHANGE5.8911.910.09950.858NO CHANGE0.497NO CHANGE1.129
bf16512x2048x4096212/131684.4376.90.224FASTER5.122.790.19040.422FASTER1.337NO CHANGE1.66
bf16512x8192x2048212/132869.2849.30.296FASTER5.9920.230.16910.417NO CHANGE0.954NO CHANGE0.903
bf161000x999x1001014/12461.82210.479FASTER4.339.050.07560.771NO CHANGE0.825NO CHANGE1.532
bf161024x1024x1024014/11420.2168.70.401NO CHANGE5.1112.730.10640.883NO CHANGE2.012NO CHANGE0.727
bf162048x2048x2048012/123045.2756.20.248NO CHANGE5.6422.720.18990.355NO CHANGE0.412NO CHANGE0.699
bf162048x2048x4096211/126187.21108.50.179NO CHANGE5.55310.2590.251NO CHANGE0.231FASTER0.664
bf162048x12288x2048214/1216447.34216.30.256FASTER6.2724.450.20430.293FASTER0.266FASTER0.502
bf162048x16384x2048212/1222270.55480.20.246FASTER6.1725.080.20960.277FASTER0.261FASTER0.369
bf163000x5000x700013/1240521838.20.454FASTER5.1811.420.09550.51FASTER0.709NO CHANGE0.856
bf164096x4096x4096013/1225170.34694.40.187FASTER5.4629.280.24470.226FASTER0.192FASTER0.452
bf168192x64x8192012/131364.37110.521FASTER6.312.080.1010.837NO CHANGE1.785NO CHANGE1.445
bf168192x8192x8192012/12222928.835308.60.158FASTER4.9331.140.26020.176FASTER0.158FASTER0.186
e4m31x8192x2048212/13127.932.20.252FASTER0.261.040.00440.783NO CHANGE0.873NO CHANGE0.492
e4m316x12288x2048212/12239.1107.60.45FASTER3.377.480.03130.896NO CHANGE1.919NO CHANGE1.073
e4m364x1024x2048212/1375.222.40.298FASTER3.5711.980.05011.118NO CHANGE1.643NO CHANGE0.397
e4m364x2048x512213/1253.423.30.436NO CHANGE2.515.760.02411.266NO CHANGE3.927NO CHANGE3.713
e4m364x8192x8192010/13694382.80.552NO CHANGE12.3822.440.09390.933NO CHANGE0.707NO CHANGE1.177
e4m3512x2048x4096213/12859.2256.30.298FASTER1033.520.14020.527FASTER0.352NO CHANGE0.931
e4m3512x8192x2048212/111557.76420.412FASTER11.0326.760.11190.548NO CHANGE1.684NO CHANGE1.395
e4m31000x999x1001013/12330211.80.642NO CHANGE6.069.440.03951.118NO CHANGE1.741NO CHANGE0.949
e4m31024x1024x1024012/12265.7146.10.55FASTER8.0814.70.06150.925NO CHANGE4.204NO CHANGE1.097
e4m32048x2048x2048013/121612590.10.366FASTER10.6629.110.12180.522FASTER1.105NO CHANGE3.894
e4m32048x2048x4096212/113020.6778.90.258FASTER11.3844.110.18450.374FASTER0.247NO CHANGE0.696
e4m32048x12288x2048213/128366.632570.389FASTER12.3231.650.13240.425FASTER0.518FASTER1.252
e4m32048x16384x2048214/1211225.14159.90.371FASTER12.2433.040.13820.41FASTER0.404FASTER0.614
e4m33000x5000x700012/132765.21759.60.636FASTER7.5911.930.04990.681FASTER1.002NO CHANGE0.955
e4m34096x4096x4096014/1211345.32990.90.264FASTER12.1145.950.19220.313FASTER0.286FASTER0.617
e4m38192x64x8192013/12677413.50.611FASTER12.6920.770.08690.801NO CHANGE1.175NO CHANGE0.89
e4m38192x8192x8192012/11106093.619344.80.182FASTER10.3656.840.23780.203FASTER0.201FASTER0.244

Best ceiling fractions of arm B (run S): bf16 8192^3 31.14 TFLOP/s = 0.2602 of 119.66; e4m3 8192^3 56.84 TFLOP/s = 0.2378 of 239.05. Arm A, same cells: 4.93 and 10.36 TFLOP/s. The decode-shaped cells (M = 1, 16, 64) stay at 0.3-12 TFLOP/s: they are bandwidth and launch bound, and a tile change does not move them toward the tensor ceiling.

Observed, not a verdict: on four small cells (bf16 64x1024x2048, e4m3 64x1024x2048, e4m3 64x2048x512, e4m3 1000x999x1001) run S's main+pack median is higher in B (r 1.118-1.52; NO CHANGE by the rule, ranges overlap). pack_ns there is bimodal (about 85-120 us or 250-300 us) in both arms, and B lands in the upper mode more often. [INFERENCE] The likely cause is the session's L2_FLUSH_DIRTY tail, which now writes back the cached scratch lines the packs dirtied. That is not measured here.

Not claimed

  • No end-to-end serving claim: the 35B does not call this kernel.
  • This is the CUDApp chip correctness tier plus a performance A/B. It is EXERCISED on the chip beside a live server, not a full hardware qualification.
  • Timing is host wall time per launch (submit to marker), not GPU timestamps.

Files

prep.sh (clones, branch, builds), gate.sh, hold.sh (lock, health, BOARD lines, window guard), ab.sh / ab-s.sh, gemm_ab.c (driver v2) and gemm_ab.v1.c (main run), perf-gemm-tiles.patch (the code change as applied), exploration/ (EXPLORATORY holds explore1-3 and the 05:54Z dev-tree precheck).