Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/omega-mv/patches/3db0ee06ef03ca3d # 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 Sign in to star 1 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/omega-mv#458 (code only) closed derived `3db0ee06ef03ca3d` #458 Imported from GitHub aien-dev/omega-mv#458 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `710d438cac6c1159b4ca2b39af49812ce08f554b` · Head `e33bf666094c63b24f75fc3213422db74af263ab` ### Fetch it A git bundle of the pull request's head, `2944931` bytes. ``` curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/3db0ee06ef03ca3d.bundle -o 3db0ee06ef03ca3d.bundle git fetch 3db0ee06ef03ca3d.bundle refs/pull/458/head ``` Raw bundle · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/omega-mv 458 e33bf666094c63b24f75fc3213422db74af263ab ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"omega-mv","number":458,"url":"https://github.com/aien-dev/omega-mv/pull/458","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:56Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 935bb0ef4..f970bd751 100644 --- a/.crumb +++ b/.crumb @@ -64,7 +64,7 @@ }, { "digest": "b98001ac8c91759a2eb2125dadf492b7cb2dc1072279baad13a5d7c50470df12", - "last_commit": "abb4d224", + "last_commit": "710d438c", "name": "mk", "purpose": "Directory mk. Purpose not yet described by a human." }, @@ -82,38 +82,38 @@ }, { "digest": "119a9f1adb744797c10e946c8e9725ec260587fb303668d71a627527d31a8e84", - "last_commit": "accd294d", + "last_commit": "710d438c", "name": "spec", "purpose": "Directory spec. Purpose not yet described by a human." }, { "digest": "d69b7371545db3c5920b5e035b3d1d8b8205664f393fedd7b9fc1bb582f23821", - "last_commit": "265ce82a", + "last_commit": "8d0698e9", "name": "src", "purpose": "Directory src. Purpose not yet described by a human." }, { "digest": "8401c311b8d73c13a75937463ca173dba2af1a3e79fda3e126be4e1918f56436", - "last_commit": "accd294d", + "last_commit": "710d438c", "name": "tests", "purpose": "Directory tests. Purpose not yet described by a human." }, { "digest": "84e7502fdc66e65c9c94ffaa834cc53aec818ee3215716ba98926cf1c70bcca8", - "last_commit": "dd67f6bd", + "last_commit": "8d0698e9", "name": "tools", "purpose": "Directory tools. Purpose not yet described by a human." } ], "children_root": "sha256:44431b7effe75de4017e5a7fe6e7810607b465f61b217cf1df997d7cf1f9788f", - "compiled_at": "2026-10-15T00:25:19Z", + "compiled_at": "2026-10-15T01:56:24Z", "compiler": "crumb-compile/1", - "digest": "sha256:d33abb528566e2b7158ab4ef752b8d810ec7e5073bb6d196e584cb17cc9f2bec", - "evidence_files": 7963, - "evidence_root": "sha256:d198e446f05fd456453e386f3d6cfa4f28afb8ea8adbe0ed352bd9815d3cf3dd", - "files": 10731, - "generated_at_commit": "6dd6b739360d4ac2f5f997a96b6f8b110951a0a1", - "source_tree": "sha256:af844ade36bd73d7f365f4b0980b1c9f063baaf0aa0c4728c2417be693b92459" + "digest": "sha256:7ef7d0ef646b0b36c0234f60d12a394e4fdb75cab2a8d3fa32a928d5505eff21", + "evidence_files": 8525, + "evidence_root": "sha256:7e338e990796a9edfddac421772f65cfe8bfdef7432fcfcb55685c44db83af7c", + "files": 11293, + "generated_at_commit": "c732af7e70e0fdad016a3c4f8555ffa25afccfd7", + "source_tree": "sha256:1b48524c014108a701e61791df2c07b30c6a5da6e470295f6448f95bf9527644" }, "owner_lane": "", "provenance": { diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/NOTES.md b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/NOTES.md new file mode 100644 index 000000000..1aed37ddc --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/NOTES.md @@ -0,0 +1,70 @@ +# OWN-30B re-qualification at omega main (after #439), 2026-10-15 + +Base: omega main 710d438c (62833658 #439 plus #455: checker2 fixtures, mk/checker2.mk, spec/one-layer-receipts.md and crumbs; no src change), +clean tree. Physics 6d7cf0d4 (physics.lock), clean. Driver nvidia-open 580.173.02, GB10. +libomega_gpu.a at this base: sha256 6a6cb4df479ddbcc5cd4ef0fda1aea968832b2b70be2ff3312051c3e9921aad5, byte-identical to +the pre-merge RC archive (d0889a94 notes) and to the archive aien-sovereign-core now locks. + +Each gate ran in its own `quietlock hold --owner OWN30B --minutes 20` under `flock /tmp/aien-gb10.lock`, one after the +other, nothing killed or timed out. Commands: `omega-gates.sh` (series) and `stage2.sh` (reruns, cross-base, #457). +Verdict lines: `gates/summary.txt`; full output: `gates/.out`; receipts: `gates//`. + +## Gate results (gates/) + +| gate | verdict | vs pre-merge | +|---|---|---| +| bf16_gemv | PASS | numbers UNVERIFIED (no committed pre-merge log) | +| cmdlist | PASS, chip 31/31 | same as DECODE-LAUNCH-COLLAPSE-20261013/cmdlist-r5-stamps (31/31) | +| decode_attn | PASS | UNVERIFIED | +| decode_graph main | PASS, chip 13/13; C one list 3978.7 us/token (2 layers) vs A 5002.5, B 5337.5 | pre-merge graph-r3-stamps C 3928.2, A 4891.4, B 5320.6 (C +1.3%, calc:c370931847535fb8) | +| decode_graph red | FAILED_AS_EXPECTED | same | +| decode_graph cached | PASS | UNVERIFIED | +| fp8, fp8_v2, fp8gemm | PASS | UNVERIFIED | +| l2d_barrier, l2d_prefetch | PASS | same verdicts as OWN30B-L2D-*-20261014/r1 | +| matmul_api, router, tcgemm, attention, cut4b, elementwise | PASS | UNVERIFIED | +| reconv | PASS 235/235 (run through `sh`, see below) | UNVERIFIED | +| prefill_attn | FAIL (2 checks, fused step only) | pre-existing, see below | +| l1g (qmma pfgemm qgemm) | FAIL (pfgemm only) | pre-existing, identical to OWN30B-L1G-GEMM-1e76e728 | + +### prefill_attn FAIL: pre-existing test defect, not a merge regression +- Failing checks (step `main-fused`, `--fused --quick`): `continuation: mirror view valid 0 (want 369)` and + `negative control: a foreign rewrite without invalidate must show (stale mirror), 0 outputs differ`. All other steps PASS + (host 69/0, sim 97/0, main 164/0, warps4 127/0, spread 103/0 x4). [OBSERVED gates/prefill_attn/main-fused.log] +- Cause [OBSERVED in code]: the fused path never uses the K/V mirror (`src/omega_gpu_prefill_attn_api.c:298,333` + `if (!g.fused && !g.mirror_off && ...)`), but `chip_continuation()` (added in bba7688a, cut 5) only skips when the build + has no mirror or `--no-mirror`; it does not skip under `--fused`. The cut 5 evidence (OWN30B-L1A-PATTN5-PERSIST-bba7688a) + ran only the non-fused main step, so this combination had no committed chip run before. +- Cross-base: the same gate at the pre-merge RC d0889a94 fails identically (`rc-d0889a94/prefill_attn/main-fused.log`). + The gate script, the test and the prefill src are byte-identical between d0889a94 and 710d438c. +- Fix (not made here): `chip_continuation` should also skip in fused mode. + +### l1g FAIL: pre-existing, identical to the pre-merge evidence +- `pfgemm-chip` (`gpu_pfgemm_test --shape-knob 4 16 1 --chip`): `gateup bit-identity on 48 sampled rows: 101 differ (beyond + 1 bf16 ulp; 1 within 1 ulp of 36864)`, GPU_PFGEMM: FAIL; down, qkv, o 0 differ. OWN30B-L1G-GEMM-1e76e728/pfgemm-chip.log + has the same 101 / 1 / FAIL. Timings faster now (gateup median 3.216 ms vs 3.999 ms; down 2.666 vs 3.499). + qmma probe, qgemm chip, qgemm cached, qgemm cached wait0 gateup/down: exit 0. qmma-words.bin is byte-identical to + OWN30B-L1G-QMMA-PFGEMM-c742aa13/qmma-words.bin. + +### reconv runner mode +`tools/run_gpu_reconv_chip.sh` is committed as mode 100644, so the series got rc 126 (Permission denied); the rerun through +`sh tools/run_gpu_reconv_chip.sh` is `gates/reconv-sh.out` (PASS 235/235). + +## omega #457: cached CPU_WRITE buffers, stale L2 after a host write (omega457/) + +ANSWER: YES. Sealed investigation folder (plan.md Result, SHA256SUMS; the two repro binaries +`l2_stale_test` d484de7b... and `l2_stale_test_fix` abfb86ae... are listed in SHA256SUMS but not committed). +- DOCS: nvos.h:1117-1118 "For system memory this will not be coherent with direct CPU mappings."; clc96f.h:73 + L2_SYSMEM_NCOH_INVALIDATE 0x11. DOCS SILENT on next-launch visibility after a host write. +- Baseline (frozen 6a6cb4df): rewrite of a GPU-cached FP8 weight buffer the GPU already read: STALE_READ 5/5, 4096 of 4096 + lines stale on each of 3 later launches. Negative control (uncached): FRESH 5/5. Free + re-upload: FRESH 5/5 both modes. +- Fix candidate (proposed in its own PR, not merged here): the platform records a host sync into a GPU-cached buffer and + starts the next submission with L2_SYSMEM_NCOH_INVALIDATE. variant=fix 20/20 FRESH. +- Regression gate `tools/run_gpu_l2_stale_chip.sh`: red on unfixed 710d438c (FAIL, rewrite cached=1 STALE 5/5), green on + the fix (PASS 20/20). fp8, decode_graph cached and cmdlist gates PASS on the fix. +- Production today writes cached weights once before any GPU read (`AIEN_OMEGA_FP8_WEIGHT_CACHE=1` only), so no live + corruption was observed; any future host rewrite of a cached buffer would be read stale without the fix. + +### #457 fix after review (omega457-gate-fix-r2/) +The fix branch was revised after review (pending flag cleared on device close, distinct refusal for the prefix copy). The +regression gate was rerun on that revision: GPU_L2_STALE_CHIP PASS, 20/20 FRESH. device.txt shows 8f491df2 dirty: the run +used the uncommitted revision, committed unchanged as 6c87d849 (its only src diff from 8f491df2). diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/SHA256SUMS b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/SHA256SUMS new file mode 100644 index 000000000..96cd94198 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/SHA256SUMS @@ -0,0 +1,532 @@ +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/attention/FB1-CUT5-710d438c/build.log +94c5d85397039f428b14de6c75e26ace6f1062e052e6d45997486f7c56d32511 ./gates/attention/FB1-CUT5-710d438c/device.txt +ad6ab1b22937beddaa843d17a4c00e902df529aa02d92ee2ee61102951f43006 ./gates/attention/FB1-CUT5-710d438c/gpu_attention_test.c +db8e44ff47d2012049763b1adebf8c4724f07988bfb6f858fe5173e40fa4a066 ./gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.c +f9be0e256e10e0664bc0602e862b544041a658248bd7200b463753fde81b396a ./gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.h +cc2646a74fa47fdec5f074db702578cd1c3d264d750bdaf947c73f107576962d ./gates/attention/FB1-CUT5-710d438c/receipt.json +953fd231ea51b077d8bdf3397d69948ef12d7f96cc8fa3540f14f1b47df00777 ./gates/attention/FB1-CUT5-710d438c/run.log +95994f90d83afea6f11f17ec466de90737986a0dbe4b8072518a0236bbdbfed9 ./gates/attention/FB1-CUT5-710d438c/sim.log +1e57804d07602e1df77530bfef250b6b406e2232f077787637568c31c1a4ebd3 ./gates/attention/FB1-CUT5-710d438c/sweep.json +43a010b3eeeacf534a7e2584850f64186bcdd15688428ff9d13c1f4ea09a613f ./gates/attention/FB1-CUT5-710d438c/sweep.log +e18724da84216ce306f59e9f44b15f46905ae8286c69f8e0436e6fdb586fc3a8 ./gates/attention/FB1-CUT5-710d438c/timing.json +4b66f552135d6fbfdc1f0ab3f8eb55c1967165d343974853ea525656a8200be2 ./gates/attention/FB1-CUT5-710d438c/timing.log +d11a1a998137e67935d9441da1a60ea8ad5685cb1c57767deb26ccd282aafaf8 ./gates/attention.out +3c79518545f86cd1cf23b39b2736f4b766e8bfc5e6f6c265a3b30e1bff2204d4 ./gates/bf16_gemv/argmax-study.log +c8ad2b00b50647c021d67152192a5733cce0be342d42f153c1fab6fccc270f7a ./gates/bf16_gemv/argmax-study.txt +ce143cd8bcc80fe52c158180203029c62d8fe267ab05b5974e431de98cd751d8 ./gates/bf16_gemv/baseline-matmul.log +44e4397ef3869cb7ba829bcafe6d3eea50e131737329e9b01c13ac944ddb6435 ./gates/bf16_gemv/build.log +48b0f59368c5dbbb0106709c7c92578b1a9a0c852d6f114ef68bd7e873dbdee3 ./gates/bf16_gemv/c48.log +f9777ba52406fb11012b166939d9c5374a6037e8a3f86ab762fa1a46d22b64c5 ./gates/bf16_gemv/d4.log +08e1e83ce2ce1a2fe2f896a6d9f1b9fcd5b98d4bc37d0c96ce93acf350dd6a5e ./gates/bf16_gemv/device.txt +4c1f60495b79c58a6f5ec1ea63e40ff751422fd4b6352010730151d777034d45 ./gates/bf16_gemv/host-only.log +34beab99dc077b5c5558dcc27786f707f74fed89dcdd294efb1013b2deaf788b ./gates/bf16_gemv/main.log +a9c6e2f5ab479cd2c3c5bbade0f33be12e56de203364741728489344d9b3e201 ./gates/bf16_gemv/noevict.log +cdcba2bbc13dd5a16b31eadd9596741d650de1b58eea2fdfb65e76ee6acb2c04 ./gates/bf16_gemv.out +c30ce0570b48a3dfd633a707e89232cb94298004c1766c15b7f69794181c22a4 ./gates/bf16_gemv/receipt-baseline-matmul.json +3e7b0b081da03897ee26d084b9c19fbddfdc8b966ac422fa2caf7000e9ba1245 ./gates/bf16_gemv/receipt-c48.json +2bddc5fd5dc162319c381561db0583bd9c93288a121c5c677843b766efc82af8 ./gates/bf16_gemv/receipt-d4.json +3b932f11acdd24bc99e5336be8754b119c415b9e97c65639a050006f92ecdf16 ./gates/bf16_gemv/receipt-main.json +d591ddae0932d85f7b75c4f5c1fc055ec5234ea278721dafd0e1c9bf83bb07ea ./gates/bf16_gemv/receipt-noevict.json +56160f45f6bd46fae1fea7f8473664ea6a97506d1358e758a46079c5567e943f ./gates/bf16_gemv/receipt-w32.json +266b57b755f3daceb851de6be9e35d6ce10ff57bfd25320cf660159c588b0a68 ./gates/bf16_gemv/sim.log +6d2acee120dab886cce1550b20291eb68b511c81a891a487a4e5258fb286c06d ./gates/bf16_gemv/w32.log +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/cmdlist/build.log +6e94c6ac32caafe676145bf2c945755860468b40adc5f95b567491edd90fc050 ./gates/cmdlist/device.txt +19a5e1c7793eb4bd2cd68172703e3a6996966dbc8ba3d6b015f38b6455aa75d8 ./gates/cmdlist/host-only.log +52c2a28f56346a16b96cce0779de712f7fd05b6b9af6498ad9694305cbc87d0a ./gates/cmdlist/main.log +a52077570d0408fb7613578efe2a4ef860a5ca0186c6fa2bb90ec49647b0edbd ./gates/cmdlist.out +c48ff61675ddd6862243392fe125d7fb95ff6dc1b0303e37ee4819decd4c0eac ./gates/cmdlist/receipt-main.json +f4721b4e7b3e1d4b2cf0bbde13b309abaa8922d4c7d79520282f4d3a6a73f19f ./gates/cmdlist/receipt-spin0.json +90fb388d6494bb76d147f0ff1cccda96c5e01bc64fc0cb650a694e71f26769c5 ./gates/cmdlist/sim.log +41d4f211a9263bd76b1d27caef92a57fda3e9f1f5bfc582236848cb8bab36337 ./gates/cmdlist/spin0.log +8bb3ce259912101917d45f3a89fbdfe9e1cd02264256b396ce81a1670d71d96f ./gates/cut4b/FB1-CUT4B-710d438c/attention.json +bcf1a68a29686f078440d154aa3d59be93f45544ba345363e04630a4027b68a4 ./gates/cut4b/FB1-CUT4B-710d438c/attention.log +58d8b723b21999036551e0840820e8662a747e39c895f8784356b50a2a972f6b ./gates/cut4b/FB1-CUT4B-710d438c/attention_sim.log +650168b7648e8b43644b9b51039f19a1d08ecede731a267dbc5c947dcfc46696 ./gates/cut4b/FB1-CUT4B-710d438c/attention_timing.json +9bba5b97997d8fb1fdbd44f3a25a983905301065bec366fcde7ecba3703ab436 ./gates/cut4b/FB1-CUT4B-710d438c/attention_timing.log +fc2f6f1d5bdc6288e398189cde1b7062f269e5c2132d4edff0c56ac5052154e6 ./gates/cut4b/FB1-CUT4B-710d438c/build.log +07891bf3dce24bfc67f1791065a625d87d775decf50c846aa59789f34dec7dac ./gates/cut4b/FB1-CUT4B-710d438c/device.txt +669d2268f45f4f6054e99dd7384b93db55c646ca7ee4a33c0353932b150aac25 ./gates/cut4b/FB1-CUT4B-710d438c/elementwise.json +e0ce642823a00d8970e16566b61c59caa576ed5bb8c6c76c17a843dd86784f3a ./gates/cut4b/FB1-CUT4B-710d438c/elementwise.log +b9f0c003756d13f5a832f4d9167ab5b5a5d9ba1a2121101be34cf467b00f5308 ./gates/cut4b/FB1-CUT4B-710d438c/elementwise_timing.json +2b8847ee38e1df6b44bbfb0e71f2c3c562efbd5036c2d3f68b8e8dd31851e0d6 ./gates/cut4b/FB1-CUT4B-710d438c/elementwise_timing.log +ad6ab1b22937beddaa843d17a4c00e902df529aa02d92ee2ee61102951f43006 ./gates/cut4b/FB1-CUT4B-710d438c/gpu_attention_test.c +f4b7865a3459036719024599d5a81718bd3039812dd4b23f556464581dbff5ac ./gates/cut4b/FB1-CUT4B-710d438c/gpu_elementwise_test.c +bbb5bc33d49dfc83aa2f63246ee28f8149ff0cbff3a99ffe1d729f87dae4c04f ./gates/cut4b/FB1-CUT4B-710d438c/gpu_matmul_api_test.c +17476f515a4cf5acb50b04d302ac7b2d0551cbed1d5b258c02b33bc50ffd661b ./gates/cut4b/FB1-CUT4B-710d438c/matmul.json +18bfbce5600342efbba3ccf4bf2e439eb952c2cb34b8d8217e4e354074cee574 ./gates/cut4b/FB1-CUT4B-710d438c/matmul.log +0f12d1630236f76d93cf61a050af3e0ca25858c8e39ea8991e696a43bbf0a22c ./gates/cut4b/FB1-CUT4B-710d438c/matmul_timing.json +3fd588901101178dd6b7b671c9ef6e9af12d26c99e956b61993e6b73f858fe7e ./gates/cut4b/FB1-CUT4B-710d438c/matmul_timing.log +db8e44ff47d2012049763b1adebf8c4724f07988bfb6f858fe5173e40fa4a066 ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_attention_api.c +f9be0e256e10e0664bc0602e862b544041a658248bd7200b463753fde81b396a ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_attention_api.h +7366eb0f8bbeb012f680bacc7c28b2b4bb6489726df08c6dc80dae640c0ba71c ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_elementwise_api.c +5d62a2ea6209fc5a0133f866b60469a74d3ef2a32da67a30312e4daacc96b97f ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_elementwise_api.h +95e68935ed93cac63b454a2e46a4bcae646eb337b706d2eb6c53a5165763280f ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_fmt.c +d9bcc61fb5b15230889c5fac459c2ccc4c055bfa10c4052c34d79ef7eb4933f8 ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_matmul_api.c +f89c08a11b1c0a37a0f76f895899cfe261e76dee71dbcd911f2125647a3e34f2 ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_platform.c +949515810f07f0e7ecb6c7fe71dad17d51c33c3f8ebbebd0ecd7b67abdb64f93 ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_platform_linux.c +36ffb699ce73e8d7e8be4fc8c4327ad84be678c539712972590d0bd81932d960 ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_session.c +af3df8707b9d54fd317baaa9a37d8bd869b2efc07f8928fe6f34a8366210a590 ./gates/cut4b/FB1-CUT4B-710d438c/omega_gpu_session.h +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/cut4b/FB1-CUT4B-710d438c/probe/build.log +179ff826bc590b1fcec5580dae5994f2a22ea649eb6f9e4877c3f47e46a3fa25 ./gates/cut4b/FB1-CUT4B-710d438c/probe/device.txt +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/cut4b/FB1-CUT4B-710d438c/probe/failures.txt +2cf1630f99767bd7a9ab1e1f0940516dd3b534dd71906ef0a6c7d8e7ae0c63c8 ./gates/cut4b/FB1-CUT4B-710d438c/probe/gpu_session_probe.c +0a2c87ff1ccfc766b26d85e20d97c91d9baa1b91999eb99d453cc5184b7b4d58 ./gates/cut4b/FB1-CUT4B-710d438c/probe.log +97b912eb4a61df5f806ca6239dde3e1a4f51ad20aced1642cbb83dc510a5fa6b ./gates/cut4b/FB1-CUT4B-710d438c/probe/ok_count.txt +f89c08a11b1c0a37a0f76f895899cfe261e76dee71dbcd911f2125647a3e34f2 ./gates/cut4b/FB1-CUT4B-710d438c/probe/omega_gpu_platform.c +949515810f07f0e7ecb6c7fe71dad17d51c33c3f8ebbebd0ecd7b67abdb64f93 ./gates/cut4b/FB1-CUT4B-710d438c/probe/omega_gpu_platform_linux.c +36ffb699ce73e8d7e8be4fc8c4327ad84be678c539712972590d0bd81932d960 ./gates/cut4b/FB1-CUT4B-710d438c/probe/omega_gpu_session.c +62917b652c99e4d01906f9071000c41049ab610052de2e6f3661f2aadd0097d5 ./gates/cut4b/FB1-CUT4B-710d438c/probe/probe_gpu_open.sh +c63c2b52e20cec5f83b7879d7a1e9884e3d04f726e2f8622070882fa712daee2 ./gates/cut4b/FB1-CUT4B-710d438c/probe/probe.log +737a1492b24d2c486f830c25197fe3dfe9ebd103975a4a681ed92ed56d2ee7e3 ./gates/cut4b.out +901b0f40e8ecf6b9a3d33b3a55ef1d5e0f2f6b595487c065068f7b2ac0c115d8 ./gates/decode_attn/baseline-matmul.log +66f32fbc83402bb2a0e52e65ab16dd002c489f812da3d3b30e391bd9af6b07e4 ./gates/decode_attn/build.log +770fbbdd97c9056ed5db3a6574ca610a974a0896a9ec92a0d4346b3b555de8c8 ./gates/decode_attn/depth1.log +1cf30937f23a78b32b51e191d960acb8c5a0794b0cbdf0dceaf6f512c778a48e ./gates/decode_attn/device.txt +6c03925a9331d0ac13fda50ccecab2128ded77c748ccea16a78d66f9518b31f8 ./gates/decode_attn/host-only.log +09f61f87fe90553e05b6b39b2d77126f37668de3d8e40a4501266684e51dbe89 ./gates/decode_attn/main.log +67fe17a83d968fae0d5e7d3307e15c4ea9cb03b038f5f15258d552e385e23736 ./gates/decode_attn/noevict.log +d845a7d03f82158377d82dca3f6db25f64d42f34e9398b9636225be46a26cdd7 ./gates/decode_attn.out +52affd799a89c25cc4533a56676b287770296008e50f89343834a683a5d617ca ./gates/decode_attn/persplit1024.log +835c0b037f89bf45d7839afc689b8b567dc15717d7fd57e47acb0e4dc237d574 ./gates/decode_attn/receipt-baseline-matmul.json +9e49f85d36150e8d1704e6f3faf23b01e648335a14313fb60564dcb525b358a5 ./gates/decode_attn/receipt-depth1.json +2e3e1f972de7e8e8e00d4a7856e42b7816f5f651188c45ea62c01808fde1257e ./gates/decode_attn/receipt-main.json +14d1758c1e40d1ea248fee1daa004c75e9c5deddebbfe9266a613869bd267519 ./gates/decode_attn/receipt-noevict.json +54fe23f9bf8afe9889774686f4afaa0b7df1a67a022d118c047a9da3e7b115c2 ./gates/decode_attn/receipt-persplit1024.json +2f0512cfebb60b3751133eab11007e16857e11de4671ee4cd4bde0bcb99c0368 ./gates/decode_attn/sim.log +66cd0541d6bef1045e83312c1b29d1bf5cd2b0efa6daeab6796e7d03ed61b7e9 ./gates/decode_graph/binaries.sha256 +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/decode_graph/build.log +66cd0541d6bef1045e83312c1b29d1bf5cd2b0efa6daeab6796e7d03ed61b7e9 ./gates/decode_graph_cached/binaries.sha256 +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/decode_graph_cached/build.log +d471440cae10d719d2a6d502eee410afb379ff12b17d29801e57931bf2f1114a ./gates/decode_graph_cached/cached.log +08bc071886cf478fc3c6d23211d2cf636251e4047bfad229db9e7975969806ea ./gates/decode_graph_cached/device.txt +48404021ba78c42c25154059e1c0ade4707433c5051df230c720f51db4f98fcc ./gates/decode_graph_cached/host-only.log +2875e759c0dc6cdf581f9c7ba9ffba03a18a4212b20d7479b4999c914fdab9c7 ./gates/decode_graph_cached.out +6aa9ed345a6881f11170e5072bf3369c006f71e0b717806ee6d37b2d42f69355 ./gates/decode_graph_cached/receipt-cached.json +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/decode_graph_cached/worktree.diff +2e920f69f4ec0a774627f5ca5773ad43c4aee77a92781da591b73e205b085522 ./gates/decode_graph/device.txt +48404021ba78c42c25154059e1c0ade4707433c5051df230c720f51db4f98fcc ./gates/decode_graph/host-only.log +8b1d065b63ed15f3b68921af762f2d2b81a3f5b12f6e5fb6d014d1ba11a91fd7 ./gates/decode_graph/main.log +5ab33c5db28809938301eee4b2d124373729bdc67f775483eab7eaca6d6a870c ./gates/decode_graph.out +b829ba6ce27ec4144c98d1d62a14707227175780b5be3863c4b0d18fb2322c30 ./gates/decode_graph/receipt-main.json +66cd0541d6bef1045e83312c1b29d1bf5cd2b0efa6daeab6796e7d03ed61b7e9 ./gates/decode_graph_red/binaries.sha256 +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/decode_graph_red/build.log +ed9b67f128ab688e96f5d827a65d7165dee03d02dcbd0095e84b81a79191c4d4 ./gates/decode_graph_red/device.txt +48404021ba78c42c25154059e1c0ade4707433c5051df230c720f51db4f98fcc ./gates/decode_graph_red/host-only.log +c114d71a75db898e1bf9f87f71972e5e08e4f272219fa469d34215b81df07088 ./gates/decode_graph_red.out +ea9e3d311d3039cc65ef1c396888c773452ef36f1b6d4f360ad766ba171364ca ./gates/decode_graph_red/receipt-red.json +287e4895ca699a433ed651506a008f852e504874a8a146733a7f2c63b6fe3662 ./gates/decode_graph_red/red.log +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/decode_graph_red/worktree.diff +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/decode_graph/worktree.diff +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/elementwise/FB1-CUT4-710d438c/build.log +a8326dea97537e17b741cea608562663d00a6de162fb62dd136a1745dcd01772 ./gates/elementwise/FB1-CUT4-710d438c/device.txt +f4b7865a3459036719024599d5a81718bd3039812dd4b23f556464581dbff5ac ./gates/elementwise/FB1-CUT4-710d438c/gpu_elementwise_test.c +7366eb0f8bbeb012f680bacc7c28b2b4bb6489726df08c6dc80dae640c0ba71c ./gates/elementwise/FB1-CUT4-710d438c/omega_gpu_elementwise_api.c +5d62a2ea6209fc5a0133f866b60469a74d3ef2a32da67a30312e4daacc96b97f ./gates/elementwise/FB1-CUT4-710d438c/omega_gpu_elementwise_api.h +8233ca2dcdda935c3fbe372b326f7ecb06991af7c2e7fbc02d525b3adbee377c ./gates/elementwise/FB1-CUT4-710d438c/receipt.json +dec76ee6c472d5ba9443b3ae39b54908157368e36a1ed86456d6d769f2f81e35 ./gates/elementwise/FB1-CUT4-710d438c/run.log +d2f95d2c2fadeea6b34ecbc529116c803f323f4e11917abab432b41b61835740 ./gates/elementwise.out +7b1fd89ec382bb3ee5c385b1248820abed2a59d1b0a3467199dc71d3b00e55c5 ./gates/fp8/baseline-matmul.log +66f32fbc83402bb2a0e52e65ab16dd002c489f812da3d3b30e391bd9af6b07e4 ./gates/fp8/build.log +5477e1fc449f5f0e5cc495b8c77961f9e59c0b8918a4741ec11c866c1bd2ff56 ./gates/fp8/depth0.log +48653701735a9f19a0c85ab93f44163dc3b8cf43f4ea1b9143e028938cc395e6 ./gates/fp8/device.txt +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/fp8gemm/build.log +fb325b8b97532710dc83a79f7a5464ccd1035721b02c73ce1882166c0e0cf472 ./gates/fp8gemm/device.txt +5c1ef87c82804e9d08cd68e3a04e2022cf523b7921d913a2b4793e1651d5d43d ./gates/fp8gemm/down-m1024.log +fa341fd4513bb90dbd11b5f7673b7087c0c942aba8646e875c562149287facf3 ./gates/fp8gemm/gateup-m1024.log +8c6779b5a3a37bc24e36463ccc7b6cbf7a6ea1a0e6d6b248f22b551ad9aa8bd8 ./gates/fp8gemm/gateup-mt2.log +86fcc11c5baf1fb776ffcacb99190550d6adcac7b4f008f59260b48ade26aca1 ./gates/fp8gemm/gateup-mt8.log +353ac9fbed7a53a7aee6343335bae690bc7c918b87d9233bf6bbed4119776884 ./gates/fp8gemm/host-only.log +04ae3cfc7e8a5848991c45933bee38cc989217030301960106d6437745a02ad8 ./gates/fp8gemm/main.log +45b0949647882c06f74d8b832a1417b78ce9e45df4bde4ce141cdbaf28da0403 ./gates/fp8gemm/noevict.log +63c36e4badd07b9da79a30f8a4c033e9044c6df2bf47eee8aa1d362dcb12f40d ./gates/fp8gemm.out +1231c051bad14dacaffc496083b5b8ccd9b8b5a048ae3ce8b103a7725592c394 ./gates/fp8gemm/receipt-down-m1024.json +9f4da9726e0c32b00cc5077d01b2dd0edf4f3178d6b26f094cd0d053c61e671c ./gates/fp8gemm/receipt-gateup-m1024.json +98553636bf0e7f7cd1ff4589171ddda13c237108b0dd057fdb7009286f8105ba ./gates/fp8gemm/receipt-gateup-mt2.json +4931d3e69266737398d8e529cbe36168ce460aa3d0513226fd77e69034684e95 ./gates/fp8gemm/receipt-gateup-mt8.json +6af717e36e2107df93e97386da8909ebbb649bf3e7217cb61c837c0834e14d36 ./gates/fp8gemm/receipt-main.json +eaadc0008b4fb643902bf4d27165701eee15bf97760481dcfa430fc4859c620e ./gates/fp8gemm/receipt-noevict.json +bc47fe63eed6d5bf7195a461df9e4f8bb583f44c6bf80e19f1eb862f28dc7348 ./gates/fp8gemm/sim.log +6164a89b0a102738dc78079d2c8265509b7443516723732ed1e59ece761f1117 ./gates/fp8/grouped-old.log +b348e0f0406584d2c38b6d025c80313d6b8045a84ecc6ebd1b5d2d4ea3cac1eb ./gates/fp8/host-only.log +2ee3a76d01482f95af24c929d870ecf8a1ae0daea254d203dc29335c8256dee3 ./gates/fp8/main.log +754052312aabda39df947760db8048f832483d786e67823bcb002b1162114275 ./gates/fp8/noevict.log +1557e6b941d8be39d306014959cc9fea36fc9bead37aaa77b0c132df97ad563f ./gates/fp8.out +f63af1161a839934c2d2637d81f3978bee3f6b4671fb050fcd7e78a3502d7fe7 ./gates/fp8/receipt-baseline-matmul.json +0b40fc76aa9ad852a19e827dece69b0798c842c4395b14c9219725062fc83811 ./gates/fp8/receipt-depth0.json +6c7d47696ef7596c89375ae75a921b29d208936aa125c4df37b84e2e1f79076d ./gates/fp8/receipt-grouped-old.json +3d301f9e8b9c5f4c7258467616f8919e4b70363a477765473d08f75cd6981f46 ./gates/fp8/receipt-main.json +6a781814a3eb7dcb03bcc1cf39e7db0d130a6ebec2d0cf86c3208496bae45e64 ./gates/fp8/receipt-noevict.json +34e71a0e4a7d5344323208f1e209dd024337614865182f4f7cf81fe2c2bc4248 ./gates/fp8/sim.log +9ee95d0ed0948aada09e5749bfb59cf60f55e36517932092dc5b2e8fe0e004b8 ./gates/fp8_v2/build.log +b1fff112c5495f7dd095e3d5433bf7ff84b600661fa2c4d951f7115fe0eec215 ./gates/fp8_v2/device.txt +a02d0c1e858c6eb88a54b9749a3bb934ee79d1913346fb3763691838aaeb792d ./gates/fp8_v2/graph-v1-r1.log +6da7ed95ed3c91e889876a198d42ff5c30ff09303e91d64c11677dd7e618cfc7 ./gates/fp8_v2/graph-v1-r2.log +472a6f1e1e1d083b9db92d46eec0c2a65275406d379fe61918f28d126ae17890 ./gates/fp8_v2/graph-v2-r1.log +4a8bea9db228ced98b08091cf2cecec31b1dd59165cb85f35268ddc282006cc7 ./gates/fp8_v2/graph-v2-r2.log +4746a8e5fdaacbd10938290d240344cab5b29bb97b060546c6b1c99dccad6d9b ./gates/fp8_v2/hash.txt +396d89d9f81bff880b47cd36aad3e3d9d6a2849b957bebcd5aae0b56e4e4d689 ./gates/fp8_v2/host-only.log +a34b47bd533fc486e52d751b24ddb5b75bedd35a399a848c4c827c6dbc0d3001 ./gates/fp8_v2.out +004c172b840b736c43d427d650401eec724182aaa4cf9cbde794dc8dd1ef65af ./gates/fp8_v2/receipt-graph-v1-r1.json +2b8549de244cdd53157aee537838cbc95921102041b70df74a888dbb9c1edd95 ./gates/fp8_v2/receipt-graph-v1-r2.json +82ed77b500afd40639ca6512c8f4a3ce58879e39b9e82f2d78fd4b12fe89ac81 ./gates/fp8_v2/receipt-graph-v2-r1.json +91c00ac9300ead58eb272f22604244ae0bb633161324f34771d6f0bc4cd90768 ./gates/fp8_v2/receipt-graph-v2-r2.json +c8ac5922924982067f28537030a66983f5a484b9cf5c7d91d058af62fad710e3 ./gates/fp8_v2/receipt-v1.json +cf427f3b80dbb52c65b93e1d54ce3f3a72183370e845d35ed1c1634e30873b1c ./gates/fp8_v2/receipt-v2.json +1545db107f628379407816ad749e07ce02076637a886e3765581f80d3051b555 ./gates/fp8_v2/sim.log +6ae902c0914343264c9092557c0baf74a76650676ba4aecb2a186ca51927066d ./gates/fp8_v2/timelines.txt +c6792b51331507c6670bc3a64c8433cb84f5239f2a4c5c3fec938e841867db28 ./gates/fp8_v2/v1.log +0ddedee822b1becfc017e2f39a47cab912aa4c37da487b24135ff3dc60844904 ./gates/fp8_v2/v2.log +4ffde9cf1c27c72186b92636e962fee3aaaad95027398b150f58250a92921906 ./gates/l1g/build.log +78393d7e835d3f5778d2a859015b08b5506cf0242e465e320ce77ff98a546110 ./gates/l1g/device.txt +5d9cf1f5aa7ac5e9180c328e1bae85033115033fc7c93e9244286fb688b7af6a ./gates/l1g/exits.txt +826fb677246ac1b2fb0e915e3e369ad64859b081fe0c5423d19153f50de46da8 ./gates/l1g.out +d8e2f16db8805683e9fefc49b2eb34d4709beb55106aeb39f1809005529db25c ./gates/l1g/pfgemm-chip.log +7e42d8304959861612ac853cf0daaddf9324580be731580a7461463e3f26b7fe ./gates/l1g/qgemm-cached.log +e73f9fd4723365f4343f074649bde62cb2f6a6ed28e9d7cce5b977b8aafc234e ./gates/l1g/qgemm-cached-wait0-down.log +a17c022a78ec8e88be271dbf194702197998cb7267a2250457ab260a6f5afb7b ./gates/l1g/qgemm-cached-wait0-gateup.log +c6b16119bd1006947901f6a7c2c18696277656423c8f73ba4f58952d80ebba37 ./gates/l1g/qgemm-chip.log +570d057c1b815c7d734122f8e6ac535674630881f0f715ab514ddefcec66efa2 ./gates/l1g/qmma-probe.log +fe7a86cf6dd0027ad341f2a45404f3458e0b9ba6e9aec36625e57c260d9c90ba ./gates/l1g/qmma-probe-seed2.log +1fb3fbbfc8012461e337d9e4784af7d268dc66318c9f6b045dcea54df348a41d ./gates/l1g/qmma-words.bin +d860f7e16d5b4c13d38f82ee846345cc77478470bb6769bda6f33e8884a75cc4 ./gates/l2d_barrier/binaries.sha256 +75b23aafeeeede3d40f7bf67ecc675bc4e10d6a5d92224450dfb4d75acf6d222 ./gates/l2d_barrier/build.log +191a794454a70554e32fafcb4d28bb62c91e6e55a92dafab2f187d845c23db78 ./gates/l2d_barrier/cost.log +8ff77278694c6b3931f658ced4320b51a1c83bfda799d4f25c1e3f83dcce337c ./gates/l2d_barrier/device.txt +08e21af1b8814ed0677e7a0e8a6600098fbf663dee2e094990856f7279bc1f6b ./gates/l2d_barrier/graph-1-b0.log +dbcb2890de38d0cb0f6ad0e30c272ee05832407d634251ef86950139da8f059f ./gates/l2d_barrier/graph-2-b2.log +e959618f72f269822226e5b0e789d6778869da505f57f87c37cb618e7840bc0d ./gates/l2d_barrier/graph-3-b3.log +d3e446cbedb5263c5d6dea51a7b3726629fadb3822c93a8d736bae8108ea5582 ./gates/l2d_barrier/graph-4-b4.log +1ee22d6feb56c231c1dbf80a354be8ee6c9e50c53189831cd39d7068649ec762 ./gates/l2d_barrier/graph-5-b0.log +b76d0410b82ff3351bb76dc4601c457a7ed539e2c28028362879503d3446d928 ./gates/l2d_barrier/graph-red-b1.log +d46907d2af038548b276f20593700ff81130545a9738c990c388ed760c85e8f3 ./gates/l2d_barrier.out +8699e7cfb4de9b82ab7fc50f68bbdf25e8f01750f350ffb094413b621d96557e ./gates/l2d_barrier/receipt-cost.json +92dde923028625ef03bdfebeb31bb4bc84df2039b5884971f4cff6fd7d8cc7d2 ./gates/l2d_barrier/receipt-graph-1-b0.json +d8706bba63999016ae64b2ccc8263ed502fff4e5067f1ce531628b7421b623de ./gates/l2d_barrier/receipt-graph-2-b2.json +2c2a1278803953f0af23d3f9047460b4d727d42f340dafa549a9b09773ee19c2 ./gates/l2d_barrier/receipt-graph-3-b3.json +2a3f4bf7a7bc3d0ca11a1b0569113cba1e127a3911b272367131bdb445ae2e7c ./gates/l2d_barrier/receipt-graph-4-b4.json +d1d3dc28c1b4883f924d9fb1b3ef58befeaaddee690840dad399247b7a45864b ./gates/l2d_barrier/receipt-graph-5-b0.json +72012fbe2482a918802d0b9a0a6dfa386a2dffea527d3e0027aa35424a83694f ./gates/l2d_barrier/receipt-graph-red-b1.json +594eed3776d3890dc99e212aeae3d88625ceb11e2e835f57d02ab28627618b95 ./gates/l2d_prefetch/1-cached-base.log +1e6666b676a0ea76c021c3ec7b692fa7dc67b05f722d063f8748f573d1dabd84 ./gates/l2d_prefetch/2-cached-prefetch.log +e91708c996cb4463141a6fb4c8f5e57a7eca64f1e5a2ebd93239e8a1bd04dc57 ./gates/l2d_prefetch/3-cached-base.log +8f98894cdedddb44db6773397950932dd45a91a0b50f78e9325c968ee744f768 ./gates/l2d_prefetch/4-cached-prefetch.log +82e083af84537df6b59fcbf44db33876731911054cdb8b664f980017568b9765 ./gates/l2d_prefetch/5-uncached-prefetch.log +f2a258fa4edff328a3a58e12dff945133e9bbcae77fbfd5d7dc6550323599d75 ./gates/l2d_prefetch/binaries.sha256 +5cfd0e771de1af1722bb0b909d14b6c1d1d516d75b91e6293411a6b94e047c78 ./gates/l2d_prefetch/build.log +195d3d41e482308ce37aea9823e71dffb56324791d42a73056a13dd1cdf8f5f4 ./gates/l2d_prefetch/cmdlist.log +14b6b06bc7fd620433d7a5ac2f8cfcaa7411bd73afc02463aa8b69a36b662e67 ./gates/l2d_prefetch/device.txt +bc1549936443cee8f02199a4586695d2c655d6a9be53b1c583bef43c1a3cfea7 ./gates/l2d_prefetch.out +e85fefdb75fdadda6416109526cd95768210af2f9dde8b6e2f8d32c010d5f921 ./gates/l2d_prefetch/receipt-1-cached-base.json +bb82fe0a021901a25966f4af3e771b8179379909d82e724fc1b69c7b3520d3c9 ./gates/l2d_prefetch/receipt-2-cached-prefetch.json +c7ec6d3f847973f6592df9900b82e8fb60bbca78ef3a76474c1d119fedc0247a ./gates/l2d_prefetch/receipt-3-cached-base.json +d1cb40c6aab5f09f18f70d04cfd0faacea59cf0366c761f6c84ad1d93d9af686 ./gates/l2d_prefetch/receipt-4-cached-prefetch.json +cc66ab5da4ace1bceca658bc90ad87081e6280e6ba93a61a9eb3e74c321f2b40 ./gates/l2d_prefetch/receipt-5-uncached-prefetch.json +b6ab6345b69f3aa76c444d9e7f170f41b0445e3fb64e626178f85f898086bfe1 ./gates/l2d_prefetch/receipt-red.json +6ba0afd5c1daabecdb28a848b0901abae1903c4e72ad0e9cfb9b2df176e84264 ./gates/l2d_prefetch/red.log +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/matmul_api/build.log +f819e53b0d103b26355eb6de103693043e432731d82927ca0e3d37d5082432e8 ./gates/matmul_api/cta128.log +a92620e6189356f090c1eb4e68a3d67c8848068c944a24ccc650ceb09cc50453 ./gates/matmul_api/cta256.log +2f5393fdd9d84ff57a5254943396b2f0b9d07b6ff049c4f640eb30892807b05c ./gates/matmul_api/device.txt +5673f8f255acf508a6263d690faec954435c21a41c484df80738bf58e9dcd9e0 ./gates/matmul_api/mutant.log +2bc7058c729191fa0a23752a677462d0ad3447d17493efdc222d25198e7d9b85 ./gates/matmul_api.out +bd6a824457d4694171914f2369ab28d1c98abd34768faaddcec0f970cdea54b7 ./gates/matmul_api/receipt-cta128.json +752efb3b5947453397284154dbf6191f4c6ecaae1141d3ae6f64b891d8472d9a ./gates/matmul_api/receipt-cta256.json +858663d6c8f59adb5a968922e33479d0d4529fb86a9a6de86416546897cb8f38 ./gates/matmul_api/receipt-mutant.json +a106f0feb2aed0370416d13e9009af950f34a855e941973c47715e96a8c3d144 ./gates/matmul_api/receipt-sweep.json +2968d008e781d0aaabea19b06de778d62c7d6a9f4dccae5f1bbf3dbdd1daf86c ./gates/matmul_api/receipt-timing.json +438314dd331cb4fc090d78c07e87e91dc7adfc3966ce6f788f616be6c462ed43 ./gates/matmul_api/sweep.log +2248f9131630a7004572aaec8e004c1b2e76f1e480c6ff53bdeb9f92cf0bae17 ./gates/matmul_api/timing.log +757d8fd58371a2b3cf43c598b76010bbc287248c3bb14fae27ccda963abf16ff ./gates/prefill_attn/baseline-decode.log +5fa6159991119365de67dbae5eacef99e1a4d24b2300a9dbe4492ca7b311c291 ./gates/prefill_attn/build.log +e20566d150d869610e61f1c06a31aab869c069b7c585f3f74982ccd714363a3e ./gates/prefill_attn/clocks.csv +7f7a8078354420c25dbb72637f0a4ab823a0d236e627026a1a3a936c22e6de93 ./gates/prefill_attn/device.txt +ce142f06e62b3f9c6d0db635a95537911cea4cb4ec6511e6785e24200ae0405c ./gates/prefill_attn/host-only.log +16787952bfd024b4d38bab1bf6be291db7473cc6043879a1ee3bc8834167d542 ./gates/prefill_attn/main-fused.log +209f5cdfde4901a886efc5870153a4f9b5c4efcd074906d1c3417108fbb763c9 ./gates/prefill_attn/main.log +65de0b59273fe9fd8751e1d0700076942536d4fe661aae734f4e77df534f3312 ./gates/prefill_attn.out +0b9d444d1d56dac0483c55bc89d2d860cab936f0f38ec5a06e0f3f8da0795977 ./gates/prefill_attn/receipt-baseline-decode.json +da745b20ab15643ba026b9cf624033e290abbc99041f43b76bdea8e41155756d ./gates/prefill_attn/receipt-main-fused.json +18aa67afc44be3cbd7054a7924335d44e22e87c16db43cec7c2b6880e9178cb6 ./gates/prefill_attn/receipt-main.json +39d01e4501bc65c791b0b068716406ed9eb883a1322f02710d9f7f471567d3d7 ./gates/prefill_attn/receipt-warps4.json +a560e622fbe2abfd582d2e47d3c9faac3f1e747d69af861c369529c51d2ee2e3 ./gates/prefill_attn/sim.log +07bc1a954f7181d5a229efd9a74e0a460d07ebe526a861a4e363b87d9ff8a615 ./gates/prefill_attn/spread-fused-cold.log +281917f5ba5ceb8c3cb9279c4f14fe37d4915582b9b815ad6daa6c732fb4f228 ./gates/prefill_attn/spread-fused-warm5.log +ca39426760351b9ab66533f59d277f0b60b9626a552a1ba68dd8341a237a2696 ./gates/prefill_attn/spread-marks.txt +9adc34403f4929b299aff54d7ee3a92110ea7d4151875958b29f6ee6b76ab71d ./gates/prefill_attn/spread-split-cold.log +3c9561dee6b6ab8d2f70c39c0e3fad2bdfc9359b61e809184bc81da9706abc8b ./gates/prefill_attn/spread-split-warm5.log +9a9dddf56e48e8bc09d44f565ab266d339d1d70d72be626b314da21a615e682d ./gates/prefill_attn/warps4.log +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./gates/reconv/GPU-RECONV-710d438c/build.log +17ae9fb608fd213926fa5a438da447cca4633dad7200a6a239c19cbd47516eac ./gates/reconv/GPU-RECONV-710d438c/bw_warp_sim.h +17e0ddd412a27b212f08c04b39b228e32f1e2cea52e3cdffcebd662eb680cf2c ./gates/reconv/GPU-RECONV-710d438c/device.txt +38532161581eef2dcd0197e9123044609b976dd7984494cfc9eb4a5ff0d0a1aa ./gates/reconv/GPU-RECONV-710d438c/gpu_reconv_test.c +efc00956abbfd021f97b5e38881e886341e2bdebfaf3edcd02c16ff731658b0d ./gates/reconv/GPU-RECONV-710d438c/omega_blackwell_codegen.c +0da10397dd4ee813633afa425192d126d056684fdd998585fea666995a7c50ea ./gates/reconv/GPU-RECONV-710d438c/omega_bw_reconv.h +7366eb0f8bbeb012f680bacc7c28b2b4bb6489726df08c6dc80dae640c0ba71c ./gates/reconv/GPU-RECONV-710d438c/omega_gpu_elementwise_api.c +5d62a2ea6209fc5a0133f866b60469a74d3ef2a32da67a30312e4daacc96b97f ./gates/reconv/GPU-RECONV-710d438c/omega_gpu_elementwise_api.h +005981df1d37536671c79f842eefe5bfe6e4100af5fb50c479172239edd247ea ./gates/reconv/GPU-RECONV-710d438c/receipt.json +18970f49646b00001332911e0034144c534df94f7069a5ba286c74363fbe159a ./gates/reconv/GPU-RECONV-710d438c/run.log +42d34eb5f1f6039fd8d0a93f93f50c07550ec16e3eb185f6101bf2fe6b061b67 ./gates/reconv.out +e464ae4a7931f1e9ae992304780a8a1818f289342d5446fc0f32b428704b3aef ./gates/reconv-sh.out +1dc7ed2b6562a6e21572e78fe2a7f02c2069d4c9cb5da458c9a8e0e96f90e880 ./gates/router/baseline-matmul.log +66f32fbc83402bb2a0e52e65ab16dd002c489f812da3d3b30e391bd9af6b07e4 ./gates/router/build.log +5cfef6c9e2412f97e226254d9d0365585fae49e03120da807f8b2e91fa14b8ed ./gates/router/device.txt +4e3d22dc50ec9f7d083ee344423bf842d6c2c9b302bb4721839c8fe300a119e7 ./gates/router/host-only.log +dda0cf949170f759da61890fa11a2d8a8d4fa6471553558f26cfcd4a85b47d3d ./gates/router/main.log +3cd2001f1bbbb26a9e3d4dc7f1775e8dc660895f74c677397a0fec200d8c79e2 ./gates/router/noevict.log +b274bade7e31ebccdd0cf95bf91230f191357cc0f7aa03a295dfe62aadc5ba0d ./gates/router.out +5f829009002959b0a4965f1c016bbb6f3786545789b09816c7d652be3a39b08e ./gates/router/receipt-baseline-matmul.json +c295577f7f91500049e4c37d06147e32338e44bad2b428033bc17605865cf2a8 ./gates/router/receipt-main.json +1747b5ceaeebfd6d76a4ee0355d86348d24641a458f830a4177ac320fda2a7dc ./gates/router/receipt-noevict.json +bb140511ae5423765ee528f8bac9384e05e33fac8033603849cdfe7124c3eba4 ./gates/router/receipt-w16-d8.json +33d6a7b8c614bb78077b01fd768e413b1b50aaeb218cad6011d281caac8b25b5 ./gates/router/receipt-w32-d8.json +8c883e88a526dab7bf1d5d4bc5c3cb4061b4c64d9b1954dbd696881b85704f07 ./gates/router/receipt-w8-d8.json +628565a72d16563c83fad624acd5598c5c01657ba5fa703e5b15faeaf682dd52 ./gates/router/sim.log +d5bc185a8c99c256cb23ab2e6109b505c5ff43e0404f24f47b0c0fd9f6794415 ./gates/router/w16-d8.log +5030106ba1044258f029610d81d92c2e4b5b65a4584dc3630add43bb9f3c8852 ./gates/router/w32-d8.log +1232f685c70f5161a443ae0b9b43f4d53ab253235d86a80f3d4585cc7852f47b ./gates/router/w8-d8.log +9a13ec24cbd6eb8aeefa8ff6d2465e5bba750b6b212778b46a89fb054cc9647d ./gates/summary.txt +c4e8babc8d1e4f57baf19447afc22e102291cdeadaf6b849becb3b4308f54687 ./gates/tcgemm/build.log +7bb228d33be884dddd7a0561ce4fed4f9612541bc9b403d83f30b34e19bab3a1 ./gates/tcgemm/device.txt +12412c849d39327f60dc336ec9646ecac1ef09133413da0c3e782402b3f004d5 ./gates/tcgemm/down-128-r1.log +168a0959b1c44ee92eeaa568df496bf10b6b45e312813cf1b8d461feb1a0733b ./gates/tcgemm/down-128-r2.log +247944b15a676265ae377590de9df9446d66727ed345dd8d1cac7d04b7aeefa1 ./gates/tcgemm/down-128-r3.log +255589335ade57ec8d35a20c18a91909cf5ed44bf898462a00aa738919fc0eee ./gates/tcgemm/down-128-r4.log +bb5306b6613d089244305617be22a2fa4129f590aca3871b7556b70346c0f825 ./gates/tcgemm/down-128-r5.log +65c9c8e044141ae429890e317c4aac05abe5597f8f8616852fa600beff66ea83 ./gates/tcgemm/down-3600-r1.log +4a4b782a8e390f457b2db6cc086268b6087cac6d7fd72ec6ae9227e662439cb3 ./gates/tcgemm/down-3600-r2.log +0fe213f0605531b25c240890ec27472fef577f07fdc7af9dcce1f78d996008d7 ./gates/tcgemm/down-3600-r3.log +785b08c8595ee086a71acdd7b9b0f4abaae6f7030efb2a05ad763ef4cf1ab175 ./gates/tcgemm/down-3600-r4.log +8c263c3f7c15cdedee33d8e97edbc0d1de3366cc72bde38897afd012d8ce38cd ./gates/tcgemm/down-3600-r5.log +9078bfe9023e2c3b4986c08d66ccf65fbcf653791b13fa22298c2e42bb9dca14 ./gates/tcgemm/exits.txt +266aede67d5a34195a6df71f9d5eeed33ac13f348ec85aaef7b99de31541c8b2 ./gates/tcgemm/gateup-128-r1.log +dd207ea782d2289ed0076d568fa230ede49234ef26b7ef9689071e72c0d69813 ./gates/tcgemm/gateup-128-r2.log +9a8ca0366fea0a2622937c2dd3ff76c202b7e4dba965f0f376ee18aa76af31c9 ./gates/tcgemm/gateup-128-r3.log +107d4a8bf743b3559b078878c414aa12e0c442c55cc6d6e92f6060766acbe820 ./gates/tcgemm/gateup-128-r4.log +165396695357b405ff44eb5b68a0fc1d6a1f63a11717aaf0662387ccbbfd744f ./gates/tcgemm/gateup-128-r5.log +1ffc8c70723cd1e773a81b61371ae20d43f7fabf978c04a0143db758873ad1d4 ./gates/tcgemm/gateup-3600-r1.log +173f9a38974f6f706b38965ddf5abfd1fe9ae3ee4bf098b33e3a9b0918a82e9f ./gates/tcgemm/gateup-3600-r2.log +57737c7a35b0399d033cafd28b144fef6dfd9173b9a0ec6c25d266aabd31431f ./gates/tcgemm/gateup-3600-r3.log +c2787e68790a6e6c30209c304c3a0ff569234b7cedd3ba228cefbf39711a0ad7 ./gates/tcgemm/gateup-3600-r4.log +5d507127331de1a8e0ed57ed7549506b3413373db7b540c4e46f767b0060d461 ./gates/tcgemm/gateup-3600-r5.log +8a5a5749af0c22a6b68316ac26b4ac7faaee950d1c19ed2d17cf97ef17160143 ./gates/tcgemm/o-3600-r1.log +b63dfa44769a1c97d761bdef6064851cfa339e6f3b2f093dc443925b83688157 ./gates/tcgemm/o-3600-r2.log +e5b7080a7580100f97ede2bac1b9dab11308b3e9acf6a599734e7d5683c6dcbd ./gates/tcgemm/o-3600-r3.log +413f873177a0822bd4a6ab06f01638c91fe23f901b3f8b98445980e635e2bd9a ./gates/tcgemm/o-3600-r4.log +15abe5469913046b9c4e4dbf029860ec758cea76dc2f71ec00815951cd2ec808 ./gates/tcgemm/o-3600-r5.log +0d5fb1ff5e095b4a59a8a3ba5eefd958f8134dbc02e95d009cd3351e33853e91 ./gates/tcgemm.out +07e6c2f20b4492524584065cf733b5c99ad68aac044f0aaac5af96076ed0246d ./gates/tcgemm/qkv-3600-r1.log +b7a6e0815368d2b824f193c4ec0d64dac07352ab282bc954e8b1a4642b5ddc9e ./gates/tcgemm/qkv-3600-r2.log +a4486911d844e05cf1a27c55de52231cc90ec5e361fdf5e8f400d03a6f12b8db ./gates/tcgemm/qkv-3600-r3.log +1f726a30d362eec4ff46b8f01705bb0f87ed0113551c04441e0ff311a1fdedba ./gates/tcgemm/qkv-3600-r4.log +156c8e632f11513c4a5dca9c6e9770b95e50551168416a4a3d9c380fc158fb4a ./gates/tcgemm/qkv-3600-r5.log +aece1c2f66d1f1d31a5158ee2f96e35a6dcd026d31cf4d6df0a1863ee1ce59c8 ./gates/tcgemm/receipt-down-128-r1.json +99997f978e64bbb102ca843b84f783266b7263505b33d52e5d9fc064aa2c3d7e ./gates/tcgemm/receipt-down-128-r2.json +7e63c0cda11ece30c33c9c28d311ee1b6fd220ea66b520d1d552d04b1c096e2a ./gates/tcgemm/receipt-down-128-r3.json +2676967a2fb76ebcef78e14bf1e55ce35d14403dd219616444d4aa6e27440891 ./gates/tcgemm/receipt-down-128-r4.json +b4f11168a2ed5b31071707d202e63a758f9f2f91ebbe2c16c47882e31e9bdfd4 ./gates/tcgemm/receipt-down-128-r5.json +0d521c2a838b17d6a292f39dd85c2db5e0af7cc2db3fe8a60cb758f08c739848 ./gates/tcgemm/receipt-down-3600-r1.json +3d4ba9b14b7c3639e28ddf1df3439ac56f2f9e024c13129768e06413436a1932 ./gates/tcgemm/receipt-down-3600-r2.json +289f5f077c115f228973cd0442c06d4025857ec5e7be2cf89e34a3ce99ab3214 ./gates/tcgemm/receipt-down-3600-r3.json +606302bf1722d82393052bc852bf13f907c01c7d395ba01acd1a93302d0efabb ./gates/tcgemm/receipt-down-3600-r4.json +2561d40863c3feee1f1a1685ade070257128473d056a95d9656ffa6506e96ff8 ./gates/tcgemm/receipt-down-3600-r5.json +405c03f733a5e0036632ff2931ada071f35bc1b1b9c610fbf501b11549c08fc6 ./gates/tcgemm/receipt-gateup-128-r1.json +9cc4070493cb3e37f308c8518d2d605ea7bb5d1882a544e3e69d8d79fa1a9b12 ./gates/tcgemm/receipt-gateup-128-r2.json +9a53ed3d05117b758365ca7155bfda903d18776c418ad5e540c868b27807a0bc ./gates/tcgemm/receipt-gateup-128-r3.json +9bcee5c54c661c6935797c9aeb039810bca8d2d0c2835f8c309bf3358dffb658 ./gates/tcgemm/receipt-gateup-128-r4.json +6f19e407fa55c92252e4d2705b61e903236c18f886bf9e2e868e19e4fd226737 ./gates/tcgemm/receipt-gateup-128-r5.json +294566f1e14d287dc4c19bf83822c345ef6744b6cbcde248ef614c3346ba1e16 ./gates/tcgemm/receipt-gateup-3600-r1.json +aab71fb998186fe37ad68c54af6d7cbb5899a6ec3f6680b68cc1d07666b20b22 ./gates/tcgemm/receipt-gateup-3600-r2.json +9987c80beae0ff2157dead8c4fa0f7cf673fc012e7460f7eb95f9b9ab3c87ff9 ./gates/tcgemm/receipt-gateup-3600-r3.json +39e5a745e8e9ad646dc63917acf08e4440a75916d60b731dd004f9a6e52af036 ./gates/tcgemm/receipt-gateup-3600-r4.json +e2a9a3f476dc9f4c95d5894036d0da133ad46cffa4c1d9af88a90395a3c4f509 ./gates/tcgemm/receipt-gateup-3600-r5.json +19505b3ed6b0c18caf52564fa7afd94a985fa9343f287f521ba1e3ae20b40f0f ./gates/tcgemm/receipt-o-3600-r1.json +3c8f0eb7c253b9a8b44f71343933d9a2fea8c92fc45634e43d2291d0c705c4fa ./gates/tcgemm/receipt-o-3600-r2.json +5df8f31506d384357d3ad369f0d1dd5eb5c0906aa077f6dc5adec42e8ce92fe0 ./gates/tcgemm/receipt-o-3600-r3.json +6079c5825a1a2e4981e8badaf5e7b7be0f82b7a2d0ff99abdba0a556f90f9d82 ./gates/tcgemm/receipt-o-3600-r4.json +3cc3f493990c6586ce6ce41d0a411ac8bcbc7b95ef2e014d89f879f757353855 ./gates/tcgemm/receipt-o-3600-r5.json +7d7ec1d1281946202a8797648e750caf5e6028999228d2adcbc81176869f3ee3 ./gates/tcgemm/receipt-qkv-3600-r1.json +d912d50c511577f858a40c770aedbc4d560cf2170eb9ba2424c1a9652346fca9 ./gates/tcgemm/receipt-qkv-3600-r2.json +b47ff4a2fe6f69388c97dff51a61bcf20499da5b7f6b1e69e31573c38aa68ca9 ./gates/tcgemm/receipt-qkv-3600-r3.json +eb992b3dc266fd7bc31e31ca994abfa2e91a675644624b67160c1eae303f45bc ./gates/tcgemm/receipt-qkv-3600-r4.json +9f49be86af186b6a875b84e317232f716fedb273a481c10a6171b12004e683ff ./gates/tcgemm/receipt-qkv-3600-r5.json +43057aecf557e291da955c6ecda59ad04a9183e58bfb3d90a6fbc45384133abe ./NOTES.md +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 ./omega457/build.log +90e41f8727ef24dc34ef4617cb3706bcd3a3d6d0c733ec2786b06ba6465330b2 ./omega457/fix-build.log +6acbc0333befe00e57efc5a901a43bd3bc5a1c9dd0a45f84603df6789467bd53 ./omega457/fixgates/cmdlist/build.log +2e40f20283bfc71f691e0f8905253104fed2dcd98165f0d732d8a23c283f53fb ./omega457/fixgates/cmdlist/device.txt +19a5e1c7793eb4bd2cd68172703e3a6996966dbc8ba3d6b015f38b6455aa75d8 ./omega457/fixgates/cmdlist/host-only.log +a1c6a78d7b31faae095a0a2ad84d53e2aac9f6d34621b1c1c947988efcc22087 ./omega457/fixgates/cmdlist/main.log +fdd95ee0c9716b14e1eec171769c594a96a1deffde38fe710419eaccaaca9bfe ./omega457/fixgates/cmdlist.out +796bc4db16f3e2606776eb5e5985643ad5a32ca5cd87f2b740370be88a1bf8d6 ./omega457/fixgates/cmdlist/receipt-main.json +c8e9ac96269fec7a92d118b01295ee09a9c5f330ab760277fbe9a47dcbf981e1 ./omega457/fixgates/cmdlist/receipt-spin0.json +90fb388d6494bb76d147f0ff1cccda96c5e01bc64fc0cb650a694e71f26769c5 ./omega457/fixgates/cmdlist/sim.log +cb916858ce6967d47a19c6b9b7ae7eb4cfbd359416b10eb0aff67ad079dde0d0 ./omega457/fixgates/cmdlist/spin0.log +2985f370300ac01949c1b3d9c15ef32339728c28b7cce08de16a52556dfc3853 ./omega457/fixgates/decode_graph_cached/binaries.sha256 +7e4f4ac3efc235011f399b32ea4aae78bb40b65dd155c7ae5f94aad771cae31d ./omega457/fixgates/decode_graph_cached/build.log +7e72e7ad042df585f05a96d32be8b7289626e838b983414db8ec7bdbac7dbed9 ./omega457/fixgates/decode_graph_cached/cached.log +226f4d26cc928f5d9ab8cfdb50c216f1b115ffb34d9de4b7540be4124545d450 ./omega457/fixgates/decode_graph_cached/device.txt +48404021ba78c42c25154059e1c0ade4707433c5051df230c720f51db4f98fcc ./omega457/fixgates/decode_graph_cached/host-only.log +7a69d90856c35a1759ea781feb62eb6fbdf76db6d8ab63ef06caa7deb9235284 ./omega457/fixgates/decode_graph_cached.out +2196d202e1cb82b203e929bee535db79757a3b91fa71890c13607425a03d3de3 ./omega457/fixgates/decode_graph_cached/receipt-cached.json +e7fc66ed904eaa7cb69d81bc5a753a461829c6260f2d8b6e6dab9d12593abad5 ./omega457/fixgates/decode_graph_cached/worktree.diff +12641abdc6478ebeb7b3b4d3be9f351d2749f1d9d352bd7764827cb2f5bfcbaf ./omega457/fixgates/fp8/baseline-matmul.log +3bebff182d270e3c7408da472646424164128b7a01722d58a71bb424a99ce194 ./omega457/fixgates/fp8/build.log +72d5065a1f3c1034038b849d40ae9a37b87f1790ce5c19314c07ba21afcef46e ./omega457/fixgates/fp8/depth0.log +82bd94a62cd4c240ee6911b0e6ab020f12dd3ce386a532e1012fecc927d94726 ./omega457/fixgates/fp8/device.txt +de0e3f30509f0491e9a2ad8e22005f758a8e4e2723906cd0986f0c3a61b53945 ./omega457/fixgates/fp8/grouped-old.log +caeab5a3cdebfa0910e2a449141b573071298a47743f9a862efba72b89d8a61e ./omega457/fixgates/fp8/host-only.log +f1c664cb187c634d474a1a648c73cec7c6db50ddd9d364a40e5bc45ddc3cbec9 ./omega457/fixgates/fp8/main.log +fb56057322fa8530da8477186ea04b8a1fb8cc196f1922426d1977bf2161ab21 ./omega457/fixgates/fp8/noevict.log +fac3604141cd9ffdcb95bd4d511118894dc654621719b6dc52dad210b72d2257 ./omega457/fixgates/fp8.out +ec5cc7fdb271705be442d85d50e9a5b2d6fa7c92ce00fff5eddd1db7fe8264cb ./omega457/fixgates/fp8/receipt-baseline-matmul.json +430a91af97fa5514ed73ebd8ab5cca1e6567cb43e25db7fa8a65fd3c6ef0c1bc ./omega457/fixgates/fp8/receipt-depth0.json +a6b4e1f8510c4fca58d9e34ba22b111796a1121cdaf9d120d6fd533c2a828f12 ./omega457/fixgates/fp8/receipt-grouped-old.json +477dfe611bde58293f74de56a50789583e554d5b1486b71dc101124c926bc86f ./omega457/fixgates/fp8/receipt-main.json +84b97340a9c3b358f175163fe96e8a1e4ae199e39c7a76bd46d76ce280f69e67 ./omega457/fixgates/fp8/receipt-noevict.json +a8618d6c326a481c2801fcfa1dfc1ded3a49dd94128a4d732137079d4ae2d687 ./omega457/fixgates/fp8/sim.log +a93cf9aa63eef90ae55ce90ceb2723a6c6b245f25edd0f4f1799b54b9469c19f ./omega457/fix-lib.sha256 +e7fc66ed904eaa7cb69d81bc5a753a461829c6260f2d8b6e6dab9d12593abad5 ./omega457/fix-variant.diff +83b85db14440e60ad84555bd82aa6c4b420b813da4cdfc09c4440fe8f5198169 ./omega457/gate-fix/build.log +a6863b8625f32304fc05a97cb55402c280fa6b6186a52fe0d12cab9f0e845f00 ./omega457/gate-fix/device.txt +f7df6a8f3de745308b8e9638daf9a5eaaaa6b976fc4735aa1200c3a449ceccbb ./omega457/gate-fix.out +852e68fd8c84a35e26074fe97c15f93826cf68bc0df15f8fa453059dc4eb1287 ./omega457-gate-fix-r2/build.log +48c58ba0eb8e3fedbaea9cb1a943a6c35e116b744a6bce7eea41e80ebc32b2d0 ./omega457-gate-fix-r2/device.txt +f7df6a8f3de745308b8e9638daf9a5eaaaa6b976fc4735aa1200c3a449ceccbb ./omega457-gate-fix-r2/gate.out +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457-gate-fix-r2/realloc-c0-r1.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457-gate-fix-r2/realloc-c0-r2.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457-gate-fix-r2/realloc-c0-r3.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457-gate-fix-r2/realloc-c0-r4.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457-gate-fix-r2/realloc-c0-r5.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457-gate-fix-r2/realloc-c1-r1.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457-gate-fix-r2/realloc-c1-r2.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457-gate-fix-r2/realloc-c1-r3.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457-gate-fix-r2/realloc-c1-r4.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457-gate-fix-r2/realloc-c1-r5.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457-gate-fix-r2/rewrite-c0-r1.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457-gate-fix-r2/rewrite-c0-r2.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457-gate-fix-r2/rewrite-c0-r3.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457-gate-fix-r2/rewrite-c0-r4.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457-gate-fix-r2/rewrite-c0-r5.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457-gate-fix-r2/rewrite-c1-r1.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457-gate-fix-r2/rewrite-c1-r2.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457-gate-fix-r2/rewrite-c1-r3.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457-gate-fix-r2/rewrite-c1-r4.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457-gate-fix-r2/rewrite-c1-r5.log +501f702d5de67982912675275b30d652e54fc3b769eb7605a82ac820707dabc2 ./omega457-gate-fix-r2/summary.txt +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-fix/realloc-c0-r1.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-fix/realloc-c0-r2.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-fix/realloc-c0-r3.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-fix/realloc-c0-r4.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-fix/realloc-c0-r5.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-fix/realloc-c1-r1.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-fix/realloc-c1-r2.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-fix/realloc-c1-r3.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-fix/realloc-c1-r4.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-fix/realloc-c1-r5.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-fix/rewrite-c0-r1.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-fix/rewrite-c0-r2.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-fix/rewrite-c0-r3.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-fix/rewrite-c0-r4.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-fix/rewrite-c0-r5.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457/gate-fix/rewrite-c1-r1.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457/gate-fix/rewrite-c1-r2.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457/gate-fix/rewrite-c1-r3.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457/gate-fix/rewrite-c1-r4.log +dffbc4ce16748ecea740ac274529dfee15c305072665cda78d6b9e069511c38b ./omega457/gate-fix/rewrite-c1-r5.log +501f702d5de67982912675275b30d652e54fc3b769eb7605a82ac820707dabc2 ./omega457/gate-fix/summary.txt +0e3e4f03ecd6a9373ba320704324922eefe449429fdb05f59e6db330b76c52d3 ./omega457/gate-red/build.log +3b89ed0e0581a9a87227134bb4094df5356b3d1941c329512c3b13190cc4ac15 ./omega457/gate-red/device.txt +d3b36f81602218a9ed045b64f0d6780a0ed1ed85efdc5989e9c82fd056e6c786 ./omega457/gate-red.out +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-red/realloc-c0-r1.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-red/realloc-c0-r2.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-red/realloc-c0-r3.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-red/realloc-c0-r4.log +2845d38a8c1afb6e5374949340188c9c16c1bb2174ead5bd7df5852dcff88105 ./omega457/gate-red/realloc-c0-r5.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-red/realloc-c1-r1.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-red/realloc-c1-r2.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-red/realloc-c1-r3.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-red/realloc-c1-r4.log +3063b9c84fd2460a2cac7c717a13a9aae9bd67ee3487add7f2ade15be2faef70 ./omega457/gate-red/realloc-c1-r5.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-red/rewrite-c0-r1.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-red/rewrite-c0-r2.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-red/rewrite-c0-r3.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-red/rewrite-c0-r4.log +ea214d38c9e19d3a330cf7dd60a8b08ac172f479d7eb3bb5dcc5b0ef65132ec4 ./omega457/gate-red/rewrite-c0-r5.log +0909f3a52017a587205d2fa29a585127d218d02a4be4e94d1a8755fc472a08d4 ./omega457/gate-red/rewrite-c1-r1.log +0909f3a52017a587205d2fa29a585127d218d02a4be4e94d1a8755fc472a08d4 ./omega457/gate-red/rewrite-c1-r2.log +0909f3a52017a587205d2fa29a585127d218d02a4be4e94d1a8755fc472a08d4 ./omega457/gate-red/rewrite-c1-r3.log +0909f3a52017a587205d2fa29a585127d218d02a4be4e94d1a8755fc472a08d4 ./omega457/gate-red/rewrite-c1-r4.log +0909f3a52017a587205d2fa29a585127d218d02a4be4e94d1a8755fc472a08d4 ./omega457/gate-red/rewrite-c1-r5.log +4b73fc935a2ca80ba2876b9fe33a18ff3cf25cf0826bcc7becf1877b9cc5ff97 ./omega457/gate-red/summary.txt +b54292e0f28a7ade0acef8e02bf1e47e252eba054c6fc8a33b51d377c1bb67b8 ./omega457/ground.txt +fcb06e0f9949f670f20d204d5a8e469c0d98f2ca9f70c4070452bb1c94847280 ./omega457/lib.sha256 +23f548967452a8f1c927137c563e9bc34076193210db69fe035859ab5279ce1d ./omega457/PINS +3e928acc3253508c7e763553ed11cd2f7c0b4f6fb3a5c8ad319a8c1cdedbce10 ./omega457/plan.md +fb71bc98c9ae8142fa745996e2bb192718c7533c60b1d881e0b6ba0ae4ecb892 ./omega457/runs/fix-realloc-c0-r1.log +173255ed65b574642611eecbcebd2366c66590c4aefa8639d31e20b6d823a931 ./omega457/runs/fix-realloc-c0-r2.log +d878400de3844bb97241ab8fd7bf2145de6afc6ca6dd812b3f2dea6eb49c30e8 ./omega457/runs/fix-realloc-c0-r3.log +d878400de3844bb97241ab8fd7bf2145de6afc6ca6dd812b3f2dea6eb49c30e8 ./omega457/runs/fix-realloc-c0-r4.log +0c480e3e7f877b5e45c0096790538e57da9565a2f9d2c23ebd76739aef36889c ./omega457/runs/fix-realloc-c0-r5.log +f9fa19c341ab58f5eba102e0966b570995a2217271d8e5a365b9c63aaff8f5d8 ./omega457/runs/fix-realloc-c1-r1.log +c3f7c953410ce00c8b8a60c3499a07eaf35a1dc669e5601f182bca94788e2e14 ./omega457/runs/fix-realloc-c1-r2.log +f1121f2fba35f721d72b62f39d9d2967ba38de596623b4c9dfa1b59a0b40223b ./omega457/runs/fix-realloc-c1-r3.log +5ef863d2283c57dfae0962d05b628238189d24b7a70c5dee76464d52d0d34842 ./omega457/runs/fix-realloc-c1-r4.log +5ef863d2283c57dfae0962d05b628238189d24b7a70c5dee76464d52d0d34842 ./omega457/runs/fix-realloc-c1-r5.log +1852289611bae7d99484f87cbaf8b723766b16fc3bf002e477b5642d417906e3 ./omega457/runs/fix-rewrite-c0-r1.log +1852289611bae7d99484f87cbaf8b723766b16fc3bf002e477b5642d417906e3 ./omega457/runs/fix-rewrite-c0-r2.log +68ae0330030534e5f211d9ef60d70a308196c73effc9dd4e941f6fcc7cb7a761 ./omega457/runs/fix-rewrite-c0-r3.log +d0db44b69dd5eecbdb8befcd9c5ae66a80a96f424882edce86d7ff90305352cb ./omega457/runs/fix-rewrite-c0-r4.log +9006102734277252848c7a0ad9e4c9ea52d24decfe8ffb1dac3230c585be22db ./omega457/runs/fix-rewrite-c0-r5.log +8d5b1fa41cddffd54a969878e2853ed5fdffaf09566828228d5cdb69335c990e ./omega457/runs/fix-rewrite-c1-r1.log +320a784cead7abdaf06fb7d25cb5548b6b6945b23f76345a02491bea437a7d98 ./omega457/runs/fix-rewrite-c1-r2.log +320a784cead7abdaf06fb7d25cb5548b6b6945b23f76345a02491bea437a7d98 ./omega457/runs/fix-rewrite-c1-r3.log +9274ab53d6bac1b6dd682ed919d9798f6d861305721e5ce1150994495708da5a ./omega457/runs/fix-rewrite-c1-r4.log +d0ee0bd2cf7bf3c54f286653ddb7579070935e72da8a36913bb15378df7b9d26 ./omega457/runs/fix-rewrite-c1-r5.log +e51c4f67b3e6168d42f9ad0d4994c3ec532c81584a3db9047234fc4f19a130a4 ./omega457/runs/realloc-c0-r1.log +895fa72062d28e48a16ce64ad43651437eb88f8a71a0f81fcd6e244cb2a24b69 ./omega457/runs/realloc-c0-r2.log +607bd5b7fda530f7543fbd902489bbc26ea8fce91348379c4da8c202a9b28004 ./omega457/runs/realloc-c0-r3.log +61eafec468d57f4e70991448c4e1e711978366a6195b578528085fc085d82c0e ./omega457/runs/realloc-c0-r4.log +07792740e322c7f26015ea4b75eee16b3d11acdf19c197a125e832786e2741f4 ./omega457/runs/realloc-c0-r5.log +c694a0550e001f81d0d168c4506f3e5447abccf276431cb94914e05e11d13c4d ./omega457/runs/realloc-c1-r1.log +c694a0550e001f81d0d168c4506f3e5447abccf276431cb94914e05e11d13c4d ./omega457/runs/realloc-c1-r2.log +81619407363bb8fe2605f2225f13b84a0c7d6ae2e5b6432f5a920a825f45be42 ./omega457/runs/realloc-c1-r3.log +9dfcb02f196dd6564b0cc256ad0f9c6f780bbe35aeaeeab978b70bae46e6cc91 ./omega457/runs/realloc-c1-r4.log +43558368b89d7b7eeeab0968e134ef14969084d1aacca04d8018f1c041519b12 ./omega457/runs/realloc-c1-r5.log +2d7c3d2670f38d233602d2c353281e87ae604562ea8fbf2a5ac116d5312de008 ./omega457/runs/rewrite-c0-r1.log +169059ea5da360c491c49c0a6ba629daa395827767395602dff44e6c65f0aee5 ./omega457/runs/rewrite-c0-r2.log +169059ea5da360c491c49c0a6ba629daa395827767395602dff44e6c65f0aee5 ./omega457/runs/rewrite-c0-r3.log +b11ef5db49315a63af1d898f1e34eb85fd719d378463099fb96a355378d43834 ./omega457/runs/rewrite-c0-r4.log +197fb711f8859ac6b2c13396bef3c5477328af7d608c656e5d73ec587a347764 ./omega457/runs/rewrite-c0-r5.log +d74bc6ffdc739c2e6aa9783d5c41cc251a32fae681f58be4e70eab4f41e317e0 ./omega457/runs/rewrite-c1-r1.log +164fab6bdb11958b08403ab540b1268a05a0f60a444f4aa1b60ae941400be0b1 ./omega457/runs/rewrite-c1-r2.log +ac70a4057cb2045eb042a002d4d4cc48017cd07ee34a5230f2e9241add0d1536 ./omega457/runs/rewrite-c1-r3.log +f97094da2816aae3867c0f3edf002eae89dea5a6e24a5f9e316298e3316b0881 ./omega457/runs/rewrite-c1-r4.log +f97094da2816aae3867c0f3edf002eae89dea5a6e24a5f9e316298e3316b0881 ./omega457/runs/rewrite-c1-r5.log +f2f7043e6544f14a67959b6649f328f52f596c538ab543d8409ef257aeafbb5c ./omega457/runs/run-all.sh +6b95229967b8fb4a8fde4c654a662ead3d82e8c6cf5d8f89560c9f2d520f8485 ./omega457/runs/run-fix.sh +b9d1012d0b146caac8430541e6f74dd8914c11fd56c46c28b2209acd34cefbe9 ./omega457/runs/summary-fix.txt +6a2a8fab9e8a45b6fd301ddecdc69060b3b38e0ccb571aacbe184a80149fab3d ./omega457/runs/summary.txt +fb2d8fc1fabf57d23f7140d241f8f062331c3d2f1342c196b11e638a30eddb90 ./omega457/src/l2_stale_test.c +0309767b3765158087cb117ce14002955481ab84fda6b8c68e9cfe042edd5f4f ./omega457/state-after.txt +ad5622e0f86aeee8ac00f0101edb98201539fdaffd03c97e47d49f50faeaccfa ./omega-gates.sh +0e3ff5ddf3dc25e4aee44fdfd3f25f17691e791251c2eaa2b9bd26567aac72f2 ./rc-d0889a94/prefill_attn/baseline-decode.log +404e788aaefae7f3317cd637108d0579b6206976f4c4379b8bb708cbd41e09cf ./rc-d0889a94/prefill_attn/build.log +72343fa4009a0f76fdb07c3313789a851694b1ea6c2facd9073ea9963fc31d4f ./rc-d0889a94/prefill_attn/clocks.csv +02a75f42591096459f8e3783886d7cf03ccf45d35ef9a0fad43eb0825ba621b5 ./rc-d0889a94/prefill_attn/device.txt +ce142f06e62b3f9c6d0db635a95537911cea4cb4ec6511e6785e24200ae0405c ./rc-d0889a94/prefill_attn/host-only.log +c1a82f2bc593e3538cb215014f7fff1b8bd2dfe5ef1ec3156af2d9855b749be7 ./rc-d0889a94/prefill_attn/main-fused.log +09c48c8d9dc913b281850ffbaed0fb58eb167f7a54f8b2298152f2e16588ea45 ./rc-d0889a94/prefill_attn/main.log +bc1dd6ce7db8c5fb65780beeae11b90fe95f1af1ac6d6dd7a098928bbb02534c ./rc-d0889a94/prefill_attn.out +d79ea50c813482db28da13eaaeabac57e4ca00e09b4d5e5d64e805689455d7cd ./rc-d0889a94/prefill_attn/receipt-baseline-decode.json +ab569c7105b701dfaa41fa76dde363d17b37a84a09a7de4d93e8275bd2bd6439 ./rc-d0889a94/prefill_attn/receipt-main-fused.json +a67d1ad5fc75048f11b6b1168d8e54eb358bd487e687898846c399d8653b5e98 ./rc-d0889a94/prefill_attn/receipt-main.json +676b55e72b2a946af8718440fac707d5e984b76c5b266829488b518a2d7b742c ./rc-d0889a94/prefill_attn/receipt-warps4.json +a560e622fbe2abfd582d2e47d3c9faac3f1e747d69af861c369529c51d2ee2e3 ./rc-d0889a94/prefill_attn/sim.log +8fa81f72f303dc3dc341409f7de955dfa220e04153e07829661b7ccf5483224f ./rc-d0889a94/prefill_attn/spread-fused-cold.log +8fbfc6993cc94b71dec0b26aa1b33ff7d3a1debe7f33b7ed67e649a6eb9bb4e7 ./rc-d0889a94/prefill_attn/spread-fused-warm5.log +9361dfac1326f20ca56c4cf6ac932b82e61e933954fb72dbec5e13f54eaf4764 ./rc-d0889a94/prefill_attn/spread-marks.txt +63e30b13ae5c440aa721220825479569ea56a6ec1402840521c03320a87ddbe5 ./rc-d0889a94/prefill_attn/spread-split-cold.log +aca0a0cd6740f8a7dd13dbb74461a747b083a5a486513175489116056b56c756 ./rc-d0889a94/prefill_attn/spread-split-warm5.log +4004563ddc22f43ff36d9fe280bb3f6244fd679b3b22f2bc206de4502076f214 ./rc-d0889a94/prefill_attn/warps4.log +e72eda37268cbbff654cd7d059e1c194ba2aaf18ec8b359b7bfaca0d9da1e45a ./stage2.sh diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention.out b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention.out new file mode 100644 index 000000000..6d15d7fc6 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention.out @@ -0,0 +1,4 @@ +PASS: 219 checks, 0 failed +PASS: 73 checks, 0 failed +PASS: 2 checks, 0 failed +FB1-CUT5 chip gate rc=0 (sweep rc=0 timing rc=0) receipt=/home/drakestapleton/workspace/requal-0c63/omega-gates/attention/FB1-CUT5-710d438c/receipt.json sweep=/home/drakestapleton/workspace/requal-0c63/omega-gates/attention/FB1-CUT5-710d438c/sweep.json diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/SHA256SUMS b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/SHA256SUMS new file mode 100644 index 000000000..9a3a2a73f --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/SHA256SUMS @@ -0,0 +1,12 @@ +e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 build.log +94c5d85397039f428b14de6c75e26ace6f1062e052e6d45997486f7c56d32511 device.txt +ad6ab1b22937beddaa843d17a4c00e902df529aa02d92ee2ee61102951f43006 gpu_attention_test.c +db8e44ff47d2012049763b1adebf8c4724f07988bfb6f858fe5173e40fa4a066 omega_gpu_attention_api.c +f9be0e256e10e0664bc0602e862b544041a658248bd7200b463753fde81b396a omega_gpu_attention_api.h +cc2646a74fa47fdec5f074db702578cd1c3d264d750bdaf947c73f107576962d receipt.json +953fd231ea51b077d8bdf3397d69948ef12d7f96cc8fa3540f14f1b47df00777 run.log +95994f90d83afea6f11f17ec466de90737986a0dbe4b8072518a0236bbdbfed9 sim.log +1e57804d07602e1df77530bfef250b6b406e2232f077787637568c31c1a4ebd3 sweep.json +43a010b3eeeacf534a7e2584850f64186bcdd15688428ff9d13c1f4ea09a613f sweep.log +e18724da84216ce306f59e9f44b15f46905ae8286c69f8e0436e6fdb586fc3a8 timing.json +4b66f552135d6fbfdc1f0ab3f8eb55c1967165d343974853ea525656a8200be2 timing.log diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/build.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/build.log new file mode 100644 index 000000000..e69de29bb diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/device.txt b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/device.txt new file mode 100644 index 000000000..ac9e3989a --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/device.txt @@ -0,0 +1,5 @@ +Linux spark-b87b 7.0.0-1019-nvidia #19~24.04.2-Ubuntu SMP PREEMPT_DYNAMIC Sun Sep 6 18:35:11 UTC 2 aarch64 aarch64 aarch64 GNU/Linux +NVIDIA GB10, 580.173.02 +omega 710d438cac6c1159b4ca2b39af49812ce08f554b (0 uncommitted paths) +physics 6d7cf0d4d8eb2cda7b512100ff6058e25dbb3ddf +2026-10-15T01:04:23Z diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/gpu_attention_test.c b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/gpu_attention_test.c new file mode 100644 index 000000000..45790315a --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/gpu_attention_test.c @@ -0,0 +1,1182 @@ +/* gpu_attention_test: FB-1 cut 5 gate for omega_gpu_attention_api. + * + * ./gpu_attention_test --host-only refusals, codegen (both kernel families and every + * mutant), register budget, nvdisasm listing check + * ./gpu_attention_test --split-timing [--hd 128] [--spin-us N] [--out r.json] paged bf16 32q/8kv at ATTN_SPLIT_CTX + * (default 1268): 100 calls per forced split 1,2,4,8 + auto, parity + * ./gpu_attention_test --timing [--out r.json] cut 4b gate: 1 query x 32 heads x 2048 ctx, 100 calls + * through the persistent session, median under 3 ms + * ./gpu_attention_test --sweep [--out s.json] head-scaling sweep: paged bf16 at head_dim 64 over q heads + * 1..64 x every kv-head divisor x ctx 256/2048, parity + timings + * (receipt OMEGA_GPU_ATTENTION_SWEEP_V1; --sim marks host timings) + * ./gpu_attention_test --out receipt.json chip gate: every shape against the host oracle, the + * mutants (deliberately wrong kernels, all of + * 1 .. OMEGA_GPU_ATTN_MUTANT_COUNT-1) which the same + * check must catch, a negative control, timings + * + * Oracles re-state aien-sovereign-core crates/aien-inference-abi/src/backend.rs (main 8b5caed) in C: + * ReferenceCpuBackend::gqa_attention (f64 scores, max, exp, sum, 1/max(sum,1e-12), f64 weighted sum), + * TensorBackend::paged_attention (f64 online softmax token by token over the paged bf16 pool, tokens + * past the block table dropped, zeros for empty context) and paged_attention_batch (ctx <= 0 -> 0, + * table rows past the array -> empty, negative entries removed). Compiled with -ffp-contract=off. + * + * Tolerance (why): the chip accumulates the 64-term dot products, the per-chunk sums and the + * rescaled running sums in f32 (worst case about n * 2^-24 relative over n = 2048 terms, 1.2e-4), + * uses MUFU.EX2 (PTX ex2.approx: 2^-22.5 relative) for every weight and for the 32 chunk rescale + * factors, and MUFU.RCP for the final normalisation. Every output is a convex combination of V + * values of unit scale, so |error| <= 2e-4 * |want| + 2e-5 covers these with margin; the mutants + * move results by 1e-2 or more (wrong head, wrong token) or produce NaN (overflow without the max). + * The large-score case (scores up to ~300) carries the f32 rounding of the score itself into the + * exponent (3e-5 absolute per score), so it uses 1e-3 relative + 1e-4 absolute. + */ +#include "omega_gpu_attention_api.h" +#include "omega_gpu_session.h" +#include "omega_blackwell_codegen.h" +#include "bw_warp_sim.h" /* omega #308: SIMT warp simulator for --divergent */ +#include +#include +#include +#include +#include +#include +#include + +static int g_checks, g_failed; +static int g_sim_mode; /* --sim: the host simulator never opens the device */ +static int g_divergent; /* --divergent (omega #308 R2): the j >= ctx branch inside a BSSY/BSYNC region */ +static uint32_t g_hd = 64; /* --hd 128: the whole battery at head_dim 128 (Qwen3-4B shapes); both simulators size the CTA from it */ +#define CHECK(cond, ...) do { g_checks++; if (!(cond)) { g_failed++; printf("FAIL: "); printf(__VA_ARGS__); printf("\n"); } } while (0) + +static uint32_t lcg(uint32_t *s) { *s = *s * 1664525u + 1013904223u; return *s; } +static float frand(uint32_t *s, float lo, float hi) { return lo + (hi - lo) * ((float)(lcg(s) >> 8) / 16777216.0f); } +static uint16_t f2bf(float f) { uint32_t u; memcpy(&u, &f, 4); uint32_t r = ((u >> 16) & 1u) + 0x7fffu; return (uint16_t)((u + r) >> 16); } +static float bf2f(uint16_t b) { uint32_t u = (uint32_t)b << 16; float f; memcpy(&f, &u, 4); return f; } + +/* ----------------------------------------------------------------- oracles */ +static void oracle_gqa(const float *q, const float *kc, const float *vc, size_t seq_len, size_t nqh, size_t nkv, size_t hd, float *out) { + if (seq_len == 0) { memset(out, 0, nqh * hd * 4); return; } + size_t ratio = nqh / nkv; double inv_sqrt_d = 1.0 / sqrt((double)hd); + double *scores = malloc(seq_len * sizeof *scores); + for (size_t h = 0; h < nqh; h++) { + size_t kvh = h / ratio; const float *qh = q + h * hd; + for (size_t t = 0; t < seq_len; t++) { + const float *kt = kc + (t * nkv + kvh) * hd; double dot = 0.0; + for (size_t d = 0; d < hd; d++) dot += (double)qh[d] * (double)kt[d]; + scores[t] = dot * inv_sqrt_d; + } + double mx = -INFINITY; for (size_t t = 0; t < seq_len; t++) if (scores[t] > mx) mx = scores[t]; + double sum = 0.0; for (size_t t = 0; t < seq_len; t++) { scores[t] = exp(scores[t] - mx); sum += scores[t]; } + double inv = 1.0 / (sum > 1e-12 ? sum : 1e-12); + for (size_t t = 0; t < seq_len; t++) scores[t] *= inv; + for (size_t d = 0; d < hd; d++) { + double s = 0.0; + for (size_t t = 0; t < seq_len; t++) s += scores[t] * (double)vc[(t * nkv + kvh) * hd + d]; + out[h * hd + d] = (float)s; + } + } + free(scores); +} +/* bf16 pool in the canonical layout; the oracle's read_kv_head: element_offset(block, layer, is_value, token) + kv_head*head_dim*2 */ +static const uint16_t *kv_head(const uint8_t *pool, const OmegaGpuKvLayout *ly, size_t blk, size_t layer, int is_v, size_t tok, size_t kvh, size_t hd) { + size_t off = blk * ly->block_stride_bytes + layer * ly->layer_stride_bytes + (is_v ? ly->kv_plane_stride_bytes : 0) + tok * ly->token_stride_bytes + kvh * hd * 2; + return (const uint16_t *)(pool + off); +} +static void oracle_paged(const float *q, const uint8_t *pool, const OmegaGpuKvLayout *ly, const uint32_t *ids, size_t nids, size_t ctx, size_t layer, + size_t nqh, size_t nkv, size_t hd, float *out) { + if (ctx == 0 || nids == 0) { memset(out, 0, nqh * hd * 4); return; } + size_t ratio = nqh / nkv; double inv_sqrt_d = 1.0 / sqrt((double)hd); size_t bs = ly->block_size; + double *acc = malloc(hd * sizeof *acc); + for (size_t h = 0; h < nqh; h++) { + size_t kvh = h / ratio; const float *qh = q + h * hd; + double m = -INFINITY, l = 0.0; for (size_t d = 0; d < hd; d++) acc[d] = 0.0; + for (size_t t = 0; t < ctx; t++) { + size_t bi = t / bs; if (bi >= nids) break; + const uint16_t *kh = kv_head(pool, ly, ids[bi], layer, 0, t % bs, kvh, hd); + const uint16_t *vh = kv_head(pool, ly, ids[bi], layer, 1, t % bs, kvh, hd); + double dot = 0.0; for (size_t d = 0; d < hd; d++) dot += (double)qh[d] * (double)bf2f(kh[d]); + double score = dot * inv_sqrt_d, mn = m > score ? m : score, alpha = exp(m - mn), beta = exp(score - mn); + l = l * alpha + beta; + for (size_t d = 0; d < hd; d++) acc[d] = acc[d] * alpha + beta * (double)bf2f(vh[d]); + m = mn; + } + double inv = l > 0.0 ? 1.0 / l : 0.0; + for (size_t d = 0; d < hd; d++) out[h * hd + d] = (float)(acc[d] * inv); + } + free(acc); +} +static void oracle_batch(const float *q, const uint8_t *pool, const OmegaGpuKvLayout *ly, const int32_t *tables, const int32_t *ctxs, size_t maxb, size_t nseq, + size_t layer, size_t nqh, size_t nkv, size_t hd, float *out) { + size_t stride = nqh * hd; + uint32_t *ids = malloc((maxb ? maxb : 1) * sizeof *ids); + for (size_t s = 0; s < nseq; s++) { + size_t ctx = ctxs[s] > 0 ? (size_t)ctxs[s] : 0, n = 0; + size_t total = nseq * maxb; /* the table array length as the trait sees it */ + if ((s + 1) * maxb <= total) for (size_t b = 0; b < maxb; b++) if (tables[s * maxb + b] >= 0) ids[n++] = (uint32_t)tables[s * maxb + b]; + oracle_paged(q + s * stride, pool, ly, ids, n, ctx, layer, nqh, nkv, hd, out + s * stride); + } + free(ids); +} + +static size_t compare(const float *got, const float *want, size_t n, double rel, double abs_tol, double *worst) { + size_t bad = 0; *worst = 0.0; + for (size_t i = 0; i < n; i++) { + double d = fabs((double)got[i] - (double)want[i]); + double lim = rel * fabs((double)want[i]) + abs_tol; + double scaled = lim > 0 ? d / lim : (d > 0 ? INFINITY : 0.0); + if (scaled > *worst) *worst = scaled; + if (!(d <= lim)) bad++; /* NaN counts as bad */ + } + return bad; +} + +/* ------------------------------------------------------------- host only */ +static int nvdisasm_check(bool f32, const char *name, const char *const *must, int n_must) { + const char *nv = "/usr/local/cuda/bin/nvdisasm"; + if (access(nv, X_OK) != 0) { printf("nvdisasm: not present, listing check skipped for %s\n", name); return 0; } + OmegaBlackwellKernel k; memset(&k, 0, sizeof k); + if (omega_gpu_attention_codegen_hd(f32, f32 ? 12 : 4, 3, g_hd, &k) != OMEGA_GPU_ATTN_OK) return -1; + char bin[64], lst[64], cmd[256]; + snprintf(bin, sizeof bin, "/tmp/omega_attn_%s_%d.bin", name, (int)getpid()); + snprintf(lst, sizeof lst, "/tmp/omega_attn_%s_%d.sass", name, (int)getpid()); + FILE *f = fopen(bin, "wb"); if (!f) { free(k.code); return -1; } + fwrite(k.code, 1, k.code_size, f); fclose(f); + snprintf(cmd, sizeof cmd, "%s -b SM121 %s > %s 2>&1", nv, bin, lst); + int rc = system(cmd); + free(k.code); + FILE *l = fopen(lst, "r"); if (!l) return -1; + char line[512]; int seen[16] = {0}; int bad = 0, insns = 0; + while (fgets(line, sizeof line, l)) { + if (!strstr(line, "/*0")) continue; + insns++; + if (strstr(line, "?") || strstr(line, "error")) bad++; + for (int i = 0; i < n_must; i++) if (strstr(line, must[i])) seen[i] = 1; + } + fclose(l); + int miss = 0; + for (int i = 0; i < n_must; i++) if (!seen[i]) { printf(" %s: nvdisasm listing lacks %s\n", name, must[i]); miss++; } + printf("nvdisasm %s: rc=%d insns=%d undecodable=%d missing=%d (%s)\n", name, rc, insns, bad, miss, lst); + unlink(bin); + return (rc == 0 && bad == 0 && miss == 0) ? 0 : -1; +} + +static OmegaGpuKvLayout layout_for(uint32_t num_blocks, uint32_t bs, uint32_t layers, uint32_t nkv, uint32_t hd) { + OmegaGpuKvLayout ly; + ly.head_stride_bytes = (uint64_t)hd * 2; ly.token_stride_bytes = ly.head_stride_bytes * nkv; + ly.kv_plane_stride_bytes = ly.token_stride_bytes * bs; ly.layer_stride_bytes = 2 * ly.kv_plane_stride_bytes; + ly.block_stride_bytes = ly.layer_stride_bytes * layers; ly.pool_bytes = ly.block_stride_bytes * num_blocks; + ly.num_blocks = num_blocks; ly.num_layers = layers; ly.block_size = bs; + return ly; +} + +static void host_only(void) { + float q[64 * 64], kv[64 * 64], out[64 * 64]; memset(q, 0, sizeof q); memset(kv, 0, sizeof kv); + CHECK(omega_gpu_gqa_attention_f32(NULL, kv, kv, 1, 32, 4, 64, out, NULL) == OMEGA_GPU_ATTN_BAD_ARGS, "NULL q refused"); + CHECK(omega_gpu_gqa_attention_f32(q, kv, kv, 1, 32, 4, 96, out, NULL) == OMEGA_GPU_ATTN_TOO_LARGE, "head_dim 96 refused (TOO_LARGE)"); + CHECK(omega_gpu_gqa_attention_f32(q, kv, kv, 1, 32, 4, 256, out, NULL) == OMEGA_GPU_ATTN_TOO_LARGE, "head_dim 256 refused (TOO_LARGE)"); + CHECK(omega_gpu_gqa_attention_f32(q, kv, kv, 1, 6, 2, 64, out, NULL) == OMEGA_GPU_ATTN_BAD_ARGS, "gqa ratio 3 refused"); + CHECK(omega_gpu_gqa_attention_f32(q, kv, kv, 1, 32, 5, 64, out, NULL) == OMEGA_GPU_ATTN_BAD_ARGS, "32 q heads / 5 kv heads refused"); + CHECK(omega_gpu_gqa_attention_f32(q, kv, kv, OMEGA_GPU_ATTN_MAX_GQA_CTX + 1, 32, 4, 64, out, NULL) == OMEGA_GPU_ATTN_TOO_LARGE, "context past the envelope refused"); + for (int i = 0; i < 64; i++) out[i] = 1.0f; + OmegaGpuAttnInfo info; + CHECK(omega_gpu_gqa_attention_f32(q, kv, kv, 0, 1, 1, 64, out, &info) == OMEGA_GPU_ATTN_OK && out[0] == 0.0f && out[63] == 0.0f && info.chip_calls == 0, "seq_len 0 writes zeros without a launch"); + OmegaGpuKvLayout ly = layout_for(8, 16, 2, 4, 64); + uint8_t *pool = calloc(ly.pool_bytes, 1); + uint32_t ids[2] = { 1, 9 }; + CHECK(omega_gpu_paged_attention_bf16(q, pool, &ly, ids, 2, 20, 0, 32, 4, 64, out, NULL) == OMEGA_GPU_ATTN_BAD_ARGS, "block id past the pool refused"); + CHECK(omega_gpu_paged_attention_bf16(q, pool, &ly, ids, 1, 20, 2, 32, 4, 64, out, NULL) == OMEGA_GPU_ATTN_BAD_ARGS, "layer past the pool refused"); + OmegaGpuKvLayout bad = ly; bad.block_size = 12; + CHECK(omega_gpu_paged_attention_bf16(q, pool, &bad, ids, 1, 10, 0, 32, 4, 64, out, NULL) == OMEGA_GPU_ATTN_BAD_ARGS, "block size 12 (not a power of two) refused"); + bad = ly; bad.head_stride_bytes = 256; + CHECK(omega_gpu_paged_attention_bf16(q, pool, &bad, ids, 1, 10, 0, 32, 4, 64, out, NULL) == OMEGA_GPU_ATTN_BAD_ARGS, "layout whose head stride is not head_dim*2 refused"); + free(pool); + CHECK(strcmp(omega_gpu_attention_rc_name(OMEGA_GPU_ATTN_UNWRITTEN), "UNWRITTEN") == 0, "rc name"); + + /* with --divergent the listing must also show the region ops (last two entries) */ + static const char *const must_bf16[] = { "MUFU.EX2", "MUFU.RCP", "FMNMX", "BAR.SYNC", "SHFL.DOWN", "@P0 BRA", "@!P0 BRA", "LDG.E.U16", "LDG.E ", "LDG.E.128", "LDS.128", "LDS R", "STS [R", "STG.E", "LOP3.LUT", "SHF.R.U32.HI", "BSSY", "BSYNC" }; + static const char *const must_f32[] = { "MUFU.EX2", "MUFU.RCP", "FMNMX", "BAR.SYNC", "SHFL.DOWN", "@P0 BRA", "@!P0 BRA", "LDG.E ", "LDG.E.128", "LDS.128", "LDS R", "STS [R", "STG.E", "BSSY", "BSYNC" }; + for (int f32 = 0; f32 < 2; f32++) { + const char *name = f32 ? "gqa_f32" : "paged_bf16"; + OmegaBlackwellKernel k; memset(&k, 0, sizeof k); + int rc = omega_gpu_attention_codegen_hd(f32 != 0, f32 ? 12 : 4, 3, g_hd, &k); + CHECK(rc == OMEGA_GPU_ATTN_OK && k.code_size > 0 && k.gpr_count <= 64, "%s kernel generated (rc %s, %zu insns, %u gprs)", name, omega_gpu_attention_rc_name(rc), k.insn_count, k.gpr_count); + printf("codegen %s: %zu insns, %u gprs, %u ugprs\n", name, k.insn_count, k.gpr_count, k.uniform_gpr_count); + /* every mutant (1 .. COUNT-1) is a distinct kernel: different from the baseline and from + * every other mutant, named, and inside the register budget */ + uint8_t digests[OMEGA_GPU_ATTN_MUTANT_COUNT][32]; memcpy(digests[0], k.code_digest, 32); + free(k.code); + for (int m = 1; m < OMEGA_GPU_ATTN_MUTANT_COUNT; m++) { + omega_gpu_attention_test_set_mutant((OmegaGpuAttnMutant)m); + memset(&k, 0, sizeof k); + int mrc = omega_gpu_attention_codegen_hd(f32 != 0, f32 ? 12 : 4, 3, g_hd, &k); + CHECK(mrc == OMEGA_GPU_ATTN_OK && k.gpr_count <= 64, "%s mutant %s generated (rc %s, %u gprs)", name, omega_gpu_attention_mutant_name((OmegaGpuAttnMutant)m), omega_gpu_attention_rc_name(mrc), k.gpr_count); + CHECK(strcmp(omega_gpu_attention_mutant_name((OmegaGpuAttnMutant)m), "?") != 0, "mutant %d has a name", m); + memcpy(digests[m], k.code_digest, 32); + free(k.code); + omega_gpu_attention_test_set_mutant(OMEGA_GPU_ATTN_MUTANT_NONE); + for (int o = 0; o < m; o++) + CHECK(memcmp(digests[o], digests[m], 32) != 0, "%s mutant %s kernel differs from %s", name, omega_gpu_attention_mutant_name((OmegaGpuAttnMutant)m), omega_gpu_attention_mutant_name((OmegaGpuAttnMutant)o)); + } + CHECK(strcmp(omega_gpu_attention_mutant_name(OMEGA_GPU_ATTN_MUTANT_COUNT), "?") == 0, "COUNT has no name"); + /* a different shape key is a different kernel */ + memset(&k, 0, sizeof k); + CHECK(omega_gpu_attention_codegen_hd(f32 != 0, f32 ? 12 : 4, 2, g_hd, &k) == OMEGA_GPU_ATTN_OK && memcmp(digests[0], k.code_digest, 32) != 0, "%s log2gqa 2 kernel differs from log2gqa 3", name); + free(k.code); + CHECK(nvdisasm_check(f32 != 0, name, f32 ? must_f32 : must_bf16, (f32 ? 11 : 14) + (g_divergent ? 2 : 0)) == 0, "%s nvdisasm listing decodes and shows the expected instructions", name); + } +} + +/* ------------------------------------------------------------- chip gate */ +typedef struct { const char *name; size_t n; int rc; size_t bad; double worst; int pass; uint64_t chip_ns, call_ns; uint32_t calls, unwritten; + int mutants_run, mutants_caught; char mutant_note[400]; + uint64_t kv_staged, kv_naive; uint32_t blk_logical, blk_unique; } Case; +static void case_info(Case *c, const OmegaGpuAttnInfo *i) { + c->chip_ns = i->elapsed_ns; c->call_ns = i->call_ns; c->calls = i->chip_calls; c->unwritten = i->unwritten_words; + c->kv_staged = i->kv_bytes_staged; c->kv_naive = i->kv_bytes_naive; c->blk_logical = i->kv_blocks_logical; c->blk_unique = i->kv_blocks_unique; +} +static Case g_cases[64]; static int g_ncases; +static int g_mutant_caught[OMEGA_GPU_ATTN_MUTANT_COUNT], g_mutant_run[OMEGA_GPU_ATTN_MUTANT_COUNT]; + +static void record(Case c, FILE *out) { + g_cases[g_ncases++] = c; + CHECK(c.pass, "%s rc=%s violations=%zu worst=%g", c.name, omega_gpu_attention_rc_name(c.rc), c.bad, c.worst); + CHECK(c.mutants_caught == c.mutants_run, "%s mutants caught %d of %d (%s)", c.name, c.mutants_caught, c.mutants_run, c.mutant_note); + printf("%s %s n=%zu rc=%s violations=%zu worst_scaled_err=%g chip_ns=%" PRIu64 " call_ns=%" PRIu64 " calls=%u unwritten=%u kv_staged=%" PRIu64 "/%" PRIu64 " blocks=%u/%u | mutants %d/%d %s\n", + c.pass && c.mutants_caught == c.mutants_run ? "PASS" : "FAIL", c.name, c.n, omega_gpu_attention_rc_name(c.rc), c.bad, c.worst, c.chip_ns, c.call_ns, c.calls, c.unwritten, + c.kv_staged, c.kv_naive, c.blk_unique, c.blk_logical, c.mutants_caught, c.mutants_run, c.mutant_note); + if (out) fprintf(out, "%s{\"case\":\"%s\",\"n\":%zu,\"rc\":\"%s\",\"violations\":%zu,\"worst_scaled_err\":%g,\"pass\":%s,\"chip_elapsed_ns\":%" PRIu64 ",\"call_ns\":%" PRIu64 ",\"chip_calls\":%u,\"unwritten_words\":%u," + "\"kv_bytes_staged\":%" PRIu64 ",\"kv_bytes_naive\":%" PRIu64 ",\"kv_blocks_unique\":%u,\"kv_blocks_logical\":%u,\"mutants_run\":%d,\"mutants_caught\":%d,\"mutant_note\":\"%s\"}", + g_ncases > 1 ? "," : "", c.name, c.n, omega_gpu_attention_rc_name(c.rc), c.bad, c.worst, c.pass ? "true" : "false", c.chip_ns, c.call_ns, c.calls, c.unwritten, + c.kv_staged, c.kv_naive, c.blk_unique, c.blk_logical, c.mutants_run, c.mutants_caught, c.mutant_note); +} + +static const char *mutant_name(int m) { return omega_gpu_attention_mutant_name((OmegaGpuAttnMutant)m); } + +/* Runs the mutants listed in `ms` (terminated by 0) through `run` and counts the catches. */ +typedef int (*RunFn)(void *ctx, float *got, OmegaGpuAttnInfo *info); +/* The forced launch split the battery currently holds (the engine hook has no getter); -1 = automatic. */ +static int g_forced_split = -1; +static void set_split(int log2split) { g_forced_split = log2split; omega_gpu_attention_test_set_split(log2split); } + +static void run_mutants(Case *c, const int *ms, RunFn run, void *ctx, float *got, const float *want, size_t n, double rel, double abs_tol) { + size_t pos = strlen(c->mutant_note); /* appends: a case may call this more than once */ + for (int i = 0; ms[i]; i++) { + OmegaGpuAttnInfo info; double w; + omega_gpu_attention_test_set_mutant((OmegaGpuAttnMutant)ms[i]); + /* cut J (one chunk per split): a paged call at up to 16 chunks gives every CTA one chunk, so the in-kernel + * rescale between chunks never runs and the NO_RESCALE mutant would be invisible. That mutant runs with the + * whole context in one CTA per head (forced split 1), where the rescale happens on every chunk after the first. */ + const int one_cta = ms[i] == OMEGA_GPU_ATTN_MUTANT_NO_RESCALE; + if (one_cta) omega_gpu_attention_test_set_split(0); + int rc = run(ctx, got, &info); + if (one_cta) omega_gpu_attention_test_set_split(g_forced_split); + size_t bad = compare(got, want, n, rel, abs_tol, &w); + int caught = rc != OMEGA_GPU_ATTN_OK || bad > 0; + omega_gpu_attention_test_set_mutant(OMEGA_GPU_ATTN_MUTANT_NONE); + c->mutants_run++; c->mutants_caught += caught; g_mutant_run[ms[i]]++; g_mutant_caught[ms[i]] += caught; + pos += (size_t)snprintf(c->mutant_note + pos, sizeof c->mutant_note - pos, "%s%s:%s(rc=%s,bad=%zu)", pos ? " " : "", mutant_name(ms[i]), caught ? "CAUGHT" : "MISSED", omega_gpu_attention_rc_name(rc), bad); + if (pos >= sizeof c->mutant_note) break; + } +} + +typedef struct { const float *q, *kc, *vc; uint32_t seq, nqh, nkv; } GqaCtx; +static int run_gqa(void *p, float *got, OmegaGpuAttnInfo *info) { GqaCtx *c = p; return omega_gpu_gqa_attention_f32(c->q, c->kc, c->vc, c->seq, c->nqh, c->nkv, g_hd, got, info); } +typedef struct { const float *q, *kc, *vc; uint32_t base, nr, nqh, nkv; } RowsCtx; +static int run_rows(void *p, float *got, OmegaGpuAttnInfo *info) { RowsCtx *c = p; return omega_gpu_gqa_attention_rows_f32(c->q, c->kc, c->vc, c->base, c->nr, c->nqh, c->nkv, g_hd, got, info); } +typedef struct { const float *q; const uint8_t *pool; const OmegaGpuKvLayout *ly; const uint32_t *ids; uint32_t nids, ctx, layer, nqh, nkv; } PagedCtx; +static int run_paged(void *p, float *got, OmegaGpuAttnInfo *info) { PagedCtx *c = p; return omega_gpu_paged_attention_bf16(c->q, c->pool, c->ly, c->ids, c->nids, c->ctx, c->layer, c->nqh, c->nkv, g_hd, got, info); } +typedef struct { const float *q; const uint8_t *pool; const OmegaGpuKvLayout *ly; const int32_t *tables, *ctxs; uint32_t maxb, nseq, layer, nqh, nkv; } BatchCtx; +static int run_batch(void *p, float *got, OmegaGpuAttnInfo *info) { BatchCtx *c = p; return omega_gpu_paged_attention_batch_bf16(c->q, c->pool, c->ly, c->tables, c->ctxs, c->maxb, c->nseq, c->layer, c->nqh, c->nkv, g_hd, got, info); } +/* single vs batched parity and repeat (L6-KV, CAND-0 coverage): each sequence of a batch, run + * alone through the single-sequence entry point with the batch's own rules applied by hand + * (negative table entries removed, ctx <= 0 -> 0), must equal its row of the batched output bit + * for bit (same kernel, same per-CTA inputs; the batch only shares staging). Then the batch is + * called again with the same inputs: kernel cache hit, bit-identical output, identical staging + * counters. `got` must hold the batched output of `bc`. */ +static void batch_single_repeat_checks(const char *name, const BatchCtx *bc, const float *got, const Case *c) { + size_t row = (size_t)bc->nqh * g_hd, n = (size_t)bc->nseq * row; + float *one = malloc(row * 4), *again = malloc(n * 4); + uint32_t *ids = malloc((bc->maxb ? bc->maxb : 1) * 4); + for (uint32_t s = 0; s < bc->nseq; s++) { + uint32_t nb = 0; + for (uint32_t b = 0; b < bc->maxb; b++) { int32_t v = bc->tables[(size_t)s * bc->maxb + b]; if (v >= 0) ids[nb++] = (uint32_t)v; } + uint32_t ctx = bc->ctxs[s] > 0 ? (uint32_t)bc->ctxs[s] : 0; + for (size_t i = 0; i < row; i++) one[i] = -7.0f; /* poison: an unwritten row cannot match */ + OmegaGpuAttnInfo si; + int src = omega_gpu_paged_attention_bf16(bc->q + (size_t)s * row, bc->pool, bc->ly, ids, nb, ctx, bc->layer, bc->nqh, bc->nkv, g_hd, one, &si); + CHECK(src == OMEGA_GPU_ATTN_OK && memcmp(one, got + (size_t)s * row, row * 4) == 0, + "%s: sequence %u alone (single entry point, %u blocks, ctx %u) is bit-identical to its batched row (rc=%s)", name, s, nb, ctx, omega_gpu_attention_rc_name(src)); + } + OmegaGpuAttnInfo ri; + int rrc = omega_gpu_paged_attention_batch_bf16(bc->q, bc->pool, bc->ly, bc->tables, bc->ctxs, bc->maxb, bc->nseq, bc->layer, bc->nqh, bc->nkv, g_hd, again, &ri); + CHECK(rrc == OMEGA_GPU_ATTN_OK && ri.kernel_cache_hit && memcmp(again, got, n * 4) == 0 && ri.kv_bytes_staged == c->kv_staged && ri.kv_bytes_naive == c->kv_naive + && ri.kv_blocks_unique == c->blk_unique && ri.kv_blocks_logical == c->blk_logical, + "%s: repeated batch call is a cache hit, bit-identical, same staging counters (rc=%s hit=%d staged %" PRIu64 "/%" PRIu64 ")", + name, omega_gpu_attention_rc_name(rrc), (int)ri.kernel_cache_hit, ri.kv_bytes_staged, c->kv_staged); + free(one); free(again); free(ids); +} + + +static int chip(const char *out_path) { + FILE *out = out_path ? fopen(out_path, "w") : NULL; + if (out_path && !out) { printf("cannot open %s\n", out_path); return 2; } + if (out) fprintf(out, "{\"schema\":\"OMEGA_GPU_ATTENTION_V1\",\"tolerances\":{\"rel\":2e-4,\"abs\":2e-5,\"large_scores_rel\":1e-3,\"large_scores_abs\":1e-4},\"cases\":["); + uint32_t seed = 0xfb1c0005u; + const uint32_t hd = g_hd; + typedef struct { uint32_t nqh, nkv; const char *model; } Shape; + const Shape shapes64[2] = { { 32, 4, "tinyllama" }, { 32, 8, "llama32_1b" } }; + /* head_dim 128: Qwen3-4B (32 q heads, 8 kv heads, GQA 4:1) and a ratio-8 shape */ + const Shape shapes128[2] = { { 32, 8, "qwen3_4b" }, { 32, 4, "gqa8" } }; + const Shape *shapes = hd == 128 ? shapes128 : shapes64; + /* 65, 129, 300 and 1000 end in a partial 64-token chunk after whole ones: the case that + * caught the diverged-warp shuffle on the chip (2026-10-04); 1, 17, 128, 256, 2048 did not. */ + /* head_dim 128 chunks are 128 tokens: 127, 128, 129 straddle a chunk, 300 and 1000 end in a partial one */ + const uint32_t ctxs64[9] = { 1, 17, 256, 2048, 65, 128, 129, 300, 1000 }, ctxs128[9] = { 1, 17, 256, 2048, 127, 128, 129, 300, 1000 }; + const uint32_t *ctxs = hd == 128 ? ctxs128 : ctxs64; + const int no_mutants[1] = { 0 }; + + /* 1. contiguous f32 KV (gqa_attention) */ + for (int sh = 0; sh < 2; sh++) for (int ci = 0; ci < 9; ci++) { + uint32_t nqh = shapes[sh].nqh, nkv = shapes[sh].nkv, seq = ctxs[ci]; + size_t n = (size_t)nqh * hd, nkvs = (size_t)seq * nkv * hd; + float *q = malloc(n * 4), *kc = malloc(nkvs * 4), *vc = malloc(nkvs * 4), *got = malloc(n * 4), *want = malloc(n * 4), *again = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + for (size_t i = 0; i < nkvs; i++) { kc[i] = frand(&seed, -1.0f, 1.0f); vc[i] = frand(&seed, -1.0f, 1.0f); } + oracle_gqa(q, kc, vc, seq, nqh, nkv, hd, want); + char name[96]; snprintf(name, sizeof name, "gqa_f32_%s_%uq%ukv_ctx%u", shapes[sh].model, nqh, nkv, seq); + Case c = { .name = strdup(name), .n = n }; + OmegaGpuAttnInfo info; + GqaCtx gc = { q, kc, vc, seq, nqh, nkv }; + c.rc = run_gqa(&gc, got, &info); + c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst); + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); + if (ci == 3) { + OmegaGpuAttnInfo i2; int rc2 = run_gqa(&gc, again, &i2); + CHECK(rc2 == OMEGA_GPU_ATTN_OK && i2.kernel_cache_hit && memcmp(got, again, n * 4) == 0, "%s repeat run (cache hit) is bit-identical", name); + /* negative control: the comparison must reject a wrong expectation (kv heads swapped) */ + float *wrong = malloc(n * 4); double w2; + for (uint32_t h = 0; h < nqh; h++) memcpy(wrong + (size_t)h * hd, want + (size_t)((h + nqh / nkv) % nqh) * hd, hd * 4); + size_t neg = compare(got, wrong, n, 2e-4, 2e-5, &w2); + CHECK(neg > n / 2, "%s negative control: wrong expectation flagged (%zu of %zu)", name, neg, n); + free(wrong); + static const int ms[5] = { OMEGA_GPU_ATTN_MUTANT_SLOT, OMEGA_GPU_ATTN_MUTANT_NO_RESCALE, OMEGA_GPU_ATTN_MUTANT_Q_ROW, OMEGA_GPU_ATTN_MUTANT_OUT_ROW, 0 }; + run_mutants(&c, ms, run_gqa, &gc, got, want, n, 2e-4, 2e-5); + } else if (ci == 1 && sh == 1) { + static const int ms[2] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, 0 }; + run_mutants(&c, ms, run_gqa, &gc, got, want, n, 2e-4, 2e-5); + } else run_mutants(&c, no_mutants, run_gqa, &gc, got, want, n, 2e-4, 2e-5); + record(c, out); free(q); free(kc); free(vc); free(got); free(want); free(again); + } + /* 1b. rows path (prompt read, 2026-10-12): base_len tokens already in the KV, then num_rows + * query rows in one call; row i attends over base_len + i + 1 tokens. Expected per row from + * oracle_gqa on that prefix. 40 rows at 32 q heads exceed the 1024-CTA launch bound: 2 launches. */ + for (int sh = 0; sh < 2; sh++) for (int ri = 0; ri < 3; ri++) { + static const uint32_t bases[3] = { 0, 17, 300 }, nrows[3] = { 1, 5, 40 }; + uint32_t nqh = shapes[sh].nqh, nkv = shapes[sh].nkv, base = bases[ri], nr = nrows[ri], total = base + nr; + size_t row = (size_t)nqh * hd, n = row * nr, nkvs = (size_t)total * nkv * hd; + float *q = malloc(n * 4), *kc = malloc(nkvs * 4), *vc = malloc(nkvs * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + for (size_t i = 0; i < nkvs; i++) { kc[i] = frand(&seed, -1.0f, 1.0f); vc[i] = frand(&seed, -1.0f, 1.0f); } + for (uint32_t i = 0; i < nr; i++) oracle_gqa(q + i * row, kc, vc, base + i + 1, nqh, nkv, hd, want + i * row); + char name[96]; snprintf(name, sizeof name, "gqa_rows_f32_%s_%uq%ukv_base%u_rows%u", shapes[sh].model, nqh, nkv, base, nr); + Case c = { .name = strdup(name), .n = n }; + OmegaGpuAttnInfo info; + RowsCtx rx = { q, kc, vc, base, nr, nqh, nkv }; + c.rc = run_rows(&rx, got, &info); + c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst); + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); + if (nr == 1) { + /* one row is the single-row call, bit for bit */ + float *one = malloc(row * 4); OmegaGpuAttnInfo i1; + int rc1 = omega_gpu_gqa_attention_f32(q, kc, vc, total, nqh, nkv, hd, one, &i1); + CHECK(rc1 == OMEGA_GPU_ATTN_OK && memcmp(got, one, row * 4) == 0, "%s equals omega_gpu_gqa_attention_f32 bit for bit", name); + free(one); + } + if (nr == 40) { + CHECK(info.chip_calls == 2, "%s 40 rows x %u heads go in 2 launches (got %u)", name, nqh, info.chip_calls); + CHECK(info.kv_bytes_staged == 2 * nkvs * 4, "%s KV staged once (%" PRIu64 " bytes, expected %zu)", name, info.kv_bytes_staged, 2 * nkvs * 4); + /* negative control: every row scored over the whole context (no causal cut) must be flagged */ + float *wrong = malloc(n * 4); double w2; + for (uint32_t i = 0; i < nr; i++) oracle_gqa(q + i * row, kc, vc, total, nqh, nkv, hd, wrong + i * row); + size_t neg = compare(got, wrong, n, 2e-4, 2e-5, &w2); + CHECK(neg > n / 4, "%s negative control: non-causal expectation flagged (%zu of %zu)", name, neg, n); + free(wrong); + static const int ms[5] = { OMEGA_GPU_ATTN_MUTANT_SLOT, OMEGA_GPU_ATTN_MUTANT_NO_RESCALE, OMEGA_GPU_ATTN_MUTANT_Q_ROW, OMEGA_GPU_ATTN_MUTANT_OUT_ROW, 0 }; + run_mutants(&c, ms, run_rows, &rx, got, want, n, 2e-4, 2e-5); + } else run_mutants(&c, no_mutants, run_rows, &rx, got, want, n, 2e-4, 2e-5); + record(c, out); free(q); free(kc); free(vc); free(got); free(want); + } + { /* rows path refusals */ + float d[1]; OmegaGpuAttnInfo i0; + CHECK(omega_gpu_gqa_attention_rows_f32(d, d, d, 0, 0, 32, 4, hd, d, &i0) == OMEGA_GPU_ATTN_BAD_ARGS, "rows: zero rows refused"); + CHECK(omega_gpu_gqa_attention_rows_f32(d, d, d, OMEGA_GPU_ATTN_MAX_GQA_CTX, 1, 32, 4, hd, d, &i0) == OMEGA_GPU_ATTN_TOO_LARGE, "rows: base + rows past the context bound refused"); + } + /* 2. large scores (q scaled by 200): the softmax without the running max overflows */ + { + uint32_t nqh = 32, nkv = 4, seq = 256; size_t n = (size_t)nqh * hd, nkvs = (size_t)seq * nkv * hd; + float *q = malloc(n * 4), *kc = malloc(nkvs * 4), *vc = malloc(nkvs * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -200.0f, 200.0f); /* scores ~ +-200 natural: EX2 without the max subtraction overflows f32 (2^128) */ + for (size_t i = 0; i < nkvs; i++) { kc[i] = frand(&seed, -1.0f, 1.0f); vc[i] = frand(&seed, -1.0f, 1.0f); } + oracle_gqa(q, kc, vc, seq, nqh, nkv, hd, want); + Case c = { .name = "gqa_f32_large_scores_32q4kv_ctx256", .n = n }; + OmegaGpuAttnInfo info; GqaCtx gc = { q, kc, vc, seq, nqh, nkv }; + c.rc = run_gqa(&gc, got, &info); + c.bad = compare(got, want, n, 1e-3, 1e-4, &c.worst); + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); + static const int ms[2] = { OMEGA_GPU_ATTN_MUTANT_NO_MAX, 0 }; + run_mutants(&c, ms, run_gqa, &gc, got, want, n, 1e-3, 1e-4); + record(c, out); free(q); free(kc); free(vc); free(got); free(want); + } + /* 2b. MHA (16q/16kv, ratio 1, ctx 300 = 4 full chunks + a partial one): the head-wiring + * mutants Q_ROW and OUT_ROW are observably different here (Q_ROW keeps kv head h, OUT_ROW + * lands on kv head h^1), unlike GQA where both swap the same pair of outputs. */ + { + uint32_t nqh = 16, nkv = 16, seq = 300; size_t n = (size_t)nqh * hd, nkvs = (size_t)seq * nkv * hd; + float *q = malloc(n * 4), *kc = malloc(nkvs * 4), *vc = malloc(nkvs * 4), *got = malloc(n * 4), *want = malloc(n * 4), *got_q = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + for (size_t i = 0; i < nkvs; i++) { kc[i] = frand(&seed, -1.0f, 1.0f); vc[i] = frand(&seed, -1.0f, 1.0f); } + oracle_gqa(q, kc, vc, seq, nqh, nkv, hd, want); + Case c = { .name = "gqa_f32_mha_16q16kv_ctx300", .n = n }; + OmegaGpuAttnInfo info; GqaCtx gc = { q, kc, vc, seq, nqh, nkv }; + c.rc = run_gqa(&gc, got, &info); + c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst); + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); + static const int ms_q[2] = { OMEGA_GPU_ATTN_MUTANT_Q_ROW, 0 }; + static const int ms_o[3] = { OMEGA_GPU_ATTN_MUTANT_OUT_ROW, OMEGA_GPU_ATTN_MUTANT_KV_HEAD, 0 }; + run_mutants(&c, ms_q, run_gqa, &gc, got, want, n, 2e-4, 2e-5); + memcpy(got_q, got, n * 4); /* Q_ROW output */ + run_mutants(&c, ms_o, run_gqa, &gc, got, want, n, 2e-4, 2e-5); + /* `got` now holds the KV_HEAD output; rerun OUT_ROW alone to compare it with Q_ROW */ + omega_gpu_attention_test_set_mutant(OMEGA_GPU_ATTN_MUTANT_OUT_ROW); + OmegaGpuAttnInfo i3; int rc3 = run_gqa(&gc, got, &i3); + omega_gpu_attention_test_set_mutant(OMEGA_GPU_ATTN_MUTANT_NONE); + double wq; size_t differ = compare(got, got_q, n, 2e-4, 2e-5, &wq); + CHECK(rc3 == OMEGA_GPU_ATTN_OK && differ > n / 2, "mha: Q_ROW and OUT_ROW outputs are distinct wrong answers (%zu of %zu differ)", differ, n); + record(c, out); free(q); free(kc); free(vc); free(got); free(want); free(got_q); + } + /* resident fit rule at the 32-bit edge (Qwen3-8B geometry: 36 layers, 8 kv heads x 128, block 16), no allocation */ + { + OmegaGpuKvLayout big = layout_for(4096, 16, 36, 8, 128); + uint32_t id_ok = (uint32_t)((0xffffffffull - big.layer_stride_bytes) / big.block_stride_bytes); + CHECK(omega_gpu_attention_test_resident_fits(&big, id_ok) && !omega_gpu_attention_test_resident_fits(&big, id_ok + 1), + "resident fit rule at the 4 GiB edge: block %u fits, %u does not (block stride %llu)", id_ok, id_ok + 1, + (unsigned long long)big.block_stride_bytes); + } + /* 3. paged bf16 KV, block size 16, 2 layers (layer 1 under test), scattered block ids */ + for (int sh = 0; sh < 2; sh++) for (int ci = 0; ci < 9; ci++) { + uint32_t nqh = shapes[sh].nqh, nkv = shapes[sh].nkv, ctx = ctxs[ci], bs = 16, layers = 2, layer = 1; + uint32_t nblk = (ctx + bs - 1) / bs, pool_blocks = nblk + 7; + OmegaGpuKvLayout ly = layout_for(pool_blocks, bs, layers, nkv, hd); + uint8_t *pool = malloc(ly.pool_bytes); uint16_t *pw = (uint16_t *)pool; + for (size_t i = 0; i < ly.pool_bytes / 2; i++) pw[i] = f2bf(frand(&seed, -1.0f, 1.0f)); + uint32_t *ids = malloc(nblk * 4); /* a scattered permutation of the pool blocks */ + for (uint32_t b = 0; b < nblk; b++) ids[b] = (b * 7 + 3) % pool_blocks; + size_t n = (size_t)nqh * hd; + float *q = malloc(n * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + oracle_paged(q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv, hd, want); + char name[96]; snprintf(name, sizeof name, "paged_bf16_%s_%uq%ukv_bs%u_ctx%u", shapes[sh].model, nqh, nkv, bs, ctx); + Case c = { .name = strdup(name), .n = n }; + OmegaGpuAttnInfo info; PagedCtx pc = { q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv }; + c.rc = run_paged(&pc, got, &info); + c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst); + /* Resident pool (2026-10-12): the same bytes in omega's own allocation, read in place. Same kernel, + * same data, only the addressing differs: bit-identical to the staged result just computed (which is + * the negative control: a plain host pool reports STAGED), nothing staged, info says RESIDENT. */ + if (c.rc == OMEGA_GPU_ATTN_OK) { + void *rp = NULL; + int arc = omega_gpu_attention_pool_alloc(ly.pool_bytes, &rp); + CHECK(arc == OMEGA_GPU_ATTN_OK && rp, "%s: resident pool alloc rc=%d (%s)", name, arc, omega_gpu_attention_last_error()); + if (arc == OMEGA_GPU_ATTN_OK) { + memcpy(rp, pool, ly.pool_bytes); + float *got_r = malloc(n * 4); OmegaGpuAttnInfo ri; + PagedCtx rpc = { q, rp, &ly, ids, nblk, ctx, layer, nqh, nkv }; + int rrc = run_paged(&rpc, got_r, &ri); + int same = memcmp(got_r, got, n * 4) == 0; + CHECK(rrc == OMEGA_GPU_ATTN_OK && ri.kv_source == OMEGA_GPU_ATTN_KV_RESIDENT && ri.kv_bytes_staged == 0 && + info.kv_source == OMEGA_GPU_ATTN_KV_STAGED && same, + "%s: resident pool rc=%d source=%u staged=%llu (control source=%u) bit-identical=%d", name, rrc, ri.kv_source, + (unsigned long long)ri.kv_bytes_staged, info.kv_source, same); + free(got_r); + } + omega_gpu_attention_pool_free(); + } + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); + if (ci == 3) { + /* NO_MAX cannot overflow on unit-scale scores (softmax is shift invariant); it is caught by the large-score gqa case */ + static const int ms3[6] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, OMEGA_GPU_ATTN_MUTANT_SLOT, OMEGA_GPU_ATTN_MUTANT_NO_RESCALE, OMEGA_GPU_ATTN_MUTANT_Q_ROW, OMEGA_GPU_ATTN_MUTANT_OUT_ROW, 0 }; + run_mutants(&c, ms3, run_paged, &pc, got, want, n, 2e-4, 2e-5); + } else if (ci == 1) { + static const int ms[3] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, OMEGA_GPU_ATTN_MUTANT_SLOT, 0 }; + run_mutants(&c, ms, run_paged, &pc, got, want, n, 2e-4, 2e-5); + } else if (ci == 0) { + /* one token: its softmax weight is 1 whatever K says, so a K-only slot shift is invisible; KV_HEAD still shows */ + static const int ms[2] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, 0 }; + run_mutants(&c, ms, run_paged, &pc, got, want, n, 2e-4, 2e-5); + } else run_mutants(&c, no_mutants, run_paged, &pc, got, want, n, 2e-4, 2e-5); + record(c, out); free(pool); free(ids); free(q); free(got); free(want); + } + /* 3b. context split (cut F): the 32q/8kv shape at ctx 1000 under every forced split against the oracle, the + * CTA count per launch grows with the split, the automatic choice at this context is 8 (hd 128: 8 chunks) or + * 16 (hd 64: 16 chunks; cut J, one chunk per split), and a short context (ctx 100, one chunk) stays unsplit. A forced launch split at or above + * the sequence's own count gives the same bits (the extra CTAs write empty partials that add exact zeros). */ + { + uint32_t nqh = 32, nkv = 8, bs = 16, layers = 2, layer = 1; + const uint32_t cx[2] = { 1000, 100 }; + for (int ci = 0; ci < 2; ci++) { + uint32_t ctx = cx[ci], nblk = (ctx + bs - 1) / bs, pool_blocks = nblk + 3; + OmegaGpuKvLayout ly = layout_for(pool_blocks, bs, layers, nkv, hd); + uint8_t *pool = malloc(ly.pool_bytes); uint16_t *pw = (uint16_t *)pool; + for (size_t i = 0; i < ly.pool_bytes / 2; i++) pw[i] = f2bf(frand(&seed, -1.0f, 1.0f)); + uint32_t *ids = malloc(nblk * 4); + for (uint32_t b = 0; b < nblk; b++) ids[b] = (b * 5 + 1) % pool_blocks; + size_t n = (size_t)nqh * hd; + float *q = malloc(n * 4), *got = malloc(n * 4), *want = malloc(n * 4), *auto_got = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + oracle_paged(q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv, hd, want); + PagedCtx pc = { q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv }; + OmegaGpuAttnInfo ai; + int arc = run_paged(&pc, auto_got, &ai); + uint32_t chunks = (ctx + hd - 1) / hd, want_log2 = 0; + const uint32_t gcta = nqh / omega_gpu_attention_heads_per_cta(hd, 2); /* CTAs per split: cut K groups 4 heads per CTA at hd 128 */ + while (want_log2 < OMEGA_GPU_ATTN_MAX_LOG2SPLIT && (2u << want_log2) <= chunks) want_log2++; + CHECK(arc == OMEGA_GPU_ATTN_OK && ai.ctas_last_launch == (gcta << want_log2), + "split auto ctx %u: rc=%s ctas=%u (expected %u)", ctx, omega_gpu_attention_rc_name(arc), ai.ctas_last_launch, gcta << want_log2); + for (int ls = 0; ls <= (int)OMEGA_GPU_ATTN_MAX_LOG2SPLIT; ls++) { + set_split(ls); + OmegaGpuAttnInfo fi; + char name[96]; snprintf(name, sizeof name, "paged_bf16_split%d_32q8kv_ctx%u", 1 << ls, ctx); + Case c = { .name = strdup(name), .n = n }; + c.rc = run_paged(&pc, got, &fi); + c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst); + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &fi); + CHECK(fi.ctas_last_launch == (gcta << ls) && fi.out_bytes == (uint64_t)nqh * (1u << ls) * (hd + 2) * 4, + "%s: ctas=%u out_bytes=%llu", name, fi.ctas_last_launch, (unsigned long long)fi.out_bytes); + if ((uint32_t)ls >= want_log2) CHECK(memcmp(got, auto_got, n * 4) == 0, "%s equals the automatic choice bit for bit (a larger launch split only adds empty partials)", name); + if (ls == 1 && ci == 0) { + static const int ms[3] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, OMEGA_GPU_ATTN_MUTANT_SLOT, 0 }; + run_mutants(&c, ms, run_paged, &pc, got, want, n, 2e-4, 2e-5); + } else run_mutants(&c, no_mutants, run_paged, &pc, got, want, n, 2e-4, 2e-5); + record(c, out); + } + set_split(-1); + if (ci == 1 && chunks == 1) CHECK(ai.ctas_last_launch == gcta, "ctx %u: one chunk stays unsplit (%u CTAs)", ctx, ai.ctas_last_launch); + else if (ci == 1) CHECK(ai.ctas_last_launch == (gcta << want_log2), "ctx %u: %u chunks -> %u splits (%u CTAs)", ctx, chunks, 1u << want_log2, ai.ctas_last_launch); + free(pool); free(ids); free(q); free(got); free(want); free(auto_got); + } + } + /* 4. batch: three sequences (short, empty, truncated by its table), a negative table entry, table rows of 16 */ + { + uint32_t nqh = 32, nkv = 8, bs = 16, layers = 3, layer = 2, maxb = 16, nseq = 3, pool_blocks = 40; + OmegaGpuKvLayout ly = layout_for(pool_blocks, bs, layers, nkv, hd); + uint8_t *pool = malloc(ly.pool_bytes); uint16_t *pw = (uint16_t *)pool; + for (size_t i = 0; i < ly.pool_bytes / 2; i++) pw[i] = f2bf(frand(&seed, -1.0f, 1.0f)); + int32_t *tables = malloc((size_t)nseq * maxb * 4); + for (size_t i = 0; i < (size_t)nseq * maxb; i++) tables[i] = -1; + /* seq 0: ctx 40 over blocks 5, 17 (-1 in the middle closes up), 29 */ + tables[0] = 5; tables[1] = -1; tables[2] = 17; tables[3] = 29; + /* seq 1: ctx 0 with a table */ + tables[maxb + 0] = 1; + /* seq 2: ctx 100 but only 4 blocks (64 tokens used) */ + tables[2 * maxb + 0] = 30; tables[2 * maxb + 1] = 2; tables[2 * maxb + 2] = 33; tables[2 * maxb + 3] = 11; + int32_t ctxs2[3] = { 40, 0, 100 }; + size_t n = (size_t)nseq * nqh * hd; + float *q = malloc(n * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + oracle_batch(q, pool, &ly, tables, ctxs2, maxb, nseq, layer, nqh, nkv, hd, want); + Case c = { .name = "paged_bf16_batch_3seq_32q8kv_ctx40_0_100", .n = n }; + OmegaGpuAttnInfo info; BatchCtx bc = { q, pool, &ly, tables, ctxs2, maxb, nseq, layer, nqh, nkv }; + c.rc = run_batch(&bc, got, &info); + c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst); + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); + int zeros = 1; for (size_t i = 0; i < (size_t)nqh * hd; i++) if (got[(size_t)nqh * hd + i] != 0.0f) zeros = 0; + CHECK(zeros, "batch: the empty sequence is all zeros"); + batch_single_repeat_checks(c.name, &bc, got, &c); + static const int ms[5] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, OMEGA_GPU_ATTN_MUTANT_SLOT, OMEGA_GPU_ATTN_MUTANT_Q_ROW, OMEGA_GPU_ATTN_MUTANT_OUT_ROW, 0 }; + run_mutants(&c, ms, run_batch, &bc, got, want, n, 2e-4, 2e-5); + /* all 7 referenced blocks are distinct here, so dedupe stages exactly the naive figure */ + CHECK(c.blk_logical == 7 && c.blk_unique == 7 && c.kv_staged == c.kv_naive && c.kv_staged == 7ull * ly.layer_stride_bytes, "batch: 7 distinct blocks staged once each (%u/%u, %" PRIu64 " bytes)", c.blk_unique, c.blk_logical, c.kv_staged); + record(c, out); free(pool); free(tables); free(q); free(got); free(want); + } + /* 5. branch-heavy batch (attention hardening cut): four sequences share the same 10 physical + * prefix blocks (160 tokens, scattered ids) and own private tails of 1..3 blocks ending in a + * partial 64-token chunk. The shared prefix must be staged once per launch, keyed by the + * physical block id. Two head shapes: 8q/2kv puts all four sequences in one launch + * (unique = 10 + 9 tails), 32q/8kv splits them two per launch (unique = 2*10 + 9). + * Negative control: the legacy per-sequence staging (test hook) copies the prefix four + * times and the byte-reduction check must flag it. */ + for (int sh = 0; sh < 2; sh++) { + uint32_t nqh = sh ? 32 : 8, nkv = sh ? 8 : 2, bs = 16, layers = 2, layer = 1, nseq = 4, prefix_blocks = 10, pool_blocks = 64; + uint32_t expect_unique = sh ? 2 * prefix_blocks + 9 : prefix_blocks + 9; + uint32_t maxb = prefix_blocks + 3; + OmegaGpuKvLayout ly = layout_for(pool_blocks, bs, layers, nkv, hd); + uint8_t *pool = malloc(ly.pool_bytes); uint16_t *pw = (uint16_t *)pool; + for (size_t i = 0; i < ly.pool_bytes / 2; i++) pw[i] = f2bf(frand(&seed, -1.0f, 1.0f)); + int32_t *tables = malloc((size_t)nseq * maxb * 4); + for (size_t i = 0; i < (size_t)nseq * maxb; i++) tables[i] = -1; + const uint32_t tails[4] = { 1, 2, 3, 3 }; /* private blocks per sequence: 9 in all */ + const int32_t ctxs5[4] = { 165, 180, 193, 207 }; /* 160 + 5, 20, 33, 47: every last chunk partial */ + for (uint32_t s = 0; s < nseq; s++) { + for (uint32_t b = 0; b < prefix_blocks; b++) tables[s * maxb + b] = (int32_t)((b * 5 + 7) % pool_blocks); /* same scattered physical prefix */ + for (uint32_t b = 0; b < tails[s]; b++) tables[s * maxb + prefix_blocks + b] = (int32_t)(50 + s * 3 + b); /* private, distinct */ + } + size_t n = (size_t)nseq * nqh * hd; + float *q = malloc(n * 4), *got = malloc(n * 4), *want = malloc(n * 4), *legacy = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + oracle_batch(q, pool, &ly, tables, ctxs5, maxb, nseq, layer, nqh, nkv, hd, want); + char name[96]; snprintf(name, sizeof name, "paged_bf16_shared_prefix_4seq_%uq%ukv_10pre", nqh, nkv); + Case c = { .name = strdup(name), .n = n }; + OmegaGpuAttnInfo info; BatchCtx bc = { q, pool, &ly, tables, ctxs5, maxb, nseq, layer, nqh, nkv }; + c.rc = run_batch(&bc, got, &info); + c.bad = compare(got, want, n, 2e-4, 2e-5, &c.worst); + c.pass = c.rc == OMEGA_GPU_ATTN_OK && c.bad == 0; case_info(&c, &info); + uint32_t logical = 4 * prefix_blocks + 9; + CHECK(c.blk_logical == logical && c.blk_unique == expect_unique, "%s: %u logical references, %u unique staged (expected %u/%u)", name, c.blk_logical, c.blk_unique, logical, expect_unique); + CHECK(c.kv_naive == (uint64_t)logical * ly.layer_stride_bytes && c.kv_staged == (uint64_t)expect_unique * ly.layer_stride_bytes && c.kv_staged < c.kv_naive, + "%s: staged %" PRIu64 " < naive %" PRIu64 " bytes (saved %" PRIu64 ")", name, c.kv_staged, c.kv_naive, c.kv_naive - c.kv_staged); + /* cut F: the output traffic is the partials, launch split = the largest own split in the call (cut J: hd 64: ctx 193 and 207 are 4 chunks, 4 splits; hd 128: 2 chunks, 2 splits) */ + uint32_t ls_max = 0; + for (uint32_t s = 0; s < nseq; s++) { uint32_t x = ((uint32_t)ctxs5[s] + hd - 1) / hd, l = 0; while (l < OMEGA_GPU_ATTN_MAX_LOG2SPLIT && (2u << l) <= x) l++; if (l > ls_max) ls_max = l; } + const uint64_t out_expect = (uint64_t)nseq * nqh * (1u << ls_max) * (hd + 2) * 4; + CHECK(info.kv_source == OMEGA_GPU_ATTN_KV_STAGED && info.q_bytes == n * 4 && info.out_bytes == out_expect && info.tab_bytes > 0, "%s: q/out/table traffic accounted (q=%" PRIu64 " out=%" PRIu64 " tab=%" PRIu64 ")", name, info.q_bytes, info.out_bytes, info.tab_bytes); + /* negative control: legacy per-sequence staging duplicates the shared prefix; same answer, more bytes */ + omega_gpu_attention_test_set_dedupe(false); + OmegaGpuAttnInfo li; int lrc = run_batch(&bc, legacy, &li); + omega_gpu_attention_test_set_dedupe(true); + double lw; size_t lbad = compare(legacy, want, n, 2e-4, 2e-5, &lw); + CHECK(lrc == OMEGA_GPU_ATTN_OK && lbad == 0, "%s legacy staging: parity (rc=%s bad=%zu)", name, omega_gpu_attention_rc_name(lrc), lbad); + CHECK(li.kv_blocks_unique == logical && li.kv_bytes_staged == li.kv_bytes_naive && li.kv_bytes_staged > c.kv_staged, + "%s negative control: duplicated prefix staging is flagged (legacy staged %" PRIu64 " == naive %" PRIu64 ", dedupe %" PRIu64 ")", name, li.kv_bytes_staged, li.kv_bytes_naive, c.kv_staged); + CHECK(memcmp(got, legacy, n * 4) == 0, "%s: dedupe and legacy staging are bit-identical", name); + batch_single_repeat_checks(name, &bc, got, &c); + static const int ms5[3] = { OMEGA_GPU_ATTN_MUTANT_KV_HEAD, OMEGA_GPU_ATTN_MUTANT_SLOT, 0 }; + run_mutants(&c, ms5, run_batch, &bc, got, want, n, 2e-4, 2e-5); + record(c, out); free(pool); free(tables); free(q); free(got); free(want); free(legacy); + } + /* every mutant the API knows (1 .. COUNT-1) ran at least once and was caught every time; + * a mutant added to the enum without a battery entry fails here */ + for (int m = 1; m < OMEGA_GPU_ATTN_MUTANT_COUNT; m++) { + CHECK(g_mutant_run[m] > 0 && g_mutant_caught[m] == g_mutant_run[m], "mutant %s caught %d of %d runs", mutant_name(m), g_mutant_caught[m], g_mutant_run[m]); + printf("mutant %s: caught %d of %d\n", mutant_name(m), g_mutant_caught[m], g_mutant_run[m]); + } + CHECK(omega_gpu_session_open_count() == (g_sim_mode ? 0u : 1u), "device opened %s for the battery (opens=%u)", g_sim_mode ? "never (simulator)" : "once", omega_gpu_session_open_count()); + printf("device_opens=%u\n", omega_gpu_session_open_count()); + if (out) { + fprintf(out, "],\"mutant_count\":%d,\"mutants\":{", OMEGA_GPU_ATTN_MUTANT_COUNT - 1); + for (int m = 1; m < OMEGA_GPU_ATTN_MUTANT_COUNT; m++) fprintf(out, "%s\"%s\":{\"run\":%d,\"caught\":%d}", m > 1 ? "," : "", mutant_name(m), g_mutant_run[m], g_mutant_caught[m]); + fprintf(out, "},\"device_opens\":%u,\"checks\":%d,\"failed\":%d,\"verdict\":\"%s\"}\n", omega_gpu_session_open_count(), g_checks, g_failed, g_failed == 0 ? "OMEGA_GPU_ATTENTION_PASS" : "OMEGA_GPU_ATTENTION_FAIL"); + fclose(out); + } + return 0; +} + +/* ------------------------------------------------------------ host simulator + * Executes the allocated IR program (physical registers, so the register allocator's + * loop handling is under test too) for every CTA of a launch: 64 threads, 1 KB shared, + * host pointers as addresses, SHFL and BAR as lockstep points (all threads of the CTA + * must sit at the same instruction). EX2 and RCP are exact here; the chip's are approximate. */ +/* path: hash of every branch decision so far. The attention kernels use no reconvergence + * region (the IR has BSSY/BSYNC since omega #310, omega_bw_reconv.h; the --divergent mode + * below covers them), so once a warp splits it may stay split on the chip, and a + * SHFL reading an inactive lane is undefined (CUDA guide, warp shuffle functions). Every + * SHFL therefore requires one path across the warp, or the simulator stops with error 7. */ +typedef struct { uint32_t r[256]; int pc; int p0; int done; uint64_t path; } SimThr; +static uint32_t sim_cbank[256]; +static uint8_t sim_shared[8192]; +#define SIM_TMAX 128 +#define SIM_T ((int)g_hd) /* threads per CTA = head_dim */ +static uint32_t g_smem_cap; /* negative control: pretend the QMD declared this many bytes (0 = the real 16 * head_dim) */ +#define SIM_SMEM (g_smem_cap ? g_smem_cap : omega_gpu_attention_test_shared_bytes()) /* the shared memory the QMD declares for this kernel (launcher: shared_bytes_for) */ +static int g_sim_err; +static int g_trace, g_trace_launch; static uint32_t g_trace_cx; +static uint32_t rd(const SimThr *t, int v, const BlackwellIRProgram *p) { if (v < 0) return 0; int ph = p->regalloc.vreg_to_phys[v]; return ph < 0 ? 0 : t->r[ph & 0xff]; } +static uint64_t rd64(const SimThr *t, int v, const BlackwellIRProgram *p) { if (v < 0) return 0; int ph = p->regalloc.vreg_to_phys[v] & 0xff; return (uint64_t)t->r[ph] | ((uint64_t)t->r[ph + 1] << 32); } +static void wr(SimThr *t, int v, uint32_t x, const BlackwellIRProgram *p) { if (v < 0) return; int ph = p->regalloc.vreg_to_phys[v]; if (ph >= 0) t->r[ph & 0xff] = x; } +static void wr64(SimThr *t, int v, uint64_t x, const BlackwellIRProgram *p) { if (v < 0) return; int ph = p->regalloc.vreg_to_phys[v] & 0xff; t->r[ph] = (uint32_t)x; t->r[ph + 1] = (uint32_t)(x >> 32); } +static uint32_t rds(const SimThr *t, int v, unsigned sub, const BlackwellIRProgram *p) { if (v < 0) return 0; int ph = p->regalloc.vreg_to_phys[v]; return ph < 0 ? 0 : t->r[(ph + sub) & 0xff]; } +static void wrs(SimThr *t, int v, unsigned sub, uint32_t x, const BlackwellIRProgram *p) { if (v < 0) return; int ph = p->regalloc.vreg_to_phys[v]; if (ph >= 0) t->r[(ph + sub) & 0xff] = x; } +static float u2f(uint32_t u) { float f; memcpy(&f, &u, 4); return f; } +static uint32_t f2u_(float f) { uint32_t u; memcpy(&u, &f, 4); return u; } +/* run one thread until it reaches a SHFL or BAR (not executed) or EXIT; returns 1 if parked at a sync op */ +static int sim_step(SimThr *t, const BlackwellIRProgram *p, uint32_t tid, uint32_t cx, uint32_t cy) { + for (int guard = 0; guard < 50000000; guard++) { + if (t->done) return 0; + if (t->pc < 0 || (size_t)t->pc >= p->count) { g_sim_err = 1; t->done = 1; return 0; } + const BlackwellIRInsn *in = &p->insns[t->pc]; + uint32_t a = rds(t, in->src1_vreg, in->src1_subreg, p), b = rds(t, in->src2_vreg, in->src2_subreg, p), c = rds(t, in->src3_vreg, in->src3_subreg, p); + switch (in->op) { + case BW_IR_SHFL_DOWN: case BW_IR_BAR_SYNC: return 1; + case BW_IR_EXIT: if (!in->predicate_p0 || t->p0) { t->done = 1; return 0; } break; + case BW_IR_BRA: { + int take = !in->predicate_p0 || (in->predicate_not ? !t->p0 : t->p0); + t->path = t->path * 1000003u + (((uint64_t)t->pc << 1) | (uint64_t)take); + if (take) { if ((int32_t)in->imm == 0) { g_sim_err = 2; t->done = 1; return 0; } t->pc += (int32_t)in->imm; continue; } + break; } + case BW_IR_MOV_IMM: wrs(t, in->dst_vreg, in->dst_subreg, in->imm, p); break; + case BW_IR_MOV_RZ: wrs(t, in->dst_vreg, in->dst_subreg, 0, p); break; + case BW_IR_S2R: wrs(t, in->dst_vreg, in->dst_subreg, in->imm == BW_SR_TID_X ? tid : in->imm == BW_SR_CTAID_X ? cx : in->imm == BW_SR_CTAID_Y ? cy : 0, p); break; + case BW_IR_LDC: wrs(t, in->dst_vreg, in->dst_subreg, sim_cbank[in->imm / 4], p); break; + case BW_IR_LDC64: wr64(t, in->dst_vreg, (uint64_t)sim_cbank[in->imm / 4] | ((uint64_t)sim_cbank[in->imm / 4 + 1] << 32), p); break; + case BW_IR_LDCU64: break; /* memory descriptor: not modelled */ + case BW_IR_IMAD: wrs(t, in->dst_vreg, in->dst_subreg, in->src2_vreg >= 0 ? a * b + c : a * in->imm + c, p); break; + case BW_IR_IMAD_WIDE: wr64(t, in->dst_vreg, (uint64_t)a * in->imm + rd64(t, in->src3_vreg, p), p); break; + case BW_IR_IADD3: wrs(t, in->dst_vreg, in->dst_subreg, a + b, p); break; + case BW_IR_SHF_R: wrs(t, in->dst_vreg, in->dst_subreg, a >> (in->imm & 31), p); break; + case BW_IR_LOP3_AND: wrs(t, in->dst_vreg, in->dst_subreg, a & in->imm, p); break; + case BW_IR_LOP3_XOR: wrs(t, in->dst_vreg, in->dst_subreg, a ^ b, p); break; + case BW_IR_ISETP_GE_U32: t->p0 = a >= b; break; + case BW_IR_LDG_E: { uint32_t x; memcpy(&x, (const void *)(uintptr_t)rd64(t, in->src1_vreg, p), 4); wrs(t, in->dst_vreg, in->dst_subreg, x, p); break; } + case BW_IR_LDG_E_U16: { uint16_t x; memcpy(&x, (const void *)(uintptr_t)rd64(t, in->src1_vreg, p), 2); wrs(t, in->dst_vreg, in->dst_subreg, x, p); break; } + case BW_IR_STG_E: memcpy((void *)(uintptr_t)rd64(t, in->src1_vreg, p), &b, 4); break; + case BW_IR_LDG_E_64: case BW_IR_LDG_E_128: { unsigned n = in->op == BW_IR_LDG_E_64 ? 8u : 16u; uint64_t ad = rd64(t, in->src1_vreg, p) + (uint64_t)(int64_t)(int32_t)in->imm; if (ad & (n - 1)) { g_sim_err = 5; t->done = 1; return 0; } uint32_t x[4]; memcpy(x, (const void *)(uintptr_t)ad, n); for (unsigned i = 0; i < n / 4; i++) wrs(t, in->dst_vreg, i, x[i], p); break; } + case BW_IR_LDS128: { uint32_t ad = a + in->imm; if ((ad & 15u) || ad + 16 > SIM_SMEM) { g_sim_err = 3; t->done = 1; return 0; } for (unsigned i = 0; i < 4; i++) { uint32_t x; memcpy(&x, sim_shared + ad + 4u * i, 4); wrs(t, in->dst_vreg, i, x, p); } break; } + case BW_IR_LDS32: { uint32_t x; if (a + 4 > SIM_SMEM) { g_sim_err = 3; t->done = 1; return 0; } memcpy(&x, sim_shared + a, 4); wrs(t, in->dst_vreg, in->dst_subreg, x, p); break; } + case BW_IR_STS32: if (a + 4 > SIM_SMEM) { g_sim_err = 3; t->done = 1; return 0; } memcpy(sim_shared + a, &b, 4); break; + case BW_IR_FADD: wrs(t, in->dst_vreg, in->dst_subreg, f2u_(u2f(a) + u2f(b)), p); break; + case BW_IR_FSUB: wrs(t, in->dst_vreg, in->dst_subreg, f2u_(u2f(a) - u2f(b)), p); break; + case BW_IR_FMUL: wrs(t, in->dst_vreg, in->dst_subreg, f2u_(u2f(a) * u2f(b)), p); break; + case BW_IR_FFMA: wrs(t, in->dst_vreg, in->dst_subreg, f2u_(fmaf(u2f(a), u2f(b), u2f(c))), p); break; + case BW_IR_FMNMX_MAX: wrs(t, in->dst_vreg, in->dst_subreg, f2u_(fmaxf(u2f(a), u2f(b))), p); break; + case BW_IR_MUFU_EX2: wrs(t, in->dst_vreg, in->dst_subreg, f2u_(exp2f(u2f(a))), p); break; + case BW_IR_MUFU_RCP: wrs(t, in->dst_vreg, in->dst_subreg, f2u_(1.0f / u2f(a)), p); break; + default: g_sim_err = 100 + (int)in->op; t->done = 1; return 0; + } + if (g_trace && tid == 0 && cx == g_trace_cx && cy == 0 && g_trace_launch == 1) { uint32_t dv = rd(t, in->dst_vreg, p); printf("T pc=%d op=%d dst=v%d(r%d)=%08x f=%g p0=%d a=%08x b=%08x c=%08x\n", t->pc, (int)in->op, in->dst_vreg, in->dst_vreg >= 0 ? p->regalloc.vreg_to_phys[in->dst_vreg] : -1, dv, u2f(dv), t->p0, a, b, c); } + t->pc++; + } + g_sim_err = 4; t->done = 1; return 0; +} +static int sim_launch(const void *progv, const OmegaGpuAttnLaunch *L, OmegaGpuAttnInfo *info) { + const BlackwellIRProgram *p = progv; + memset(sim_cbank, 0, sizeof sim_cbank); + uint64_t qa = (uintptr_t)L->q, pa = (uintptr_t)L->pool, oa = (uintptr_t)L->out, ta = (uintptr_t)L->tab; + sim_cbank[0x380 / 4] = (uint32_t)qa; sim_cbank[0x380 / 4 + 1] = (uint32_t)(qa >> 32); + sim_cbank[0x388 / 4] = (uint32_t)pa; sim_cbank[0x388 / 4 + 1] = (uint32_t)(pa >> 32); + sim_cbank[0x390 / 4] = (uint32_t)oa; sim_cbank[0x390 / 4 + 1] = (uint32_t)(oa >> 32); + sim_cbank[0x398 / 4] = (uint32_t)ta; sim_cbank[0x398 / 4 + 1] = (uint32_t)(ta >> 32); + memcpy(&sim_cbank[0x3a0 / 4], L->params, sizeof L->params); + uint32_t *outw = L->out; for (size_t i = 0; i < L->out_bytes / 4; i++) outw[i] = 0xffbadbadu; + g_sim_err = 0; + static SimThr th[SIM_TMAX]; + g_trace_launch++; if (getenv("ATTN_SIM_TRACE")) { g_trace = 1; g_trace_cx = (uint32_t)atoi(getenv("ATTN_SIM_TRACE")); } + for (uint32_t cy = 0; cy < L->grid_y && !g_sim_err; cy++) for (uint32_t cx = 0; cx < L->grid_x && !g_sim_err; cx++) { + memset(th, 0, sizeof th); memset(sim_shared, 0, sizeof sim_shared); + for (;;) { + int parked = 0, alive = 0; + for (int i = 0; i < SIM_T; i++) { if (th[i].done) continue; alive++; parked += sim_step(&th[i], p, (uint32_t)i, cx, cy); } + if (g_sim_err) break; + if (alive == 0) break; + if (parked == 0) continue; /* every live thread exited this round */ + if (parked != alive) { g_sim_err = 5; break; } /* a thread exited while others wait at a barrier */ + int pc = -1; + for (int i = 0; i < SIM_T; i++) if (!th[i].done) { if (pc < 0) pc = th[i].pc; else if (th[i].pc != pc) g_sim_err = 6; } + if (g_sim_err) break; + const BlackwellIRInsn *in = &p->insns[pc]; + if (in->op == BW_IR_SHFL_DOWN) { + for (int i = 0; i < SIM_T; i++) if (!th[i].done && !th[i & ~31].done && th[i].path != th[i & ~31].path) g_sim_err = 7; + if (g_sim_err) break; + uint32_t src[SIM_TMAX]; + for (int i = 0; i < SIM_T; i++) src[i] = rd(&th[i], in->src1_vreg, p); + for (int i = 0; i < SIM_T; i++) { int lane = i & 31, from = lane + (int)(in->imm & 31); wr(&th[i], in->dst_vreg, from < 32 ? src[(i & ~31) + from] : src[i], p); } + } + for (int i = 0; i < SIM_T; i++) th[i].pc++; + } + } + uint32_t unwritten = 0; for (size_t i = 0; i < L->out_bytes / 4; i++) if (outw[i] == 0xffbadbadu) unwritten++; + if (info) { info->chip_calls++; info->unwritten_words += unwritten; info->ctas_last_launch = L->grid_x * L->grid_y; info->threads_per_cta = SIM_T; } + if (g_sim_err) { printf("simulator error %d\n", g_sim_err); return OMEGA_GPU_ATTN_CHIP_FAIL; } + return unwritten ? OMEGA_GPU_ATTN_UNWRITTEN : OMEGA_GPU_ATTN_OK; +} + + +/* ---------------------------------------------------- timing (cut 4b) */ +/* One query step of TinyLlama attention at context 2048 (32 q heads, 4 kv heads, + * f32 KV) 100 times through the persistent session, every call checked against the + * oracle; gate: median wall time per call under 3 ms, one device open per process. */ +static double now_ms(void) { struct timespec t; clock_gettime(CLOCK_MONOTONIC, &t); return t.tv_sec * 1e3 + t.tv_nsec / 1e6; } +static int cmp_d(const void *a, const void *b) { double x = *(const double *)a, y = *(const double *)b; return x < y ? -1 : x > y; } +/* --split-timing: the paged bf16 decode shape (32 q / 8 kv heads at the current head_dim, one sequence, context + * ATTN_SPLIT_CTX, default 1268: the campaign's document tasks) through the persistent session, 100 calls per + * forced launch split 1, 2, 4, 8 and the automatic choice; median wall and mean chip time per call, every call + * against the oracle. A measurement for the decode-speed work (2026-10-12): whether the kernel's time at this + * context falls with more CTAs per (sequence, head) or stays flat (bandwidth bound: the four query heads of a + * kv head each read its slice). */ +static int split_timing(const char *out_path) { + FILE *out = out_path ? fopen(out_path, "w") : NULL; + if (out_path && !out) { printf("cannot open %s\n", out_path); return 2; } + enum { N = 100 }; + const uint32_t hd = g_hd, nqh = 32, nkv = 8, bs = 16, layers = 2, layer = 1; + const char *ce = getenv("ATTN_SPLIT_CTX"); + const uint32_t ctx = ce && atoi(ce) > 0 ? (uint32_t)atoi(ce) : 1268u; + const uint32_t nblk = (ctx + bs - 1) / bs, pool_blocks = nblk + 3; + uint32_t seed = 0x5b17c0deu; + OmegaGpuKvLayout ly = layout_for(pool_blocks, bs, layers, nkv, hd); + uint8_t *pool = malloc(ly.pool_bytes); uint16_t *pw = (uint16_t *)pool; + for (size_t i = 0; i < ly.pool_bytes / 2; i++) pw[i] = f2bf(frand(&seed, -1.0f, 1.0f)); + uint32_t *ids = malloc(nblk * 4); + for (uint32_t b = 0; b < nblk; b++) ids[b] = (b * 5 + 1) % pool_blocks; + const size_t n = (size_t)nqh * hd; + float *q = malloc(n * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + oracle_paged(q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv, hd, want); + PagedCtx pc = { q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv }; + if (out) fprintf(out, "{\"schema\":\"OMEGA_GPU_ATTENTION_SPLIT_TIMING_V1\",\"hd\":%u,\"ctx\":%u,\"calls\":%d,\"spin_us\":%u,\"cases\":[", + hd, ctx, N, omega_gpu_session_spin_us()); + int first = 1; + for (int ls = -1; ls <= (int)OMEGA_GPU_ATTN_MAX_LOG2SPLIT; ls++) { + set_split(ls); + OmegaGpuAttnInfo info; + int rc0 = run_paged(&pc, got, &info); /* warm-up: opens the device, generates this split's kernel */ + CHECK(rc0 == OMEGA_GPU_ATTN_OK, "split-timing split=%d first call rc=%s err=\"%s\"", ls, omega_gpu_attention_rc_name(rc0), omega_gpu_attention_last_error()); + double samples[N]; int ok_calls = 0; size_t bad_total = 0; double worst = 0; uint64_t chip_sum = 0; + for (int i = 0; i < N; i++) { + double t0 = now_ms(); + int rc = run_paged(&pc, got, &info); + samples[i] = now_ms() - t0; + double w; size_t bad = compare(got, want, n, 2e-4, 2e-5, &w); + if (w > worst) worst = w; + bad_total += bad; chip_sum += info.elapsed_ns; + if (rc == OMEGA_GPU_ATTN_OK && bad == 0) ok_calls++; + } + qsort(samples, N, sizeof samples[0], cmp_d); + const double median = samples[N / 2], p90 = samples[N * 9 / 10], mn = samples[0], mx = samples[N - 1]; + const int pass = ok_calls == N && bad_total == 0; + CHECK(pass, "split-timing split=%d ctx=%u ok_calls=%d/%d violations=%zu", ls, ctx, ok_calls, N, bad_total); + printf("%s split-timing split=%s ctas=%u ctx=%u ok_calls=%d/%d worst_scaled_err=%g median_ms=%.3f p90_ms=%.3f min_ms=%.3f max_ms=%.3f chip_us_mean=%.1f\n", + pass ? "PASS" : "FAIL", ls < 0 ? "auto" : (const char *[]){ "1", "2", "4", "8", "16" }[ls], info.ctas_last_launch, ctx, ok_calls, N, worst, + median, p90, mn, mx, chip_sum / 1e3 / N); + if (out) fprintf(out, "%s{\"split\":%d,\"ctas\":%u,\"ok_calls\":%d,\"violations\":%zu,\"worst_scaled_err\":%g,\"median_ms\":%.4f,\"p90_ms\":%.4f,\"min_ms\":%.4f,\"max_ms\":%.4f,\"chip_us_mean\":%.1f,\"pass\":%s}", + first ? "" : ",", ls, info.ctas_last_launch, ok_calls, bad_total, worst, median, p90, mn, mx, chip_sum / 1e3 / N, pass ? "true" : "false"); + first = 0; + } + set_split(-1); + free(pool); free(ids); free(q); free(got); free(want); + if (out) { fprintf(out, "],\"checks\":%d,\"failed\":%d,\"verdict\":\"%s\"}\n", g_checks, g_failed, g_failed == 0 ? "OMEGA_GPU_ATTENTION_SPLIT_TIMING_PASS" : "OMEGA_GPU_ATTENTION_SPLIT_TIMING_FAIL"); fclose(out); } + return 0; +} + +static int timing(const char *out_path) { + FILE *out = out_path ? fopen(out_path, "w") : NULL; + if (out_path && !out) { printf("cannot open %s\n", out_path); return 2; } + enum { N = 100 }; + const uint32_t hd = 64, nqh = 32, nkv = 4, seq = 2048; + const char *name = "gqa_f32_tinyllama_32q4kv_ctx2048"; + if (out) fprintf(out, "{\"schema\":\"OMEGA_GPU_ATTENTION_TIMING_V1\",\"gate_median_ms\":3.0,\"calls\":%d,\"cases\":[", N); + uint32_t seed = 0xfb1c004bu; + size_t n = (size_t)nqh * hd, nkvs = (size_t)seq * nkv * hd; + float *q = malloc(n * 4), *kc = malloc(nkvs * 4), *vc = malloc(nkvs * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + for (size_t i = 0; i < nkvs; i++) { kc[i] = frand(&seed, -1.0f, 1.0f); vc[i] = frand(&seed, -1.0f, 1.0f); } + oracle_gqa(q, kc, vc, seq, nqh, nkv, hd, want); + double samples[N]; int ok_calls = 0; size_t bad_total = 0; double worst = 0; uint64_t chip_sum = 0; int rc_last = 0; + OmegaGpuAttnInfo info; + /* warm-up: the first call opens the device and generates the kernel (not timed) */ + int rc0 = omega_gpu_gqa_attention_f32(q, kc, vc, seq, nqh, nkv, hd, got, &info); + double first_ms = info.call_ns / 1e6; + CHECK(rc0 == OMEGA_GPU_ATTN_OK, "%s first call rc=%s err=\"%s\"", name, omega_gpu_attention_rc_name(rc0), omega_gpu_attention_last_error()); + for (int i = 0; i < N; i++) { + double t0 = now_ms(); + int rc = omega_gpu_gqa_attention_f32(q, kc, vc, seq, nqh, nkv, hd, got, &info); + samples[i] = now_ms() - t0; + double w; size_t bad = compare(got, want, n, 2e-4, 2e-5, &w); + if (w > worst) worst = w; + bad_total += bad; chip_sum += info.elapsed_ns; rc_last = rc; + if (rc == OMEGA_GPU_ATTN_OK && bad == 0) ok_calls++; + } + qsort(samples, N, sizeof samples[0], cmp_d); + double median = samples[N / 2], p90 = samples[N * 9 / 10], mn = samples[0], mx = samples[N - 1]; + uint32_t opens = omega_gpu_session_open_count(); + int pass = ok_calls == N && bad_total == 0 && median < 3.0 && opens == 1; + CHECK(pass, "timing %s ok_calls=%d/%d violations=%zu median_ms=%.3f opens=%u last_rc=%s err=\"%s\"", name, ok_calls, N, bad_total, median, opens, omega_gpu_attention_rc_name(rc_last), omega_gpu_attention_last_error()); + printf("%s timing %s first_call_ms=%.3f ok_calls=%d/%d violations=%zu worst_scaled_err=%g median_ms=%.3f p90_ms=%.3f min_ms=%.3f max_ms=%.3f chip_us_mean=%.1f device_opens=%u\n", + pass ? "PASS" : "FAIL", name, first_ms, ok_calls, N, bad_total, worst, median, p90, mn, mx, chip_sum / 1e3 / N, opens); + if (out) fprintf(out, "{\"case\":\"%s\",\"first_call_ms\":%.3f,\"ok_calls\":%d,\"violations\":%zu,\"worst_scaled_err\":%g,\"median_ms\":%.4f,\"p90_ms\":%.4f,\"min_ms\":%.4f,\"max_ms\":%.4f,\"chip_us_mean\":%.1f,\"device_opens\":%u,\"pass\":%s}", + name, first_ms, ok_calls, bad_total, worst, median, p90, mn, mx, chip_sum / 1e3 / N, opens, pass ? "true" : "false"); + free(q); free(kc); free(vc); free(got); free(want); + if (out) { fprintf(out, "],\"checks\":%d,\"failed\":%d,\"verdict\":\"%s\"}\n", g_checks, g_failed, g_failed == 0 ? "OMEGA_GPU_ATTENTION_TIMING_PASS" : "OMEGA_GPU_ATTENTION_TIMING_FAIL"); fclose(out); } + return 0; +} + +/* ------------------------------------------------ head-scaling sweep (attention hardening cut) + * `--sweep [--out sweep.json]`: the production paged bf16 path at head_dim 64 over query-head + * counts 1, 2, 4, 8, 16, 24, 32, 64 and every divisor as the kv-head count, at context 256 + * (latency) and 2048 (bandwidth), block size 16, scattered block ids. Points whose GQA ratio + * is not a power of two are mathematically legal (the generic contract allows them) but + * outside the current kernel envelope (codegen selects the kv head with a shift): they are + * called anyway, must be refused with BAD_ARGS, and are recorded as + * "unsupported_by_kernel_envelope" (no chip time). Every supported point is checked against + * the host oracle on its first call, then warmed and timed over N calls (median / p90 of the + * whole call and of the chip kernel time). Gates: parity, no unwritten word, one device open, + * every call OK; the timings are evidence, not a threshold. Only quantities the stack measures + * are recorded; SM occupancy, bandwidth utilisation and cache hit rates are not observable + * through this path and are reported as unavailable. Under --sim the timings are host-simulator + * timings and the receipt says so. */ +static int sweep(const char *out_path) { + FILE *out = out_path ? fopen(out_path, "w") : NULL; + if (out_path && !out) { printf("cannot open %s\n", out_path); return 2; } + const int N = g_sim_mode ? 1 : 20; + const uint32_t hd = 64, bs = 16, layers = 1, layer = 0; + static const uint32_t qheads[8] = { 1, 2, 4, 8, 16, 24, 32, 64 }; + static const uint32_t ctxs[2] = { 256, 2048 }; + uint32_t seed = 0xfb1c05eeu; + if (out) fprintf(out, "{\"schema\":\"OMEGA_GPU_ATTENTION_SWEEP_V1\",\"path\":\"paged_bf16\",\"head_dim\":%u,\"block_size\":%u,\"timed_calls\":%d,\"host_simulator\":%s," + "\"tolerances\":{\"rel\":2e-4,\"abs\":2e-5},\"hardware_counters\":\"unavailable (SM occupancy, bandwidth utilisation, cache hit rates are not observable through this path)\",\"points\":[", + hd, bs, N, g_sim_mode ? "true" : "false"); + int npoints = 0, supported = 0, unsupported = 0; + double *samples = malloc((size_t)N * sizeof *samples), *ksamples = malloc((size_t)N * sizeof *ksamples); + for (int qi = 0; qi < 8; qi++) for (uint32_t nkv = 1; nkv <= qheads[qi]; nkv++) { + uint32_t nqh = qheads[qi]; + if (nqh % nkv) continue; + uint32_t ratio = nqh / nkv; int pow2 = (ratio & (ratio - 1)) == 0; + for (int ci = 0; ci < 2; ci++) { + uint32_t ctx = ctxs[ci], nblk = (ctx + bs - 1) / bs, pool_blocks = nblk + 5; + OmegaGpuKvLayout ly = layout_for(pool_blocks, bs, layers, nkv, hd); + uint8_t *pool = malloc(ly.pool_bytes); uint16_t *pw = (uint16_t *)pool; + for (size_t i = 0; i < ly.pool_bytes / 2; i++) pw[i] = f2bf(frand(&seed, -1.0f, 1.0f)); + uint32_t *ids = malloc(nblk * 4); + for (uint32_t b = 0; b < nblk; b++) ids[b] = (b * 7 + 3) % pool_blocks; + size_t n = (size_t)nqh * hd; + float *q = malloc(n * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = frand(&seed, -1.0f, 1.0f); + OmegaGpuAttnInfo info; memset(&info, 0, sizeof info); + int rc = omega_gpu_paged_attention_bf16(q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv, hd, got, &info); + const char *klass; int pass; size_t bad = 0; double worst = 0; int ok_calls = 0; uint32_t unwritten = 0, cache_hits = 0; double med = 0, p90 = 0, kmed = 0, kp90 = 0; + if (!pow2) { + klass = "unsupported_by_kernel_envelope"; + pass = rc == OMEGA_GPU_ATTN_BAD_ARGS; unsupported++; + CHECK(pass, "sweep %uq/%ukv ctx %u: ratio %u (not a power of two) refused with BAD_ARGS (got %s)", nqh, nkv, ctx, ratio, omega_gpu_attention_rc_name(rc)); + } else { + klass = "supported"; supported++; + oracle_paged(q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv, hd, want); + bad = compare(got, want, n, 2e-4, 2e-5, &worst); + unwritten = info.unwritten_words; + uint64_t kv_staged = info.kv_bytes_staged, kv_naive = info.kv_bytes_naive, qb = info.q_bytes, tb = info.tab_bytes, ob = info.out_bytes; + uint32_t launches = info.chip_calls, ctas = info.ctas_last_launch, blk_l = info.kv_blocks_logical, blk_u = info.kv_blocks_unique, kv_src = info.kv_source; + for (int i = 0; i < N; i++) { + OmegaGpuAttnInfo ti; + int trc = omega_gpu_paged_attention_bf16(q, pool, &ly, ids, nblk, ctx, layer, nqh, nkv, hd, got, &ti); + samples[i] = ti.call_ns / 1e6; ksamples[i] = ti.elapsed_ns / 1e6; + double w; size_t b2 = compare(got, want, n, 2e-4, 2e-5, &w); + if (w > worst) worst = w; + bad += b2; unwritten += ti.unwritten_words; cache_hits += ti.kernel_cache_hit; + if (trc == OMEGA_GPU_ATTN_OK && b2 == 0) ok_calls++; + } + qsort(samples, (size_t)N, sizeof samples[0], cmp_d); qsort(ksamples, (size_t)N, sizeof ksamples[0], cmp_d); + med = samples[N / 2]; p90 = samples[N * 9 / 10]; kmed = ksamples[N / 2]; kp90 = ksamples[N * 9 / 10]; + pass = rc == OMEGA_GPU_ATTN_OK && bad == 0 && ok_calls == N && unwritten == 0 && cache_hits == (uint32_t)N; + CHECK(pass, "sweep %uq/%ukv ctx %u: rc=%s violations=%zu ok_calls=%d/%d unwritten=%u cache_hits=%u", nqh, nkv, ctx, omega_gpu_attention_rc_name(rc), bad, ok_calls, N, unwritten, cache_hits); + printf("%s sweep %2uq/%2ukv ratio %2u ctx %4u: launches=%u ctas=%u call_ms med=%.3f p90=%.3f kernel_ms med=%.3f p90=%.3f kv_staged=%" PRIu64 " (naive %" PRIu64 ") blocks=%u/%u q=%" PRIu64 " tab=%" PRIu64 " out=%" PRIu64 " worst=%g\n", + pass ? "PASS" : "FAIL", nqh, nkv, ratio, ctx, launches, ctas, med, p90, kmed, kp90, kv_staged, kv_naive, blk_u, blk_l, qb, tb, ob, worst); + if (out) fprintf(out, "%s{\"q_heads\":%u,\"kv_heads\":%u,\"gqa_ratio\":%u,\"head_dim\":%u,\"context\":%u,\"q_width\":%zu,\"out_width\":%zu,\"class\":\"%s\",\"rc\":\"%s\",\"pass\":%s," + "\"violations\":%zu,\"worst_scaled_err\":%g,\"unwritten_words\":%u,\"launches_per_call\":%u,\"ctas_last_launch\":%u,\"threads_per_cta\":%u," + "\"call_ms_median\":%.4f,\"call_ms_p90\":%.4f,\"kernel_ms_median\":%.4f,\"kernel_ms_p90\":%.4f,\"kernel_cache_hits\":%u,\"first_call_cache_hit\":%s," + "\"kv_bytes_staged\":%" PRIu64 ",\"kv_bytes_naive\":%" PRIu64 ",\"kv_blocks_logical\":%u,\"kv_blocks_unique\":%u,\"q_bytes\":%" PRIu64 ",\"tab_bytes\":%" PRIu64 ",\"out_bytes\":%" PRIu64 ",\"kv_source\":\"%s\"}", + npoints ? "," : "", nqh, nkv, ratio, hd, ctx, n, n, klass, omega_gpu_attention_rc_name(rc), pass ? "true" : "false", bad, worst, unwritten, launches, ctas, info.threads_per_cta, + med, p90, kmed, kp90, cache_hits, info.kernel_cache_hit ? "true" : "false", kv_staged, kv_naive, blk_l, blk_u, qb, tb, ob, kv_src == OMEGA_GPU_ATTN_KV_STAGED ? "staged" : "resident"); + npoints++; + } + if (!pow2) { + printf("%s sweep %2uq/%2ukv ratio %2u ctx %4u: %s (rc=%s)\n", pass ? "PASS" : "FAIL", nqh, nkv, ratio, ctx, klass, omega_gpu_attention_rc_name(rc)); + if (out) fprintf(out, "%s{\"q_heads\":%u,\"kv_heads\":%u,\"gqa_ratio\":%u,\"head_dim\":%u,\"context\":%u,\"q_width\":%zu,\"out_width\":%zu,\"class\":\"%s\",\"rc\":\"%s\",\"pass\":%s}", + npoints ? "," : "", nqh, nkv, ratio, hd, ctx, n, n, klass, omega_gpu_attention_rc_name(rc), pass ? "true" : "false"); + npoints++; + } + free(pool); free(ids); free(q); free(got); free(want); + } + } + free(samples); free(ksamples); + uint32_t opens = omega_gpu_session_open_count(); + CHECK(opens == (g_sim_mode ? 0u : 1u), "sweep: device opened %s (opens=%u)", g_sim_mode ? "never (simulator)" : "once", opens); + printf("sweep: %d points (%d supported, %d unsupported by the kernel envelope), device_opens=%u\n", npoints, supported, unsupported, opens); + if (out) { fprintf(out, "],\"points_total\":%d,\"points_supported\":%d,\"points_unsupported\":%d,\"device_opens\":%u,\"checks\":%d,\"failed\":%d,\"verdict\":\"%s\"}\n", npoints, supported, unsupported, opens, g_checks, g_failed, g_failed == 0 ? "OMEGA_GPU_ATTENTION_SWEEP_PASS" : "OMEGA_GPU_ATTENTION_SWEEP_FAIL"); fclose(out); } + return 0; +} + +/* ------------------------------------------------------------ warp simulator (omega #308) + * The per-thread simulator above has no model of a warp (its SHFL rule is "one path across the + * warp or error 7"). With --divergent the kernel carries a real lane-dependent branch inside a + * BSSY/BSYNC region, and every launch runs through tests/bw_warp_sim.h instead: 32-lane + * fragments, barrier registers, SHFL/BAR participation. Each launch runs in both fragment + * orders and the two outputs must be bit-identical. */ +static uint64_t g_ws_issues, g_ws_launches; +static int ws_attn_launch(const void *progv, const OmegaGpuAttnLaunch *L, OmegaGpuAttnInfo *info) { + const BlackwellIRProgram *p = progv; + uint32_t *outw = L->out; size_t nw = L->out_bytes / 4; + uint32_t *copy = malloc(L->out_bytes); + int err = 0; char msg[240] = ""; + for (int order = 0; order < 2 && !err && copy; order++) { + WsSim s; memset(&s, 0, sizeof s); + s.p = p; s.threads = SIM_T; s.smem = sim_shared; s.smem_bytes = SIM_SMEM; s.order = order; + uint64_t qa = (uintptr_t)L->q, pa = (uintptr_t)L->pool, oa = (uintptr_t)L->out, ta = (uintptr_t)L->tab; + s.cbank[0x380 / 4] = (uint32_t)qa; s.cbank[0x380 / 4 + 1] = (uint32_t)(qa >> 32); + s.cbank[0x388 / 4] = (uint32_t)pa; s.cbank[0x388 / 4 + 1] = (uint32_t)(pa >> 32); + s.cbank[0x390 / 4] = (uint32_t)oa; s.cbank[0x390 / 4 + 1] = (uint32_t)(oa >> 32); + s.cbank[0x398 / 4] = (uint32_t)ta; s.cbank[0x398 / 4 + 1] = (uint32_t)(ta >> 32); + memcpy(&s.cbank[0x3a0 / 4], L->params, sizeof L->params); + for (size_t i = 0; i < nw; i++) outw[i] = 0xffbadbadu; + err = ws_run(&s, L->grid_x, L->grid_y); + if (err) { snprintf(msg, sizeof msg, "order %d: %s", order, s.msg); break; } + g_ws_issues += s.warp_issues; + if (order == 0) memcpy(copy, outw, L->out_bytes); + else if (memcmp(copy, outw, L->out_bytes) != 0) { err = -1; snprintf(msg, sizeof msg, "the fragment order changed the result"); } + } + free(copy); + g_ws_launches++; + uint32_t unwritten = 0; for (size_t i = 0; i < nw; i++) if (outw[i] == 0xffbadbadu) unwritten++; + if (info) { info->chip_calls++; info->unwritten_words += unwritten; info->ctas_last_launch = L->grid_x * L->grid_y; info->threads_per_cta = SIM_T; } + if (err) { printf("warp simulator error: %s\n", msg); return OMEGA_GPU_ATTN_CHIP_FAIL; } + return unwritten ? OMEGA_GPU_ATTN_UNWRITTEN : OMEGA_GPU_ATTN_OK; +} +/* Negative control for --divergent --sim: mode 2 builds the same kernel with the BSYNC dropped; + * the warp simulator must reject it (the whole point of the simulator: the old one could not). */ +static void divergent_negative_control(void) { + enum { SEQ = 65, NQH = 8, NKV = 2 }; + const uint32_t HD = g_hd; + float *q = malloc(NQH * HD * 4), *kv = malloc((size_t)SEQ * NKV * HD * 4), *out = malloc(NQH * HD * 4); + uint32_t seed = 0x308u; + for (uint32_t i = 0; i < NQH * HD; i++) q[i] = frand(&seed, -1.0f, 1.0f); + for (size_t i = 0; i < (size_t)SEQ * NKV * HD; i++) kv[i] = frand(&seed, -1.0f, 1.0f); + omega_gpu_attention_test_set_divergent(2); + int rc = omega_gpu_gqa_attention_f32(q, kv, kv, SEQ, NQH, NKV, HD, out, NULL); + omega_gpu_attention_test_set_divergent(1); + CHECK(rc == OMEGA_GPU_ATTN_CHIP_FAIL, "divergent mode 2 (BSYNC dropped) rejected by the warp simulator (rc %s)", omega_gpu_attention_rc_name(rc)); + int rc1 = omega_gpu_gqa_attention_f32(q, kv, kv, SEQ, NQH, NKV, HD, out, NULL); + CHECK(rc1 == OMEGA_GPU_ATTN_OK, "divergent mode 1 (regioned branch) runs clean on the same input (rc %s)", omega_gpu_attention_rc_name(rc1)); + free(q); free(kv); free(out); +} + +/* ------------------------------------------------------------ head_dim 128 (CPU phase) + * Checks that need the public API only, so the same code runs on the host simulators now and on + * the chip in the coordinated window. Run with --hd 128 (--sim for the host simulators). + * They target what head_dim 128 changed: four warps per CTA, so the chunk max and the chunk sum + * each combine FOUR warp partials (lane 0 of warps 0..3), and 128-token chunks. + * (a) uniform scores (K = 0): every weight is 1, the output is the mean of V over the context; + * a sum that drops the partial of warp 2 or 3 gives about twice the mean; + * (b) one dominant token with a score above the f32 exponent range (EX2 overflows without the + * right running max): the token sits in each of the four warps of chunk 0 and in the later, + * partial chunks; a max that ignores warp 2 or 3 overflows to inf / NaN. + * Negative controls: the comparison rejects the answer of a different token, and a shared-memory + * declaration of 1024 bytes (the head_dim 64 size) is refused by the simulators. */ +static void hd128_checks(void) { + const uint32_t hd = 128, nqh = 8, nkv = 2, seq = 300; + uint32_t seed = 0x128u; + size_t n = (size_t)nqh * hd, nkvs = (size_t)seq * nkv * hd; + float *q = malloc(n * 4), *kc = malloc(nkvs * 4), *vc = malloc(nkvs * 4), *got = malloc(n * 4), *want = malloc(n * 4); + for (size_t i = 0; i < n; i++) q[i] = 1.0f; + for (size_t i = 0; i < nkvs; i++) vc[i] = frand(&seed, -1.0f, 1.0f); + OmegaGpuAttnInfo info; + /* (a) uniform */ + memset(kc, 0, nkvs * 4); + oracle_gqa(q, kc, vc, seq, nqh, nkv, hd, want); + int rc = omega_gpu_gqa_attention_f32(q, kc, vc, seq, nqh, nkv, hd, got, &info); + double w; size_t bad = compare(got, want, n, 2e-4, 2e-5, &w); + CHECK(rc == OMEGA_GPU_ATTN_OK && bad == 0 && info.threads_per_cta == 128, "hd128 uniform scores: mean of V over 300 tokens (rc %s, %zu bad, worst %g, %u threads)", omega_gpu_attention_rc_name(rc), bad, w, info.threads_per_cta); + float *half = malloc(n * 4); for (size_t i = 0; i < n; i++) half[i] = want[i] * 0.5f; + size_t neg = compare(got, half, n, 2e-4, 2e-5, &w); + CHECK(neg > n / 2, "hd128 uniform negative control: a result with the sum of two warps dropped (half the mean) is flagged (%zu of %zu)", neg, n); + free(half); + /* (b) one dominant token */ + static const uint32_t pos[] = { 5, 40, 70, 100, 127, 128 + 3, 256 + 43 }; + int all_ok = 1; size_t worst_bad = 0; + for (size_t pi = 0; pi < sizeof pos / sizeof pos[0]; pi++) { + memset(kc, 0, nkvs * 4); + for (uint32_t kvh = 0; kvh < nkv; kvh++) for (uint32_t d = 0; d < hd; d++) kc[((size_t)pos[pi] * nkv + kvh) * hd + d] = 12.0f; /* dot 1536, scaled by log2e / sqrt(128): about 2^196 */ + oracle_gqa(q, kc, vc, seq, nqh, nkv, hd, want); + rc = omega_gpu_gqa_attention_f32(q, kc, vc, seq, nqh, nkv, hd, got, &info); + bad = compare(got, want, n, 2e-4, 2e-5, &w); + if (rc != OMEGA_GPU_ATTN_OK || bad) { all_ok = 0; if (bad > worst_bad) worst_bad = bad; } + printf(" hd128 dominant token %u (warp %u of chunk %u): rc %s, %zu bad, worst %g\n", pos[pi], (pos[pi] % 128) / 32, pos[pi] / 128, omega_gpu_attention_rc_name(rc), bad, w); + if (pi == 0) { + /* negative control: the answer of token 6 instead of token 5 must be flagged */ + float *other = malloc(n * 4); + for (uint32_t h = 0; h < nqh; h++) for (uint32_t d = 0; d < hd; d++) other[h * hd + d] = vc[((size_t)6 * nkv + h / (nqh / nkv)) * hd + d]; + size_t negb = compare(got, other, n, 2e-4, 2e-5, &w); + CHECK(negb > n / 2, "hd128 dominant-token negative control: the neighbouring token's V is flagged (%zu of %zu)", negb, n); + free(other); + } + } + CHECK(all_ok, "hd128 dominant token in every warp and chunk: exact max/sum over four warp partials (worst bad %zu)", worst_bad); + /* a kernel that needs 2048 bytes of shared memory must not run in a 1024-byte declaration (simulators only: they bound shared accesses) */ + if (g_sim_mode) { + g_smem_cap = 1024; + rc = omega_gpu_gqa_attention_f32(q, kc, vc, seq, nqh, nkv, hd, got, NULL); + g_smem_cap = 0; + CHECK(rc == OMEGA_GPU_ATTN_CHIP_FAIL, "hd128 kernel refused under a 1024-byte shared-memory declaration (rc %s)", omega_gpu_attention_rc_name(rc)); + rc = omega_gpu_gqa_attention_f32(q, kc, vc, seq, nqh, nkv, hd, got, NULL); + CHECK(rc == OMEGA_GPU_ATTN_OK, "hd128 kernel runs under the 2048-byte declaration (rc %s)", omega_gpu_attention_rc_name(rc)); + } + free(q); free(kc); free(vc); free(got); free(want); +} + +/* head_dim 64 byte-identity pin and head_dim 128 codegen facts (CPU only, no device, no simulator). + * The digests are SHA-256 of the encoded kernel bytes as emitted by the batched-load program of 2026-10-12 + * (speed/attention-batched-loads; before it, main c0369e6 was pinned at 160 instructions); any change to the head_dim 64 program changes a digest and fails here. */ +typedef struct { bool f32; uint32_t log2bs, log2gqa; size_t insns; const char *sha256; } Pin; +static const Pin k_pins64[] = { + { false, 4, 3, 216, "44d27fae78ea21ee77fd7a0ebd2ebfcac52e9e45a81de84b035868092e13e424" }, + { false, 4, 2, 216, "3bc79d4a54fd0d82024b376dfdb718e8326431917251f13f5c44be6ba8eb6f0c" }, + { false, 4, 0, 216, "83eca9872e32c17321d2f8ec6a6ec92638ed72b136d8958cda5cdfc451c01ef8" }, + { true, 12, 3, 184, "b6a25d8739185bbd944bfcc1ec174abb24ce46529f06c56f8d5ac77bf6883ddd" }, + { true, 12, 2, 184, "46a2b82ebcb55237f4a7585679b42ac9558c7a434e8e80ccef6cc0bfaed8fcb9" }, + { true, 12, 0, 184, "970db9533c836eca7c86783875a2ad898cd69bc3070cae418cc92b3ce2dbbd9c" }, +}; +static void hex_digest(const uint8_t d[32], char out[65]) { for (int i = 0; i < 32; i++) snprintf(out + 2 * i, 3, "%02x", d[i]); } +static void hd_codegen_checks(void) { + char hex[65]; + for (size_t i = 0; i < sizeof k_pins64 / sizeof k_pins64[0]; i++) { + const Pin *p = &k_pins64[i]; + OmegaBlackwellKernel k; memset(&k, 0, sizeof k); + int rc = omega_gpu_attention_codegen_hd(p->f32, p->log2bs, p->log2gqa, 64, &k); + hex_digest(k.code_digest, hex); + CHECK(rc == OMEGA_GPU_ATTN_OK && k.insn_count == p->insns && strcmp(hex, p->sha256) == 0, "hd64 %s log2bs %u log2gqa %u: encoded kernel is byte-identical to the pinned program (%zu insns, sha256 %s)", p->f32 ? "f32 " : "bf16", p->log2bs, p->log2gqa, k.insn_count, hex); + free(k.code); + /* the 4-argument entry point is the same kernel */ + OmegaBlackwellKernel k4; memset(&k4, 0, sizeof k4); + CHECK(omega_gpu_attention_codegen(p->f32, p->log2bs, p->log2gqa, &k4) == OMEGA_GPU_ATTN_OK && memcmp(k4.code_digest, k.code_digest, 32) == 0, "hd64 4-argument codegen entry is the same kernel"); + free(k4.code); + /* head_dim 128: encodes, inside the register budget, a different (longer) program */ + OmegaBlackwellKernel k2; memset(&k2, 0, sizeof k2); + int rc2 = omega_gpu_attention_codegen_hd(p->f32, p->log2bs, p->log2gqa, 128, &k2); + CHECK(rc2 == OMEGA_GPU_ATTN_OK && k2.code_size > 0 && k2.gpr_count <= 96 /* AT_GPR_BUDGET; cut K: the four-head kernel peaks at 84 */ && k2.insn_count > p->insns && memcmp(k2.code_digest, k.code_digest, 32) != 0, + "hd128 %s log2bs %u log2gqa %u: kernel encodes (%zu insns vs %zu, %u gprs)", p->f32 ? "f32 " : "bf16", p->log2bs, p->log2gqa, k2.insn_count, p->insns, k2.gpr_count); + free(k2.code); + } + OmegaBlackwellKernel kx; memset(&kx, 0, sizeof kx); + CHECK(omega_gpu_attention_codegen_hd(false, 4, 3, 96, &kx) == OMEGA_GPU_ATTN_TOO_LARGE, "codegen refuses head_dim 96"); + CHECK(omega_gpu_attention_codegen_hd(false, 4, 3, 256, &kx) == OMEGA_GPU_ATTN_TOO_LARGE, "codegen refuses head_dim 256"); + /* negative control for the pin itself: a one-bit change to a pinned digest must not match */ + OmegaBlackwellKernel kn; memset(&kn, 0, sizeof kn); + (void)omega_gpu_attention_codegen_hd(k_pins64[0].f32, k_pins64[0].log2bs, k_pins64[0].log2gqa, 64, &kn); + kn.code_digest[0] ^= 1u; hex_digest(kn.code_digest, hex); + CHECK(strcmp(hex, k_pins64[0].sha256) != 0, "pin negative control: a flipped digest bit does not match the pin"); + free(kn.code); +} + + +int main(int argc, char **argv) { + const char *out_path = NULL; int host = 0, sim = 0, timing_mode = 0, sweep_mode = 0, split_timing_mode = 0; + uint32_t spin_us = 0; + for (int i = 1; i < argc; i++) { + if (strcmp(argv[i], "--host-only") == 0) host = 1; + else if (strcmp(argv[i], "--sim") == 0) sim = 1; + else if (strcmp(argv[i], "--divergent") == 0) g_divergent = 1; + else if (strcmp(argv[i], "--timing") == 0) timing_mode = 1; + else if (strcmp(argv[i], "--split-timing") == 0) split_timing_mode = 1; + else if (strcmp(argv[i], "--sweep") == 0) sweep_mode = 1; + else if (strcmp(argv[i], "--hd") == 0 && i + 1 < argc) g_hd = (uint32_t)atoi(argv[++i]); + else if (strcmp(argv[i], "--spin-us") == 0 && i + 1 < argc) spin_us = (uint32_t)atoi(argv[++i]); + else if (strcmp(argv[i], "--out") == 0 && i + 1 < argc) out_path = argv[++i]; + } + if (g_hd != 64 && g_hd != 128) { printf("--hd must be 64 or 128\n"); return 2; } + if (g_hd == 128 && (timing_mode || sweep_mode)) { printf("--hd 128 supports the battery, --split-timing and --host-only (timing and sweep are head_dim 64 only)\n"); return 2; } + if (spin_us && omega_gpu_session_set_spin_us(spin_us) != 0) { printf("--spin-us %u refused\n", spin_us); return 2; } + if (g_divergent) omega_gpu_attention_test_set_divergent(1); + if (sim) { g_sim_mode = 1; omega_gpu_attention_test_set_simulator(g_divergent ? ws_attn_launch : sim_launch); } + if (sim && g_divergent && !host) divergent_negative_control(); + if (host) { host_only(); hd_codegen_checks(); } + else if (split_timing_mode) { if (split_timing(out_path) != 0) return 2; } + else if (timing_mode) { if (timing(out_path) != 0) return 2; } + else if (sweep_mode) { if (sweep(out_path) != 0) return 2; } + else { if (chip(out_path) != 0) return 2; if (g_hd == 128) hd128_checks(); } + printf("%s: %d checks, %d failed\n", g_failed ? "FAIL" : "PASS", g_checks, g_failed); + return g_failed ? 1 : 0; +} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.c b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.c new file mode 100644 index 000000000..d9d56b121 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.c @@ -0,0 +1,1436 @@ +/* omega_gpu_attention_api.c: FB-1 cut 5 (2026-10-04). See the header. + * + * Layout: (1) kernel codegen on the BlackwellIR with the serialising scheduler + * of cut 4 (every instruction waits on everything still pending; slow and safe), + * extended with forward branches and more loops; (2) the launcher, cloned from + * cut 4's run_abc with a fourth buffer (block tables and context lengths), 16 + * argument words, and cut 1b's shader-cache invalidate; (3) the public entry + * points, which stage the referenced KV blocks per launch and apply the oracle's + * argument rules (dropped tokens past the table, negative table entries, zero + * context) on the host. + * + * One CTA per (query head, sequence), head_dim threads (64 or 128; the text below says 64, the + * constants scale with KSpec.hd). The context is walked in chunks of head_dim tokens: + * phase A thread t owns token base+t: block lookup, K dot q (f32 FFMA), s = dot * scale + * (scale folds 1/sqrt(d) and log2 e), s and the token's byte offset go to shared; + * reduce chunk max (SHFL.DOWN tree per warp, lane partials to shared, BAR.SYNC, 2 LDS), + * m_new = max(m, chunk max), alpha = EX2(m - m_new), p = EX2(s - m_new) to shared, + * chunk sum the same way, l = l * alpha + chunk sum; + * phase B thread d owns dimension d: acc = acc * alpha + sum over the chunk of p_t * V[t][d]. + * Then out[d] = acc * RCP(l). The first chunk sees m = -inf, so alpha = EX2(-inf) = 0 and + * the initial l and acc drop out (PTX ISA ex2.approx: ex2(-Inf) = +0). + * + * Shared memory (16 * head_dim bytes; hd 64: 1024 bytes, the QMD default): [0,4hd) q, [4hd,8hd) s then p, + * [8hd,12hd) token byte offsets, [12hd,16hd) warp partials for the reductions (hd 64: 0, 256, 512, + * 768; hd 128: 0, 512, 1024, 1536; the partials of warp w are read at 12hd + 128w). + */ +#include "omega_gpu_attention_api.h" +#include "omega_blackwell_codegen.h" +#include "omega_bw_reconv.h" +#include "omega_blackwell_qmd.h" +#include "omega_blackwell_submit.h" +#include "omega_gpu_session.h" +#include "omega_gpu_fmt.h" +#include "sha256.h" +#ifdef OMEGA_ATTN_DEBUG +#include /* the debug trace only; never in the freestanding build */ +#endif +#include + +/* ------------------------------------------------------------------ codegen */ + +#define CW(stall, wbar, rbar, wait) \ + (((uint32_t)(stall) << 9) | ((uint32_t)(wbar) << 14) | ((uint32_t)(rbar) << 17) | ((uint32_t)(wait) << 20)) +#define CW_YIELD 0x2000u +#define SB_NONE 7u +#define SB_GPR 0u +#define SB_RD 1u +#define SB_UGPR 2u +#define SB_LD2 4u /* second scoreboard for batched loads (the matmul kernel's B-load word, omega #328) */ +#define SB_LD3 3u /* third: phase B keeps shared loads and the two halves of the V loads on separate scoreboards */ +#define AT_BATCH_MAX 4 /* loads in flight per scoreboard: 4 complete on the chip, 8 never did (omega #328) */ + +enum { K_FIXED, K_PRED, K_VAR, K_UVAR, K_STORE, K_SYNC, K_EXIT, K_BRA, K_BSSY, K_BSYNC }; + +#define AT_MAX_LOOPS 8 +typedef struct { + BlackwellIRProgram *p; + uint32_t pending; + uint32_t batch; /* scoreboards the open load batch is filling (no wait on them inside the batch) */ + int batch_n[8]; /* loads issued per scoreboard in the open batch */ + int err; + int loop_start[AT_MAX_LOOPS], loop_end[AT_MAX_LOOPS]; + int n_loops, depth, stack[AT_MAX_LOOPS]; + BwRegions rg; /* structured reconvergence regions (omega #308) */ + int rg_mutant; /* test only: 1 = drop the BSYNC at join (the 2026-10-04 bug shape; host sim must catch it) */ +} Em; + +static void emit(Em *e, BlackwellIRInsn in, int kind) { + uint32_t wait = e->pending; + e->batch = 0; memset(e->batch_n, 0, sizeof e->batch_n); /* an ordinary instruction waits on the whole batch */ + switch (kind) { + case K_FIXED: in.control = CW(6, SB_NONE, SB_NONE, wait); e->pending = 0; break; + case K_PRED: in.control = CW(13, SB_NONE, SB_NONE, wait); e->pending = 0; break; + case K_VAR: in.control = CW(4, SB_GPR, SB_NONE, wait) | CW_YIELD; e->pending = 1u << SB_GPR; break; + case K_UVAR: in.control = CW(4, SB_UGPR, SB_NONE, wait) | CW_YIELD; e->pending = 1u << SB_UGPR; break; + case K_STORE: in.control = CW(4, SB_NONE, SB_RD, wait) | CW_YIELD; e->pending = 1u << SB_RD; break; + case K_SYNC: in.control = CW(6, SB_NONE, SB_NONE, wait); e->pending = 0; break; + case K_EXIT: in.control = CW(5, SB_NONE, SB_NONE, wait); e->pending = in.predicate_p0 ? wait : 0; break; + case K_BRA: in.control = CW(5, SB_NONE, SB_NONE, wait); e->pending = in.predicate_p0 ? wait : 0; break; + /* stall counts as nvcc 13.0.88 writes them for sm_121 (see src/omega_gpu_elementwise_api.c) */ + case K_BSSY: in.control = CW(1, SB_NONE, SB_NONE, wait) | CW_YIELD; e->pending = 0; break; + case K_BSYNC: in.control = CW(5, SB_NONE, SB_NONE, wait) | CW_YIELD; e->pending = 0; break; + default: e->err = -1; return; + } + if (omega_bw_ir_append(e->p, &in) < 0) e->err = -1; +} + +static int V(Em *e) { int v = omega_bw_ir_alloc_vreg(e->p); if (v < 0) e->err = -1; return v; } +static int V64(Em *e) { int v = omega_bw_ir_alloc_vreg64(e->p); if (v < 0) e->err = -1; return v; } +static int V128(Em *e) { int v = omega_bw_ir_alloc_vreg128(e->p); if (v < 0) e->err = -1; return v; } +static int UV64(Em *e) { int v = omega_bw_ir_alloc_uvreg64(e->p); if (v < 0) e->err = -1; return v; } +static int here(const Em *e) { return (int)e->p->count; } + +#define NOREG -1 +static BlackwellIRInsn I0(BlackwellIROpcode op) { + BlackwellIRInsn in; memset(&in, 0, sizeof in); + in.op = op; in.dst_vreg = NOREG; in.src1_vreg = NOREG; in.src2_vreg = NOREG; in.src3_vreg = NOREG; in.ureg = NOREG; + return in; +} +static void ldcu64(Em *e, int udst, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDCU64); i.dst_vreg = udst; i.imm = off; i.is_uniform = true; emit(e, i, K_UVAR); } +static void ldc64(Em *e, int dst64, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC64); i.dst_vreg = dst64; i.imm = off; emit(e, i, K_VAR); } +static void ldc32(Em *e, int dst, uint32_t off) { BlackwellIRInsn i = I0(BW_IR_LDC); i.dst_vreg = dst; i.imm = off; emit(e, i, K_VAR); } +static void s2r(Em *e, int dst, uint32_t sr) { BlackwellIRInsn i = I0(BW_IR_S2R); i.dst_vreg = dst; i.imm = sr; emit(e, i, K_VAR); } +static void movi(Em *e, int dst, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_MOV_IMM); i.dst_vreg = dst; i.imm = imm; emit(e, i, K_FIXED); } +static void movf(Em *e, int dst, float f) { uint32_t u; memcpy(&u, &f, 4); movi(e, dst, u); } +static void movrz(Em *e, int dst) { BlackwellIRInsn i = I0(BW_IR_MOV_RZ); i.dst_vreg = dst; emit(e, i, K_FIXED); } +/* dst = a * imm + c (c may be NOREG for RZ) */ +static void imadi(Em *e, int dst, int a, uint32_t imm, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = dst; i.src1_vreg = a; i.imm = imm; i.src3_vreg = c; emit(e, i, K_FIXED); } +/* dst = a * b + c (registers; c may be NOREG) */ +static void imadr(Em *e, int dst, int a, int b, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = dst; i.src1_vreg = a; i.src2_vreg = b; i.src3_vreg = c; emit(e, i, K_FIXED); } +static void iadd3(Em *e, int dst, int a, int b) { BlackwellIRInsn i = I0(BW_IR_IADD3); i.dst_vreg = dst; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); } +static void lop3xor(Em *e, int dst, int a, int b) { BlackwellIRInsn i = I0(BW_IR_LOP3_XOR); i.dst_vreg = dst; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); } +static void lop3andi(Em *e, int dst, int a, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_LOP3_AND); i.dst_vreg = dst; i.src1_vreg = a; i.imm = imm; emit(e, i, K_FIXED); } +static void shri(Em *e, int dst, int a, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_SHF_R); i.dst_vreg = dst; i.src1_vreg = a; i.imm = imm; emit(e, i, K_FIXED); } +/* dst64 = idx * imm + base64 (byte address) */ +static void wide(Em *e, int dst64, int idx, uint32_t imm, int base64) { BlackwellIRInsn i = I0(BW_IR_IMAD_WIDE); i.dst_vreg = dst64; i.src1_vreg = idx; i.imm = imm; i.src3_vreg = base64; emit(e, i, K_FIXED); } +static void ldg(Em *e, int dst, int addr64, int udesc) { BlackwellIRInsn i = I0(BW_IR_LDG_E); i.dst_vreg = dst; i.src1_vreg = addr64; i.ureg = udesc; emit(e, i, K_VAR); } +/* Batched loads (2026-10-12, long-context finding): every load above waits on the previous one, so + * phase A paid one global latency per dim pair and phase B one per token (~6 GB/s at 1268 ctx). A + * batched load sets `sb` and waits on every pending scoreboard except the ones the open batch is + * filling (and SB_RD, its read barrier), so up to AT_BATCH_MAX loads per scoreboard are in flight. + * The next ordinary instruction (emit) waits on all of them. SB_RD covers the address register: the + * allocator may hand that register to a later load's data before this load has read it. */ +static void emit_batched(Em *e, BlackwellIRInsn in, uint32_t sb) { + if (sb >= 8 || e->batch_n[sb] >= AT_BATCH_MAX) { e->err = -1; return; } + in.control = CW(4, sb, SB_RD, e->pending & ~e->batch) | CW_YIELD; + e->batch |= (1u << sb) | (1u << SB_RD); e->batch_n[sb]++; + e->pending |= (1u << sb) | (1u << SB_RD); + if (omega_bw_ir_append(e->p, &in) < 0) e->err = -1; +} +/* A fixed-latency instruction inside an open load batch: it waits on the batch's read barrier (its + * destination may be a load's address register, which the load may read late) but not on the loads' + * data, so the address of the next load is computed while the earlier loads are in flight. Only for + * instructions that read no result of the open batch. */ +static void emit_fixed_in_batch(Em *e, BlackwellIRInsn in) { + uint32_t wait = (e->pending & ~e->batch) | (e->batch ? (1u << SB_RD) : 0u); + in.control = CW(6, SB_NONE, SB_NONE, wait); + if (omega_bw_ir_append(e->p, &in) < 0) e->err = -1; +} +static void ldg128_b(Em *e, int dst128, int addr64, uint32_t imm, int udesc, uint32_t sb) { BlackwellIRInsn i = I0(BW_IR_LDG_E_128); i.dst_vreg = dst128; i.src1_vreg = addr64; i.imm = imm; i.ureg = udesc; emit_batched(e, i, sb); } +static void ldg_b(Em *e, int dst, int addr64, int udesc, uint32_t sb) { BlackwellIRInsn i = I0(BW_IR_LDG_E); i.dst_vreg = dst; i.src1_vreg = addr64; i.ureg = udesc; emit_batched(e, i, sb); } +static void ldg16_b(Em *e, int dst, int addr64, int udesc, uint32_t sb) { BlackwellIRInsn i = I0(BW_IR_LDG_E_U16); i.dst_vreg = dst; i.src1_vreg = addr64; i.ureg = udesc; emit_batched(e, i, sb); } +static void lds128_b(Em *e, int dst128, int addr, uint32_t imm, uint32_t sb) { BlackwellIRInsn i = I0(BW_IR_LDS128); i.dst_vreg = dst128; i.src1_vreg = addr; i.imm = imm; emit_batched(e, i, sb); } +/* sub-register operands of a quad */ +static void e_ffma_s(Em *e, int d, int a, int as, int b, int bs, int c) { BlackwellIRInsn i = I0(BW_IR_FFMA); i.dst_vreg = d; i.src1_vreg = a; i.src1_subreg = (uint8_t)as; i.src2_vreg = b; i.src2_subreg = (uint8_t)bs; i.src3_vreg = c; emit(e, i, K_FIXED); } +static void imadi_s(Em *e, int dst, int a, int as, uint32_t imm, int c) { BlackwellIRInsn i = I0(BW_IR_IMAD); i.dst_vreg = dst; i.src1_vreg = a; i.src1_subreg = (uint8_t)as; i.imm = imm; i.src3_vreg = c; emit(e, i, K_FIXED); } +static void lop3andi_s(Em *e, int dst, int a, int as, uint32_t imm) { BlackwellIRInsn i = I0(BW_IR_LOP3_AND); i.dst_vreg = dst; i.src1_vreg = a; i.src1_subreg = (uint8_t)as; i.imm = imm; emit(e, i, K_FIXED); } +static void wide_s(Em *e, int dst64, int idx, int is, uint32_t imm, int base64) { BlackwellIRInsn i = I0(BW_IR_IMAD_WIDE); i.dst_vreg = dst64; i.src1_vreg = idx; i.src1_subreg = (uint8_t)is; i.imm = imm; i.src3_vreg = base64; emit(e, i, K_FIXED); } +static void wide_s_b(Em *e, int dst64, int idx, int is, uint32_t imm, int base64) { BlackwellIRInsn i = I0(BW_IR_IMAD_WIDE); i.dst_vreg = dst64; i.src1_vreg = idx; i.src1_subreg = (uint8_t)is; i.imm = imm; i.src3_vreg = base64; emit_fixed_in_batch(e, i); } +static void stg(Em *e, int addr64, int val, int udesc) { BlackwellIRInsn i = I0(BW_IR_STG_E); i.src1_vreg = addr64; i.src2_vreg = val; i.ureg = udesc; emit(e, i, K_STORE); } +static void e_fadd(Em *e, int d, int a, int b) { BlackwellIRInsn i = I0(BW_IR_FADD); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); } +static void e_fsub(Em *e, int d, int a, int b) { BlackwellIRInsn i = I0(BW_IR_FSUB); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); } +static void e_fmul(Em *e, int d, int a, int b) { BlackwellIRInsn i = I0(BW_IR_FMUL); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); } +static void e_ffma(Em *e, int d, int a, int b, int c) { BlackwellIRInsn i = I0(BW_IR_FFMA); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; i.src3_vreg = c; emit(e, i, K_FIXED); } +static void e_fmax(Em *e, int d, int a, int b) { BlackwellIRInsn i = I0(BW_IR_FMNMX_MAX); i.dst_vreg = d; i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_FIXED); } +static void mufu(Em *e, BlackwellIROpcode op, int d, int a) { BlackwellIRInsn i = I0(op); i.dst_vreg = d; i.src1_vreg = a; emit(e, i, K_VAR); } +/* SHFL and BAR.SYNC are refused inside an open reconvergence region (omega #308): on a split + * warp they read inactive lanes / count a partial warp, which is what produced wrong dims on + * the chip on 2026-10-04. The build fails closed instead. */ +static int in_region(Em *e) { if (e->rg.depth > 0) { e->err = -1; return 1; } return 0; } +static void shfl_down(Em *e, int d, int a, uint32_t off) { if (in_region(e)) return; BlackwellIRInsn i = I0(BW_IR_SHFL_DOWN); i.dst_vreg = d; i.src1_vreg = a; i.imm = off; emit(e, i, K_VAR); } +static void sts32(Em *e, int addr, int val) { BlackwellIRInsn i = I0(BW_IR_STS32); i.src1_vreg = addr; i.src2_vreg = val; emit(e, i, K_STORE); } +static void lds32(Em *e, int d, int addr) { BlackwellIRInsn i = I0(BW_IR_LDS32); i.dst_vreg = d; i.src1_vreg = addr; emit(e, i, K_VAR); } +static void bar_sync(Em *e) { if (in_region(e)) return; emit(e, I0(BW_IR_BAR_SYNC), K_SYNC); } +static void isetp_ge_u32(Em *e, int a, int b) { BlackwellIRInsn i = I0(BW_IR_ISETP_GE_U32); i.src1_vreg = a; i.src2_vreg = b; emit(e, i, K_PRED); } +static void bra_back_if_not_p0(Em *e, int target) { BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.predicate_not = true; i.imm = (uint32_t)(target - here(e)); emit(e, i, K_BRA); } +/* @P0 BRA forward; the target is patched in when known */ +static int bra_fwd_if_p0(Em *e) { int at = here(e); BlackwellIRInsn i = I0(BW_IR_BRA); i.predicate_p0 = true; i.imm = 0; emit(e, i, K_BRA); return at; } +static void patch_fwd(Em *e, int at) { if (at >= 0 && (size_t)at < e->p->count) e->p->insns[at].imm = (uint32_t)(here(e) - at); else e->err = -1; } + +/* ---- structured reconvergence regions (omega #308); same API as the elementwise emitter ---- */ +enum { RX_ALWAYS, RX_IF_P0, RX_IF_NOT_P0 }; +static int region_begin(Em *e) { + int bar = bw_regions_next_bar(&e->rg); + if (bar < 0) { e->err = -1; return -1; } + int at = here(e); + BlackwellIRInsn i = I0(BW_IR_BSSY); i.bar_reg = (uint8_t)bar; i.imm = 2; emit(e, i, K_BSSY); + if (bw_regions_begin(&e->rg, at) < 0) e->err = -1; + return bar; +} +static void region_exit(Em *e, int cond) { + int at = here(e); + BlackwellIRInsn i = I0(BW_IR_BRA); i.imm = 1; + if (cond != RX_ALWAYS) { i.predicate_p0 = true; i.predicate_not = (cond == RX_IF_NOT_P0); } + emit(e, i, K_BRA); + if (bw_regions_exit(&e->rg, at) < 0) e->err = -1; +} +static void region_join(Em *e) { + if (e->rg.depth <= 0) { e->err = -1; return; } + int d = e->rg.depth - 1, bsync = here(e); + BlackwellIRInsn i = I0(e->rg_mutant == 1 ? BW_IR_NOP : BW_IR_BSYNC); i.bar_reg = (uint8_t)d; emit(e, i, K_BSYNC); + if (e->rg_mutant == 1) { + BwRegions *r = &e->rg; r->depth--; + e->p->insns[r->bssy_at[d]].imm = (uint32_t)(bsync + 1 - r->bssy_at[d]); + for (int k = 0; k < r->n_exits[d]; k++) e->p->insns[r->exits[d][k]].imm = (uint32_t)(bsync - r->exits[d][k]); + return; + } + if (bw_regions_join(&e->rg, e->p, bsync) != d) e->err = -1; +} +static void tail(Em *e) { + emit(e, I0(BW_IR_EXIT), K_EXIT); + BlackwellIRInsn self = I0(BW_IR_BRA); + self.control = 0x000fc000u; + if (omega_bw_ir_append(e->p, &self) < 0) e->err = -1; +} +/* Loops nest; loop_end() extends every value defined before the loop and read inside + * it to the back-branch (the linear-scan allocator knows nothing about back-edges). */ +static void loop_begin(Em *e) { + if (e->depth >= AT_MAX_LOOPS || e->n_loops >= AT_MAX_LOOPS) { e->err = -1; return; } + e->stack[e->depth++] = here(e); +} +static void loop_end(Em *e) { + if (e->depth == 0 || e->n_loops >= AT_MAX_LOOPS) { e->err = -1; return; } + int start = e->stack[--e->depth], end = here(e) - 1; + e->loop_start[e->n_loops] = start; e->loop_end[e->n_loops] = end; e->n_loops++; + OmegaRegAlloc *ra = &e->p->regalloc; + for (int v = 0; v < ra->num_vregs; v++) { + OmegaLiveInterval *iv = &ra->intervals[v]; + if (iv->first_def >= 0 && iv->first_def < start && iv->last_use >= start && iv->last_use < end) iv->last_use = end; + } +} +/* A value first defined inside a loop may not be read after it before being redefined. */ +static int check_loop_invariant(const Em *e) { + const OmegaRegAlloc *ra = &e->p->regalloc; + for (int L = 0; L < e->n_loops; L++) + for (int v = 0; v < ra->num_vregs; v++) { + int fd = ra->intervals[v].first_def; + if (fd < e->loop_start[L] || fd > e->loop_end[L]) continue; + for (size_t i = (size_t)e->loop_end[L] + 1; i < e->p->count; i++) { + const BlackwellIRInsn *in = &e->p->insns[i]; + if (in->src1_vreg == v || in->src2_vreg == v || in->src3_vreg == v) return -1; + if (in->dst_vreg == v && !in->is_uniform) break; + } + } + return 0; +} + +/* Kernel argument words (constant bank 0 at 0x380; the bank is 1024 bytes, so 32 words fit). */ +#define ARG_Q 0x380u +#define ARG_POOL 0x388u +#define ARG_OUT 0x390u +#define ARG_TAB 0x398u +#define ARG_MAXB 0x3a0u /* words per block-table row */ +#define ARG_SCALE 0x3a4u /* bits of log2(e) / sqrt(head_dim) */ +#define ARG_BSTRIDE 0x3a8u /* bytes between staged blocks */ +#define ARG_TSTRIDE 0x3acu /* bytes between tokens */ +#define ARG_KVP 0x3b0u /* bytes from the K plane to the V plane */ +#define ARG_HSTRIDE 0x3b4u /* bytes between kv heads */ +#define ARG_NQH 0x3b8u /* query heads (q and out row count per sequence) */ +#define ARG_CTXOFF 0x3bcu /* byte offset of the context-length array inside the table buffer */ +#define ARG_WORDS 16u +#define DESC_OFF 0x358u + +/* Head dimension is a kernel parameter (64 or 128, see KSpec.hd). Shared memory is four arrays of hd words: + * q at SH_Q, s then p at hd*4, token byte offsets at hd*8, warp partials at hd*12 (hd 64: 0, 256, 512, 768, + * the layout of every cut before head_dim 128). */ +#define SH_Q 0u +#define F32_NEG_INF 0xff800000u + +/* divergent (omega #308 regression R2): 0 = production branch-free chunk loop; 1 = the + * lane-dependent "j >= ctx" branch restored inside a reconvergence region (BSSY/BSYNC) so + * the SHFL reductions run on a joined warp; 2 = the same with the BSYNC dropped (the + * 2026-10-04 bug shape, a negative control the host simulator must catch). */ +typedef struct { bool f32; uint32_t log2bs, log2gqa; int mutant; int divergent; uint32_t hd; int split; } KSpec; +/* split (cut F, 2026-10-12): -1 = direct output (the gqa f32 and rows callers; byte for byte the kernel before). + * 0..MAX_LOG2SPLIT = the paged path: 2^split CTAs share one (sequence, head). Each sequence derives its own split + * count from its own context (so its result never depends on the other sequences in the launch), every CTA writes + * an unnormalised partial (acc[hd], running max, running sum; an empty slice writes acc 0, max -inf) and the host + * combines them, also when split == 0. */ + +/* cut K (2026-10-12, GQA group): at head_dim 128 one CTA serves the GC query heads of one kv head, GC = + * min(2^log2gqa, 4), so every K and V byte of a launch is read once instead of once per query head. The KV + * pool is GPU-uncached (host-written), so the four CTAs of a GQA group were four DRAM reads of the same + * bytes: 21 MB per call at 1268 tokens, the memory ceiling (sc leg smoke-ctx-chunk: 152 us per call). + * Grid x is the head group (num_q_heads / GC CTAs per sequence and split). Shared memory: q, scores and + * warp partials per head, token offsets once. GC = 1 (every hd 64 kernel, hd 128 with gqa 1) emits exactly + * the program before this cut (digest fixtures). */ +static uint32_t heads_per_cta(uint32_t hd, uint32_t log2gqa) { return hd == 128u ? (1u << (log2gqa < 2u ? log2gqa : 2u)) : 1u; } +static uint32_t shared_bytes_for(uint32_t hd, uint32_t log2gqa) { return (3u * heads_per_cta(hd, log2gqa) + 1u) * hd * 4u; } +uint32_t omega_gpu_attention_heads_per_cta(uint32_t head_dim, uint32_t log2_gqa) { return heads_per_cta(head_dim, log2_gqa); } + +static void gen_attention(Em *e, const KSpec *k) { + const uint32_t elem = k->f32 ? 4u : 2u; + const uint32_t HD = k->hd, GC = heads_per_cta(HD, k->log2gqa), log2gc = GC == 4u ? 2u : GC == 2u ? 1u : 0u; + const uint32_t HB = HD * 4u; /* bytes of one per-head shared array */ + const uint32_t SH_S = GC * HB, SH_O = 2u * GC * HB, SH_R = SH_O + HB; /* warps per CTA: HD / 32 */ + int udesc = UV64(e), A = V64(e), B = V64(e), C = V64(e), D = V64(e); + int tid = V(e), h = V(e), seq = V(e); + int p_maxb = V(e), scale = V(e), p_bstride = V(e), p_tstride = V(e), p_kvp = V(e), p_hstride = V(e), p_nqh = V(e), p_ctxoff = V(e); + ldcu64(e, udesc, DESC_OFF); + ldc64(e, A, ARG_Q); ldc64(e, B, ARG_POOL); ldc64(e, C, ARG_OUT); ldc64(e, D, ARG_TAB); + ldc32(e, p_maxb, ARG_MAXB); ldc32(e, scale, ARG_SCALE); ldc32(e, p_bstride, ARG_BSTRIDE); ldc32(e, p_tstride, ARG_TSTRIDE); + ldc32(e, p_kvp, ARG_KVP); ldc32(e, p_hstride, ARG_HSTRIDE); ldc32(e, p_nqh, ARG_NQH); ldc32(e, p_ctxoff, ARG_CTXOFF); + s2r(e, tid, BW_SR_TID_X); s2r(e, h, BW_SR_CTAID_X); s2r(e, seq, BW_SR_CTAID_Y); + + /* cut F, partial mode: grid y = sequence * S + split; the split index picks this CTA's slice of the context (below) */ + const bool part = k->split >= 0; + const uint32_t LS = part ? (uint32_t)k->split : 0u, S = 1u << LS, log2hd = (HD == 128u) ? 7u : 6u; + int split = -1, kb = -1, kend = -1; + if (part) { split = V(e); if (LS) { lop3andi(e, split, seq, S - 1u); shri(e, seq, seq, LS); } else movrz(e, split); } + + int c1 = V(e), c4 = V(e), c32 = V(e), c64 = V(e), c256 = V(e), c512 = V(e), c768 = V(e), c896 = V(e), zero = V(e); + /* c32 / c64 keep their hd 64 names: the inner (dim pair) loop trip count HD / 2 and the chunk size HD */ + movi(e, c1, 1); movi(e, c4, 4); movi(e, c32, HD / 2); movi(e, c64, HD); + movi(e, c256, SH_S); movi(e, c512, SH_O); movi(e, c768, SH_R); movi(e, c896, SH_R + 128); movrz(e, zero); + /* warp partials 2 and 3 (lane 0 of warps 2 and 3): only a 128-thread CTA has them. Created and emitted only + * when HD == 128, so the hd 64 program (vreg numbering, instruction sequence) is exactly the one before. */ + int c1024 = -1, c1152 = -1, rc_ = -1, rd_ = -1; + if (HD == 128) { c1024 = V(e); c1152 = V(e); rc_ = V(e); rd_ = V(e); movi(e, c1024, SH_R + 256); movi(e, c1152, SH_R + 384); } + + /* q[tid] -> shared; out address kept for the end. Row = seq * num_q_heads + head for + * both q and out (flattened head-major, the oracle's layout). The head-wiring mutants + * swap the row of head h with h ^ 1 on one side only. GC > 1: head g of the group is + * h * GC + g; q goes to SH_Q + g * HB; the output rows are derived in the epilogue. */ + int tid4 = V(e), qrow = V(e), qoff = V(e), qaddr = V64(e), qv = V(e), oaddr = GC == 1 ? V64(e) : -1; + int hq = h, ho = h; + if (GC == 1 && k->mutant == OMEGA_GPU_ATTN_MUTANT_Q_ROW) { hq = V(e); lop3xor(e, hq, h, c1); } + if (GC == 1 && k->mutant == OMEGA_GPU_ATTN_MUTANT_OUT_ROW) { ho = V(e); lop3xor(e, ho, h, c1); } + imadi(e, tid4, tid, 4, NOREG); + if (GC == 1) { + imadr(e, qrow, seq, p_nqh, hq); + imadi(e, qoff, qrow, HD * 4, tid4); + wide(e, qaddr, qoff, 1, A); + ldg(e, qv, qaddr, udesc); + sts32(e, tid4, qv); /* SH_Q + tid*4 */ + if (!part) { /* direct output address; partial mode derives its row in the epilogue */ + if (ho == hq) wide(e, oaddr, qoff, 1, C); + else { + int orow = V(e), ooff = V(e); + imadr(e, orow, seq, p_nqh, ho); + imadi(e, ooff, orow, HD * 4, tid4); + wide(e, oaddr, ooff, 1, C); + } + } + } else { + int h0 = V(e), hg = V(e), qsh = V(e); + imadi(e, h0, h, GC, NOREG); + for (uint32_t g = 0; g < GC; g++) { + imadi(e, hg, c1, g, h0); + if (k->mutant == OMEGA_GPU_ATTN_MUTANT_Q_ROW) lop3xor(e, hg, hg, c1); + imadr(e, qrow, seq, p_nqh, hg); + imadi(e, qoff, qrow, HD * 4, tid4); + wide(e, qaddr, qoff, 1, A); + ldg(e, qv, qaddr, udesc); + imadi(e, qsh, c1, g * HB, tid4); + sts32(e, qsh, qv); + } + } + + /* kv head offset, this sequence's table row and context length */ + int kvh = V(e), kvoff = V(e), t1 = V(e), tab = V64(e), ca = V64(e), ctx = V(e), vb = V64(e); + shri(e, kvh, h, k->log2gqa - log2gc); /* GC heads per CTA: kv head = (h * GC) >> log2gqa */ + if (k->mutant == OMEGA_GPU_ATTN_MUTANT_KV_HEAD) lop3xor(e, kvh, kvh, c1); + imadr(e, kvoff, kvh, p_hstride, NOREG); + imadr(e, t1, seq, p_maxb, NOREG); + imadi(e, t1, t1, 4, NOREG); + wide(e, tab, t1, 1, D); + imadi(e, t1, seq, 4, p_ctxoff); + wide(e, ca, t1, 1, D); + ldg(e, ctx, ca, udesc); + if (part) { + /* This sequence's own split count s_own = min(S, pow2floor(chunks)), chunks = ceil(ctx / HD), from its own + * context alone (the host picks the launch S the same way over the batch); per = roundup(ceil(ctx / s_own), HD) + * whole chunks per split; this CTA's slice is [kb, kend), kend = min(ctx, kb + per) through the sign bit of + * ctx - (kb + per). Splits past s_own get kb >= kend: an empty partial. Branch-free: candidate 2^c replaces + * per when chunks >= 2^c; the candidates nest, so the largest that fits wins. */ + int per = V(e), x = V(e), cand = V(e), dd = V(e), lt = V(e), cH1 = V(e), cK = V(e); + kb = V(e); kend = V(e); + movi(e, cH1, HD - 1u); + iadd3(e, per, ctx, cH1); lop3andi(e, per, per, ~(HD - 1u)); /* roundup(ctx, HD): one split takes it all */ + shri(e, x, per, log2hd); /* chunks (cut J: one whole chunk per split) */ + for (uint32_t c = 1; c <= LS; c++) { + movi(e, cK, (1u << c) - 1u); iadd3(e, cand, ctx, cK); shri(e, cand, cand, c); + iadd3(e, cand, cand, cH1); lop3andi(e, cand, cand, ~(HD - 1u)); /* roundup(ceil(ctx / 2^c), HD) */ + movi(e, cK, 0u - (1u << c)); iadd3(e, dd, x, cK); shri(e, lt, dd, 31); /* lt = (x < 2^c) */ + imadi(e, dd, cand, 0xFFFFFFFFu, per); /* per - cand */ + imadr(e, per, lt, dd, cand); /* lt ? per : cand */ + } + imadr(e, kb, split, per, NOREG); + iadd3(e, kend, kb, per); + imadi(e, dd, kend, 0xFFFFFFFFu, ctx); + shri(e, lt, dd, 31); + imadr(e, kend, lt, dd, kend); + } + const int lim = part ? kend : ctx; /* the end of this CTA's token range */ + /* V column base for dimension tid: pool + kv plane + tid * elem. The kv head offset is + * already inside the per-token offset phase A leaves in shared memory (found by the host + * simulator: adding it here too read V from the wrong head for every kv head but 0). */ + wide(e, vb, tid, elem, B); + wide(e, vb, p_kvp, 1, vb); + + /* running max, sum and accumulator per head of the group (GC = 1: one of each, as before) */ + int M[4], L[4], acc[4]; + for (uint32_t g = 0; g < GC; g++) M[g] = V(e); + for (uint32_t g = 0; g < GC; g++) L[g] = V(e); + for (uint32_t g = 0; g < GC; g++) acc[g] = V(e); + int base = V(e), sOff = V(e), oOff = V(e), rOff = V(e); + for (uint32_t g = 0; g < GC; g++) movi(e, M[g], F32_NEG_INF); + for (uint32_t g = 0; g < GC; g++) { if (k->mutant == OMEGA_GPU_ATTN_MUTANT_NO_MAX) movrz(e, L[g]); else movf(e, L[g], 1.0f); } /* alpha = 0 on the first chunk clears it */ + for (uint32_t g = 0; g < GC; g++) movrz(e, acc[g]); + if (part) iadd3(e, base, kb, zero); else movrz(e, base); + iadd3(e, sOff, tid4, c256); iadd3(e, oOff, tid4, c512); iadd3(e, rOff, tid4, c768); + bar_sync(e); /* q visible to every thread */ + if (part) isetp_ge_u32(e, kb, kend); else isetp_ge_u32(e, zero, ctx); /* empty range: out = 0 (an empty partial) */ + int bZ = bra_fwd_if_p0(e); + + /* ---------------- chunk loop ---------------- */ + int j = V(e), s[4], koff; + for (uint32_t g = 0; g < GC; g++) s[g] = V(e); + koff = V(e); + int bi = V(e), sl = V(e), ta = V64(e), blk = V(e), ka = V64(e), dot[4], d; + for (uint32_t g = 0; g < GC; g++) dot[g] = V(e); + d = V(e); + int lo = V(e), hi = V(e), qa = V(e), j1 = V(e); + int dneg = V(e), over = V(e), ot = V(e), ctxm1 = V(e), cm1 = V(e), cninf = V(e), nb = V(e), ns = V(e); + int tsh = GC > 1 ? V(e) : -1; /* per-head shared address temporary (GC > 1 only) */ + movi(e, cm1, 0xFFFFFFFFu); iadd3(e, ctxm1, lim, cm1); movi(e, cninf, F32_NEG_INF); + loop_begin(e); + int Lout = here(e); + /* No branch here: a warp split by "j >= ctx" without a BSSY/BSYNC region stays split, and + * the SHFL reductions below then read inactive lanes, which is undefined (wrong dims + * tid >= tail on the chip, 2026-10-04). The IR has BSSY/BSYNC regions since omega #310 + * (omega_bw_reconv.h); this kernel stays branchless and does not use them. + * over = (j >= ctx) as 0/1 from the sign of ctx-1-j; out-of-range lanes read token `base` + * (always < ctx here) and their score is forced to -inf after the dot product with s = -max(-s, nb), nb = -inf or +inf. */ + iadd3(e, j, base, tid); + for (uint32_t g = 0; g < GC; g++) movi(e, s[g], F32_NEG_INF); + movrz(e, koff); + if (k->divergent) { + /* omega #308 R2: the lane-dependent branch, inside a reconvergence region. Lanes with + * j >= ctx skip phase A (s stays -inf, koff 0); the BSYNC at region_join rejoins them + * before the SHFL reductions below. divergent == 2 drops that BSYNC (negative control). */ + region_begin(e); + isetp_ge_u32(e, j, lim); + region_exit(e, RX_IF_P0); + } else { + imadi(e, dneg, j, 0xFFFFFFFFu, ctxm1); /* ctx - 1 - j */ + shri(e, over, dneg, 31); + imadr(e, ot, over, tid, NOREG); + imadi(e, j, ot, 0xFFFFFFFFu, j); /* j - over*tid */ + } + /* phase A: token j */ + shri(e, bi, j, k->log2bs); + lop3andi(e, sl, j, (1u << k->log2bs) - 1u); + wide(e, ta, bi, 4, tab); + ldg(e, blk, ta, udesc); + imadr(e, koff, blk, p_bstride, NOREG); + if (k->mutant == OMEGA_GPU_ATTN_MUTANT_SLOT) { + /* K read from slot (t + 1) % block_size, V from the right slot: a K/V mismatch. + * (Shifting both only permutes matched pairs inside a full block, which softmax cannot see.) */ + int sl1 = V(e); + iadd3(e, j1, j, c1); lop3andi(e, sl1, j1, (1u << k->log2bs) - 1u); + imadr(e, sl1, sl1, p_tstride, koff); + iadd3(e, sl1, sl1, kvoff); + wide(e, ka, sl1, 1, B); + imadr(e, koff, sl, p_tstride, koff); + iadd3(e, koff, koff, kvoff); + } else { + imadr(e, koff, sl, p_tstride, koff); + iadd3(e, koff, koff, kvoff); + wide(e, ka, koff, 1, B); + } + /* phase A inner loop (batched, 2026-10-12): two 128-bit global loads of K per pass on SB_GPR (16 dims + * bf16, 8 dims f32) with the first half of the matching q slice as 128-bit shared loads on SB_LD2, one + * wait; then the second half of q, one more (short) wait. The serial loop before paid one global + * latency per dim pair. Two halves keep the pass inside AT_GPR_BUDGET (the whole slice at once is + * 65 to 76 registers). qa = d * 4 is the shared byte offset of q[d]. GC > 1: the same K pass feeds + * every head of the group, each from its own q slice at SH_Q + g * HB (cut K). */ + const uint32_t dims = k->f32 ? 8u : 16u; /* dims per pass: 32 bytes of K either way */ + const uint32_t nq = dims / 4u; /* q quads per pass, loaded in two halves */ + int kx[2], qq[4]; + kx[0] = V128(e); kx[1] = V128(e); + for (uint32_t i = 0; i < nq; i++) qq[i] = V128(e); + for (uint32_t g = 0; g < GC; g++) movrz(e, dot[g]); + movrz(e, d); + loop_begin(e); + int Lin = here(e); + imadi(e, qa, d, 4, NOREG); + ldg128_b(e, kx[0], ka, 0u, udesc, SB_GPR); + ldg128_b(e, kx[1], ka, 16u, udesc, SB_GPR); + for (uint32_t g = 0; g < GC; g++) { + for (int hh = 0; hh < 2; hh++) { + for (uint32_t i = 0; i < nq / 2u; i++) { uint32_t qi = (uint32_t)hh * (nq / 2u) + i; lds128_b(e, qq[qi], qa, g * HB + qi * 16u, SB_LD2); } + if (k->f32) { + for (int s4 = 0; s4 < 4; s4++) e_ffma_s(e, dot[g], qq[hh], s4, kx[hh], s4, dot[g]); /* dim hh*4+s4 */ + } else { + for (int s4 = 0; s4 < 4; s4++) { + int pi = hh * 4 + s4; /* bf16 pair: dims 2*pi (low half) and 2*pi+1 (high half) */ + imadi_s(e, lo, kx[hh], s4, 0x10000u, NOREG); /* low bf16 -> f32: bits << 16 */ + lop3andi_s(e, hi, kx[hh], s4, 0xffff0000u); /* high bf16 -> f32: keep the top half */ + e_ffma_s(e, dot[g], qq[pi / 2], (pi % 2) * 2, lo, 0, dot[g]); + e_ffma_s(e, dot[g], qq[pi / 2], (pi % 2) * 2 + 1, hi, 0, dot[g]); + } + } + } + } + wide(e, ka, c1, 32u, ka); + imadi(e, d, c1, dims, d); + isetp_ge_u32(e, d, c64); + bra_back_if_not_p0(e, Lin); + loop_end(e); + for (uint32_t g = 0; g < GC; g++) e_fmul(e, s[g], dot[g], scale); + if (k->divergent) { + region_join(e); /* every lane back before the cross-lane reductions */ + } else { + imadi(e, nb, over, 0x80000000u, cninf); /* over ? +inf : -inf (bits) */ + for (uint32_t g = 0; g < GC; g++) { e_fsub(e, ns, zero, s[g]); e_fmax(e, ns, ns, nb); e_fsub(e, s[g], zero, ns); } + } + for (uint32_t g = 0; g < GC; g++) { + if (g == 0) sts32(e, sOff, s[0]); + else { imadi(e, tsh, c1, g * HB, sOff); sts32(e, tsh, s[g]); } + } + sts32(e, oOff, koff); + + /* chunk max, per head */ + int t = V(e), mw = V(e), ra = V(e), rb = V(e), mc = V(e), Mn = V(e), diff = V(e), alpha[4], parg, p, sw, lc; + alpha[0] = V(e); parg = V(e); p = V(e); sw = V(e); lc = V(e); + for (uint32_t g = 1; g < GC; g++) alpha[g] = V(e); + static const uint32_t steps[5] = { 16, 8, 4, 2, 1 }; + for (uint32_t g = 0; g < GC; g++) { + shfl_down(e, t, s[g], steps[0]); e_fmax(e, mw, s[g], t); + for (int i = 1; i < 5; i++) { shfl_down(e, t, mw, steps[i]); e_fmax(e, mw, mw, t); } + if (g == 0) sts32(e, rOff, mw); + else { imadi(e, tsh, c1, g * HB, rOff); sts32(e, tsh, mw); } + } + bar_sync(e); + for (uint32_t g = 0; g < GC; g++) { + const int pg = GC == 1 ? p : s[g]; /* GC > 1: p overwrites the score register of its head */ + if (g == 0) { lds32(e, ra, c768); lds32(e, rb, c896); } + else { imadi(e, tsh, c1, g * HB, c768); lds32(e, ra, tsh); imadi(e, tsh, c1, g * HB, c896); lds32(e, rb, tsh); } + e_fmax(e, mc, ra, rb); + if (HD == 128) { + if (g == 0) { lds32(e, rc_, c1024); lds32(e, rd_, c1152); } + else { imadi(e, tsh, c1, g * HB, c1024); lds32(e, rc_, tsh); imadi(e, tsh, c1, g * HB, c1152); lds32(e, rd_, tsh); } + e_fmax(e, mc, mc, rc_); e_fmax(e, mc, mc, rd_); + } + e_fmax(e, Mn, M[g], mc); + if (k->mutant == OMEGA_GPU_ATTN_MUTANT_NO_MAX) { + movf(e, alpha[g], 1.0f); + mufu(e, BW_IR_MUFU_EX2, pg, s[g]); + e_fmax(e, M[g], Mn, mc); + } else { + e_fsub(e, diff, M[g], Mn); + mufu(e, BW_IR_MUFU_EX2, alpha[g], diff); + e_fmax(e, M[g], Mn, mc); /* M = Mn */ + e_fsub(e, parg, s[g], Mn); + mufu(e, BW_IR_MUFU_EX2, pg, parg); + } + } + bar_sync(e); /* everyone has read the max partials before they are overwritten */ + for (uint32_t g = 0; g < GC; g++) { + const int pg = GC == 1 ? p : s[g]; + if (g == 0) sts32(e, sOff, pg); + else { imadi(e, tsh, c1, g * HB, sOff); sts32(e, tsh, pg); } + shfl_down(e, t, pg, steps[0]); e_fadd(e, sw, pg, t); + for (int i = 1; i < 5; i++) { shfl_down(e, t, sw, steps[i]); e_fadd(e, sw, sw, t); } + if (g == 0) sts32(e, rOff, sw); + else { imadi(e, tsh, c1, g * HB, rOff); sts32(e, tsh, sw); } + } + bar_sync(e); + for (uint32_t g = 0; g < GC; g++) { + if (g == 0) { lds32(e, ra, c768); lds32(e, rb, c896); } + else { imadi(e, tsh, c1, g * HB, c768); lds32(e, ra, tsh); imadi(e, tsh, c1, g * HB, c896); lds32(e, rb, tsh); } + e_fadd(e, lc, ra, rb); + if (HD == 128) { + if (g == 0) { lds32(e, rc_, c1024); lds32(e, rd_, c1152); } + else { imadi(e, tsh, c1, g * HB, c1024); lds32(e, rc_, tsh); imadi(e, tsh, c1, g * HB, c1152); lds32(e, rd_, tsh); } + e_fadd(e, lc, lc, rc_); e_fadd(e, lc, lc, rd_); + } + e_ffma(e, L[g], L[g], alpha[g], lc); + if (k->mutant != OMEGA_GPU_ATTN_MUTANT_NO_RESCALE) e_fmul(e, acc[g], acc[g], alpha[g]); + } + + /* phase B (batched, 2026-10-12): dimension tid over the chunk's tokens, AT_TOK tokens per pass. The + * token offsets of a pass come in two 128-bit shared loads (SB_LD2, one wait), then each V address is + * computed into one register pair while the earlier V loads are in flight (emit_fixed_in_batch: the + * read barrier orders the overwrite after the load has read it) and its load issued on SB_GPR or + * SB_LD3; the p values follow as two more shared loads on SB_LD2; one wait for all of it. A token past + * ctx inside a pass has p = 0 and the offset of a real token (phase A), so it adds exactly 0. + * GC > 1: one V load per token feeds every head's accumulator from that head's p slice (cut K). */ + enum { AT_TOK = 8 }; + int kk = V(e), tt = V(e), oa = V(e), pa = V(e), ko4[2], pv4[2], va = V64(e), v[AT_TOK]; + for (int i = 0; i < 2; i++) { ko4[i] = V128(e); pv4[i] = V128(e); } + for (int i = 0; i < AT_TOK; i++) v[i] = V(e); + movrz(e, kk); + loop_begin(e); + int LB = here(e); + iadd3(e, tt, base, kk); + isetp_ge_u32(e, tt, lim); + int bB = bra_fwd_if_p0(e); + imadi(e, oa, kk, 4, c512); + imadi(e, pa, kk, 4, c256); + for (int i = 0; i < 2; i++) lds128_b(e, ko4[i], oa, (uint32_t)i * 16u, SB_LD2); + for (int i = 0; i < AT_TOK; i++) { + if (i == 0) wide_s(e, va, ko4[0], 0, 1, vb); /* ordinary: waits for the offsets */ + else wide_s_b(e, va, ko4[i / 4], i % 4, 1, vb); + uint32_t sb = (i < AT_TOK / 2) ? SB_GPR : SB_LD3; + if (k->f32) ldg_b(e, v[i], va, udesc, sb); else ldg16_b(e, v[i], va, udesc, sb); + } + if (GC == 1) { + for (int i = 0; i < 2; i++) lds128_b(e, pv4[i], pa, (uint32_t)i * 16u, SB_LD2); + for (int i = 0; i < AT_TOK; i++) { + if (!k->f32) imadi(e, v[i], v[i], 0x10000u, NOREG); + e_ffma_s(e, acc[0], pv4[i / 4], i % 4, v[i], 0, acc[0]); + } + } else { + if (!k->f32) for (int i = 0; i < AT_TOK; i++) imadi(e, v[i], v[i], 0x10000u, NOREG); + for (uint32_t g = 0; g < GC; g++) { + for (int i = 0; i < 2; i++) lds128_b(e, pv4[i], pa, g * HB + (uint32_t)i * 16u, SB_LD2); + for (int i = 0; i < AT_TOK; i++) e_ffma_s(e, acc[g], pv4[i / 4], i % 4, v[i], 0, acc[g]); + } + } + imadi(e, kk, c1, AT_TOK, kk); + isetp_ge_u32(e, kk, c64); + bra_back_if_not_p0(e, LB); + loop_end(e); + patch_fwd(e, bB); + bar_sync(e); /* phase B reads of s/p and offsets finish before the next chunk writes them */ + iadd3(e, base, base, c64); + isetp_ge_u32(e, base, lim); + bra_back_if_not_p0(e, Lout); + loop_end(e); + + patch_fwd(e, bZ); + if (part && GC == 1) { + /* partial row (seq * nqh + out head) * S + split: acc[HD] unnormalised, then M and L at words HD and HD + 1 + * (every lane stores the same CTA-wide M and L). Everything is re-derived here from the CTA ids and the + * constant bank so no extra value lives across the chunk loop (the hd 128 kernel sits at the register budget). */ + int cy = V(e), sq = V(e), sp = V(e), hh = V(e), nq_ = V(e), t4 = V(e), prow = V(e), poff = V(e); + int paddr = V64(e), maddr = V64(e), laddr = V64(e), Cp = V64(e); + s2r(e, cy, BW_SR_CTAID_Y); s2r(e, hh, BW_SR_CTAID_X); ldc32(e, nq_, ARG_NQH); ldc64(e, Cp, ARG_OUT); + if (k->mutant == OMEGA_GPU_ATTN_MUTANT_OUT_ROW) lop3xor(e, hh, hh, c1); + if (LS) { lop3andi(e, sp, cy, S - 1u); shri(e, sq, cy, LS); } else { movrz(e, sp); iadd3(e, sq, cy, zero); } + imadr(e, prow, sq, nq_, hh); + imadi(e, prow, prow, S, sp); + imadi(e, t4, tid, 4, NOREG); + imadi(e, poff, prow, (HD + 2u) * 4u, t4); + wide(e, paddr, poff, 1, Cp); + stg(e, paddr, acc[0], udesc); + imadi(e, poff, prow, (HD + 2u) * 4u, NOREG); + wide(e, maddr, poff, 1, Cp); + wide(e, maddr, c64, 4, maddr); + stg(e, maddr, M[0], udesc); + wide(e, laddr, c1, 4, maddr); + stg(e, laddr, L[0], udesc); + } else if (part) { + /* GC heads: row (seq * nqh + h * GC + g) * S + split for head g (OUT_ROW: g ^ 1 on the output side) */ + int cy = V(e), sq = V(e), sp = V(e), h0 = V(e), hg = V(e), nq_ = V(e), t4 = V(e), prow = V(e), poff = V(e); + int paddr = V64(e), maddr = V64(e), laddr = V64(e), Cp = V64(e); + s2r(e, cy, BW_SR_CTAID_Y); s2r(e, h0, BW_SR_CTAID_X); ldc32(e, nq_, ARG_NQH); ldc64(e, Cp, ARG_OUT); + imadi(e, h0, h0, GC, NOREG); + if (LS) { lop3andi(e, sp, cy, S - 1u); shri(e, sq, cy, LS); } else { movrz(e, sp); iadd3(e, sq, cy, zero); } + imadi(e, t4, tid, 4, NOREG); + for (uint32_t g = 0; g < GC; g++) { + imadi(e, hg, c1, g, h0); + if (k->mutant == OMEGA_GPU_ATTN_MUTANT_OUT_ROW) lop3xor(e, hg, hg, c1); + imadr(e, prow, sq, nq_, hg); + imadi(e, prow, prow, S, sp); + imadi(e, poff, prow, (HD + 2u) * 4u, t4); + wide(e, paddr, poff, 1, Cp); + stg(e, paddr, acc[g], udesc); + imadi(e, poff, prow, (HD + 2u) * 4u, NOREG); + wide(e, maddr, poff, 1, Cp); + wide(e, maddr, c64, 4, maddr); + stg(e, maddr, M[g], udesc); + wide(e, laddr, c1, 4, maddr); + stg(e, laddr, L[g], udesc); + } + } else if (GC == 1) { + int inv = V(e), o = V(e); + mufu(e, BW_IR_MUFU_RCP, inv, L[0]); + e_fmul(e, o, acc[0], inv); + stg(e, oaddr, o, udesc); + } else { + /* direct output, GC heads: row seq * nqh + h * GC + g (OUT_ROW: g ^ 1), re-derived from the CTA ids */ + int inv = V(e), o = V(e), cy = V(e), h0 = V(e), hg = V(e), nq_ = V(e), t4 = V(e), orow = V(e), ooff = V(e); + int oa64 = V64(e), Cp = V64(e); + s2r(e, cy, BW_SR_CTAID_Y); s2r(e, h0, BW_SR_CTAID_X); ldc32(e, nq_, ARG_NQH); ldc64(e, Cp, ARG_OUT); + imadi(e, h0, h0, GC, NOREG); + imadi(e, t4, tid, 4, NOREG); + for (uint32_t g = 0; g < GC; g++) { + imadi(e, hg, c1, g, h0); + if (k->mutant == OMEGA_GPU_ATTN_MUTANT_OUT_ROW) lop3xor(e, hg, hg, c1); + imadr(e, orow, cy, nq_, hg); + imadi(e, ooff, orow, HD * 4, t4); + wide(e, oa64, ooff, 1, Cp); + mufu(e, BW_IR_MUFU_RCP, inv, L[g]); + e_fmul(e, o, acc[g], inv); + stg(e, oa64, o, udesc); + } + } + tail(e); +} + +#define AT_GPR_BUDGET 96u /* cut K: the GQA-group hd 128 kernel carries four heads of running state (the matmul blocked kernels launch at 108) */ + +static int build_kernel(const KSpec *k, OmegaBlackwellKernel *kernel, BlackwellIRProgram **keep) { + BlackwellIRProgram *prog = omega_gpu_host_calloc(1, sizeof *prog); + if (!prog) return OMEGA_GPU_ATTN_CODEGEN_FAIL; + omega_bw_ir_init(prog); + Em e; memset(&e, 0, sizeof e); e.p = prog; + e.rg_mutant = (k->divergent == 2) ? 1 : 0; + gen_attention(&e, k); + if (e.depth != 0) e.err = -1; + if (e.rg.depth != 0) e.err = -1; /* a region left open has no join: refuse the build */ + int rc = OMEGA_GPU_ATTN_CODEGEN_FAIL; + int ra_rc = (e.err == 0) ? omega_bw_regalloc_solve(prog) : -1; + int loop_rc = (ra_rc == 0) ? check_loop_invariant(&e) : -1; +#ifdef OMEGA_ATTN_DEBUG + fprintf(stderr, "attn codegen f32=%d log2bs=%u log2gqa=%u mutant=%d emit_err=%d insns=%zu vregs=%d regalloc=%d loops=%d peak_gpr=%u\n", + (int)k->f32, k->log2bs, k->log2gqa, k->mutant, e.err, prog->count, prog->regalloc.num_vregs, ra_rc, loop_rc, prog->regalloc.peak_gpr_usage); +#endif + if (e.err == 0 && ra_rc == 0 && loop_rc == 0 && prog->regalloc.peak_gpr_usage <= AT_GPR_BUDGET) { + size_t max_bytes = (size_t)BW_MAX_IR_INSNS * 16; + memset(kernel, 0, sizeof *kernel); + kernel->code = omega_gpu_host_alloc(max_bytes); + size_t emitted = 0; + if (kernel->code && omega_bw_encode_program(prog, kernel->code, max_bytes, &emitted) == 0) { + kernel->code_size = emitted; + kernel->insn_count = emitted / 16; + kernel->gpr_count = prog->regalloc.peak_gpr_usage; + kernel->uniform_gpr_count = prog->regalloc.peak_ugpr_usage; + sha256_hash(kernel->code, kernel->code_size, kernel->code_digest); + rc = OMEGA_GPU_ATTN_OK; + } else { + omega_gpu_host_free(kernel->code); kernel->code = NULL; + } + } + if (keep && rc == OMEGA_GPU_ATTN_OK) *keep = prog; else omega_gpu_host_free(prog); + return rc; +} + +/* --------------------------------------------------------- kernel cache */ + +/* One kernel per KSpec; the device copy is uploaded once and stays resident for + * the process (cut 4b). The IR program is kept for the host simulator. */ +static int g_mutant; +static int g_divergent; /* omega #308 R2 test hook: see KSpec.divergent */ +static bool g_dedupe = true; /* shared-prefix staging dedupe; false = legacy per-sequence staging (test hook) */ +typedef struct { int used; KSpec k; OmegaBlackwellKernel kernel; BlackwellIRProgram *prog; OmegaGpuMem code; } Slot; +static OmegaGpuAttnSim g_sim; +static Slot g_cache[16]; /* split variants (cut F) multiply the shapes in flight */ +static int g_split = -1; /* test hook: forced log2split (0..OMEGA_GPU_ATTN_MAX_LOG2SPLIT), -1 = chosen per launch from the context */ +static OmegaGpuScratch g_q, g_pool, g_tab, g_out; /* staging, grown to the high-water mark, reused per call */ +static OmegaGpuMem g_resident; /* the resident KV pool (omega_gpu_attention_pool_alloc); cpu NULL = none */ +static bool g_hooked; +#define LOCK() omega_gpu_session_lock() +#define UNLOCK() omega_gpu_session_unlock() + +void omega_gpu_attention_test_set_simulator(OmegaGpuAttnSim sim) { LOCK(); g_sim = sim; UNLOCK(); } +static uint32_t g_sim_shared_bytes; /* shared bytes the launcher would declare for the kernel the simulator is running */ +uint32_t omega_gpu_attention_test_shared_bytes(void) { return g_sim_shared_bytes; } +void omega_gpu_attention_test_set_dedupe(bool on) { LOCK(); g_dedupe = on; UNLOCK(); } +void omega_gpu_attention_test_set_split(int log2split) { LOCK(); g_split = (log2split >= 0 && log2split <= (int)OMEGA_GPU_ATTN_MAX_LOG2SPLIT) ? log2split : -1; UNLOCK(); } + +/* ---- resident KV pool (see the header) ---- */ + +static int dev_open_locked(void); + +/* The kernel computes block_id * block_stride + slot * token_stride + head offset in 32 bits before + * widening onto the 64-bit layer base: one layer slice (both planes, every token and head of the + * block) past the block's start must stay inside 32 bits. */ +static bool resident_fits(const OmegaGpuKvLayout *ly, uint32_t block_id) { + return ly->block_stride_bytes <= 0xffffffffull && + (uint64_t)block_id * ly->block_stride_bytes + ly->layer_stride_bytes <= 0xffffffffull; +} +bool omega_gpu_attention_test_resident_fits(const OmegaGpuKvLayout *layout, uint32_t block_id) { + return layout && resident_fits(layout, block_id); +} + +int omega_gpu_attention_pool_alloc(size_t bytes, void **cpu) { + if (!cpu || bytes == 0) return OMEGA_GPU_ATTN_BAD_ARGS; + *cpu = NULL; + LOCK(); + if (g_resident.cpu) { omega_gpu_session_set_error("attention pool: already allocated"); UNLOCK(); return OMEGA_GPU_ATTN_BAD_ARGS; } + if (g_sim) { + g_resident.cpu = omega_gpu_host_calloc(1, bytes); + if (!g_resident.cpu) { UNLOCK(); return OMEGA_GPU_ATTN_CHIP_FAIL; } + g_resident.va = (uintptr_t)g_resident.cpu; g_resident.size = bytes; + } else { + int rc = dev_open_locked(); + if (rc != OMEGA_GPU_ATTN_OK) { UNLOCK(); return rc; } + if (omega_gpu_session_alloc(bytes, &g_resident) != 0) { memset(&g_resident, 0, sizeof g_resident); UNLOCK(); return OMEGA_GPU_ATTN_CHIP_FAIL; } + } + *cpu = g_resident.cpu; + UNLOCK(); + return OMEGA_GPU_ATTN_OK; +} + +void omega_gpu_attention_pool_free(void) { + LOCK(); + if (g_resident.cpu) { if (g_sim) omega_gpu_host_free(g_resident.cpu); else omega_gpu_session_free(&g_resident); } + memset(&g_resident, 0, sizeof g_resident); + UNLOCK(); +} + +static void cache_clear_locked(void) { + for (size_t i = 0; i < sizeof g_cache / sizeof g_cache[0]; i++) + if (g_cache[i].used) { omega_gpu_host_free(g_cache[i].kernel.code); omega_gpu_host_free(g_cache[i].prog); omega_gpu_session_free(&g_cache[i].code); memset(&g_cache[i], 0, sizeof g_cache[i]); } +} + +void omega_gpu_attention_cache_clear(void) { + LOCK(); + cache_clear_locked(); + UNLOCK(); +} + +/* Called by the session (lock held, device still open) right before it closes. */ +static void on_session_close(void) { + cache_clear_locked(); + memset(&g_resident, 0, sizeof g_resident); /* the session's memory goes with it; the caller's mapping is dead */ + omega_gpu_session_scratch_free(&g_q); omega_gpu_session_scratch_free(&g_pool); + omega_gpu_session_scratch_free(&g_tab); omega_gpu_session_scratch_free(&g_out); +} + +void omega_gpu_attention_test_set_mutant(OmegaGpuAttnMutant m) { + LOCK(); + g_mutant = (int)m; + cache_clear_locked(); + UNLOCK(); +} + +/* Caller holds the lock. Builds the kernel if needed; uploads the device copy when + * `upload` (the chip path; the simulator never needs one). */ +static int kernel_for(bool f32, uint32_t log2bs, uint32_t log2gqa, uint32_t hd, int split, bool upload, Slot **out, bool *hit) { + KSpec k = { .f32 = f32, .log2bs = log2bs, .log2gqa = log2gqa, .mutant = g_mutant, .divergent = g_divergent, .hd = hd, .split = split }; + Slot *s = NULL; + for (size_t i = 0; i < sizeof g_cache / sizeof g_cache[0]; i++) + if (g_cache[i].used && g_cache[i].k.f32 == k.f32 && g_cache[i].k.log2bs == k.log2bs && g_cache[i].k.log2gqa == k.log2gqa && g_cache[i].k.mutant == k.mutant && g_cache[i].k.divergent == k.divergent && g_cache[i].k.hd == k.hd && g_cache[i].k.split == k.split) { /* field compare: memcmp would read struct padding */ + s = &g_cache[i]; *hit = true; break; + } + if (!s) { + OmegaBlackwellKernel kern; BlackwellIRProgram *kp = NULL; + int rc = build_kernel(&k, &kern, &kp); + if (rc != OMEGA_GPU_ATTN_OK) return rc; + size_t slot = 0; + for (size_t i = 0; i < sizeof g_cache / sizeof g_cache[0]; i++) if (!g_cache[i].used) { slot = i; break; } + s = &g_cache[slot]; + if (s->used) { omega_gpu_host_free(s->kernel.code); omega_gpu_host_free(s->prog); omega_gpu_session_free(&s->code); } /* full: evict slot 0 */ + memset(s, 0, sizeof *s); + s->used = 1; s->k = k; s->kernel = kern; s->prog = kp; + *hit = false; + } + if (upload && !s->code.cpu) { + if (omega_gpu_session_alloc_code(s->kernel.code_size, &s->code) != 0) return OMEGA_GPU_ATTN_CHIP_FAIL; + memcpy(s->code.cpu, s->kernel.code, s->kernel.code_size); + if (omega_gpu_session_sync_to_gpu(&s->code) != 0) { omega_gpu_session_free(&s->code); return OMEGA_GPU_ATTN_CHIP_FAIL; } + } + *out = s; + return OMEGA_GPU_ATTN_OK; +} + +int omega_gpu_attention_codegen_hd(bool kv_f32, uint32_t log2_block_size, uint32_t log2_gqa, uint32_t head_dim, OmegaBlackwellKernel *kernel) { + if (!kernel || log2_block_size > 16 || log2_gqa > 6) return OMEGA_GPU_ATTN_BAD_ARGS; + if (head_dim != 64u && head_dim != 128u) return OMEGA_GPU_ATTN_TOO_LARGE; + LOCK(); + KSpec k = { .f32 = kv_f32, .log2bs = log2_block_size, .log2gqa = log2_gqa, .mutant = g_mutant, .divergent = g_divergent, .hd = head_dim, .split = -1 }; + UNLOCK(); + return build_kernel(&k, kernel, NULL); +} + +int omega_gpu_attention_codegen(bool kv_f32, uint32_t log2_block_size, uint32_t log2_gqa, OmegaBlackwellKernel *kernel) { + return omega_gpu_attention_codegen_hd(kv_f32, log2_block_size, log2_gqa, OMEGA_GPU_ATTN_HEAD_DIM, kernel); +} + +const char *omega_gpu_attention_last_error(void) { return omega_gpu_session_last_error(); } + +/* ------------------------------------------------------------ launcher */ + +#define AT_POISON 0xffbadbadu +#define AT_WAIT_MS 600000ull + +static uint64_t now_ns(void) { return omega_gpu_session_now_ns(); } /* the platform clock (CLOCK_NS) */ + +typedef OmegaGpuAttnLaunch Launch; + +/* Caller holds the lock. Chip path: open the shared device on first use. */ +static int dev_open_locked(void) { + if (!g_hooked) { (void)omega_gpu_session_on_close(on_session_close); g_hooked = true; } + return omega_gpu_session_open() ? OMEGA_GPU_ATTN_OK : OMEGA_GPU_ATTN_CHIP_FAIL; +} + +/* Where a call stages the KV slice it is about to hand the kernel: straight into the + * device staging buffer on the chip path (one copy), a host buffer under the simulator. + * Caller holds the lock; the result is valid until the next staging call. */ +static void *stage_target(size_t bytes, void **host_tmp, int *fail_rc) { + *host_tmp = NULL; + *fail_rc = OMEGA_GPU_ATTN_CHIP_FAIL; + if (g_sim) { *host_tmp = omega_gpu_host_alloc(bytes ? bytes : 1); return *host_tmp; } + int r = omega_gpu_session_scratch(&g_pool, bytes); + if (r != 0) { if (r == OMEGA_GPU_SESSION_SCRATCH_RESERVED) *fail_rc = OMEGA_GPU_ATTN_TOO_LARGE; return NULL; } /* reserved bound exceeded: loud, no allocation */ + return g_pool.mem.cpu; +} + +/* One launch through the shared session (omega_gpu_session_launch: shader-cache + * invalidate, constant bank, QMD0/QMD1, first marker, L2_FLUSH_DIRTY, second marker), + * then readback and the poison scan. L->pool may already be the pool staging buffer. */ +static int run_launch(const Slot *ks, const Launch *L, OmegaGpuAttnInfo *info) { + int sr = omega_gpu_session_scratch(&g_q, L->q_bytes); + if (!sr) sr = omega_gpu_session_scratch(&g_tab, L->tab_bytes); + if (!sr) sr = omega_gpu_session_scratch(&g_out, L->out_bytes); + if (!sr && !L->pool_va && L->pool != g_pool.mem.cpu) sr = omega_gpu_session_scratch(&g_pool, L->pool_bytes); + if (sr) return sr == OMEGA_GPU_SESSION_SCRATCH_RESERVED ? OMEGA_GPU_ATTN_TOO_LARGE : OMEGA_GPU_ATTN_CHIP_FAIL; + memcpy(g_q.mem.cpu, L->q, L->q_bytes); + if (!L->pool_va && L->pool != g_pool.mem.cpu) memcpy(g_pool.mem.cpu, L->pool, L->pool_bytes); + const uint64_t pool_va = L->pool_va ? L->pool_va : g_pool.mem.va; /* resident: the caller's KV, read in place */ + memcpy(g_tab.mem.cpu, L->tab, L->tab_bytes); + size_t out_words = L->out_bytes / 4; + uint32_t *out_dev = (uint32_t *)g_out.mem.cpu; + for (size_t i = 0; i < out_words; i++) out_dev[i] = AT_POISON; + /* the KV this launch reads: the staged pool, or the resident pool the caller wrote in place */ + if (omega_gpu_session_sync_to_gpu(&g_q.mem) != 0 || omega_gpu_session_sync_to_gpu(&g_tab.mem) != 0 || + omega_gpu_session_sync_to_gpu(&g_out.mem) != 0 || omega_gpu_session_sync_to_gpu(L->pool_va ? &g_resident : &g_pool.mem) != 0) + return OMEGA_GPU_ATTN_CHIP_FAIL; + + uint32_t args[ARG_WORDS]; + args[0] = (uint32_t)g_q.mem.va; args[1] = (uint32_t)(g_q.mem.va >> 32); + args[2] = (uint32_t)pool_va; args[3] = (uint32_t)(pool_va >> 32); + args[4] = (uint32_t)g_out.mem.va; args[5] = (uint32_t)(g_out.mem.va >> 32); + args[6] = (uint32_t)g_tab.mem.va; args[7] = (uint32_t)(g_tab.mem.va >> 32); + memcpy(&args[8], L->params, sizeof L->params); + OmegaGpuLaunch GL = { + .code_va = ks->code.va, .gpr_count = AT_GPR_BUDGET, .threads_x = ks->k.hd, .threads_y = 1, .shared_bytes = shared_bytes_for(ks->k.hd, ks->k.log2gqa), /* (3 GC + 1) arrays of hd words: 1024 B for hd 64, 2048 B for hd 128 gqa 1, 6656 B for hd 128 gqa 4 */ + .grid_x = L->grid_x, .grid_y = L->grid_y, .num_elements = out_words, + .args = args, .n_args = ARG_WORDS, .timeout_ms = AT_WAIT_MS, + }; + uint64_t elapsed = 0; uint32_t marker = 0; + if (omega_gpu_session_launch(&GL, &elapsed, &marker) != 0) return OMEGA_GPU_ATTN_CHIP_FAIL; + if (omega_gpu_session_sync_to_cpu(&g_out.mem) != 0) return OMEGA_GPU_ATTN_CHIP_FAIL; + + memcpy(L->out, g_out.mem.cpu, L->out_bytes); + uint32_t unwritten = 0; + for (size_t i = 0; i < out_words; i++) if (((uint32_t *)L->out)[i] == AT_POISON) unwritten++; + if (info) { + info->chip_calls++; + info->elapsed_ns += elapsed; + info->completion_marker = marker; + info->unwritten_words += unwritten; + info->threads_per_cta = ks->k.hd; + info->ctas_last_launch = L->grid_x * L->grid_y; + } + return unwritten ? OMEGA_GPU_ATTN_UNWRITTEN : OMEGA_GPU_ATTN_OK; +} + +/* Caller holds the lock. Accounts the launch's q / table / output traffic (the KV + * staging bytes are accounted where the slices are copied). */ +static int launch(const Slot *ks, const Launch *L, OmegaGpuAttnInfo *info) { + if (info) { + info->q_bytes += L->q_bytes; info->tab_bytes += L->tab_bytes; info->out_bytes += L->out_bytes; + info->kv_source = L->pool_va ? OMEGA_GPU_ATTN_KV_RESIDENT : OMEGA_GPU_ATTN_KV_STAGED; + } + if (g_sim) { g_sim_shared_bytes = shared_bytes_for(ks->k.hd, ks->k.log2gqa); return g_sim(ks->prog, L, info); } + return run_launch(ks, L, info); +} + +/* ---- opt-in serving reservation (see the header) ---- */ + +static int check_heads(uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, uint32_t *log2gqa); +static int log2_exact(uint32_t v, uint32_t *out); + +int omega_gpu_attention_reserve(uint32_t max_context, uint32_t max_seqs, uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, uint32_t kv_block_size) { + uint32_t log2gqa, log2bs; + if (max_context == 0 || max_seqs == 0) { omega_gpu_session_set_error("attention reserve: zero bound"); return OMEGA_GPU_ATTN_BAD_ARGS; } + if (kv_block_size && log2_exact(kv_block_size, &log2bs) != 0) { omega_gpu_session_set_error("attention reserve: block size not a power of two"); return OMEGA_GPU_ATTN_BAD_ARGS; } + int rc = check_heads(num_q_heads, num_kv_heads, head_dim, &log2gqa); + if (rc != OMEGA_GPU_ATTN_OK) { omega_gpu_session_set_error("attention reserve: bad head shape"); return rc; } + /* KV staging, worst case over the two paths, per sequence: contiguous f32 holds both planes for max_context tokens + * (2 * ctx * kvh * hd * 4); paged bf16 stages whole blocks of both planes (round_up(ctx, block) * kvh * hd * 4), which + * is the larger one when max_context is under half a block. */ + size_t per_seq = 2u * max_context * (size_t)num_kv_heads * head_dim * 4u; + if (kv_block_size) { + size_t paged = ((size_t)max_context + kv_block_size - 1) / kv_block_size * kv_block_size * num_kv_heads * head_dim * 4u; + if (paged > per_seq) per_seq = paged; + } + const size_t pool = per_seq * max_seqs; + /* q rows for every sequence, and the output buffer sized for the paged path's partials of one launch + * (cut J: up to 2^MAX_LOG2SPLIT partials of head_dim + 2 words per (sequence, head), at most + * MAX_CTAS / num_q_heads sequences per launch; the rows reserve usually asks for more). */ + const size_t q_bytes = (size_t)max_seqs * num_q_heads * head_dim * 4u; + size_t launch_seqs = OMEGA_GPU_ATTN_MAX_CTAS / num_q_heads; + if (launch_seqs == 0) launch_seqs = 1; + if (launch_seqs > max_seqs) launch_seqs = max_seqs; + const size_t partials = launch_seqs * num_q_heads * ((size_t)1u << OMEGA_GPU_ATTN_MAX_LOG2SPLIT) * ((size_t)head_dim + 2u) * 4u; + const size_t qo = q_bytes > partials ? q_bytes : partials; + const size_t tab = ((size_t)max_seqs * max_context + max_seqs) * 4u; + LOCK(); + rc = OMEGA_GPU_ATTN_OK; + if (g_sim) rc = OMEGA_GPU_ATTN_OK; /* the simulator stages in host memory: nothing to reserve */ + else if (dev_open_locked() != OMEGA_GPU_ATTN_OK) rc = OMEGA_GPU_ATTN_CHIP_FAIL; + else if (omega_gpu_session_scratch_reserve(&g_pool, pool) || omega_gpu_session_scratch_reserve(&g_q, q_bytes) || + omega_gpu_session_scratch_reserve(&g_out, qo) || omega_gpu_session_scratch_reserve(&g_tab, tab < 8 ? 8 : tab)) { + /* roll back this API's own buffers: a failed reserve leaves nothing flagged (growth allowed as before) */ + omega_gpu_session_scratch_unreserve(&g_pool); omega_gpu_session_scratch_unreserve(&g_q); + omega_gpu_session_scratch_unreserve(&g_out); omega_gpu_session_scratch_unreserve(&g_tab); + rc = OMEGA_GPU_ATTN_CHIP_FAIL; + } + UNLOCK(); + return rc; +} + +int omega_gpu_attention_reserve_rows(uint32_t max_rows, uint32_t num_q_heads, uint32_t head_dim) { + if (max_rows == 0 || num_q_heads == 0 || num_q_heads > OMEGA_GPU_ATTN_MAX_Q_HEADS || (head_dim != 64u && head_dim != 128u)) { + omega_gpu_session_set_error("attention reserve rows: bad bound"); + return OMEGA_GPU_ATTN_BAD_ARGS; + } + uint32_t per = OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads; + if (per == 0) per = 1; + if (per > max_rows) per = max_rows; + const size_t qo = (size_t)per * num_q_heads * head_dim * 4u, tab = (size_t)per * 8u; + LOCK(); + int rc = OMEGA_GPU_ATTN_OK; + if (g_sim) rc = OMEGA_GPU_ATTN_OK; + else if (dev_open_locked() != OMEGA_GPU_ATTN_OK) rc = OMEGA_GPU_ATTN_CHIP_FAIL; + else if ((qo > g_q.cap && omega_gpu_session_scratch_reserve(&g_q, qo)) || + (qo > g_out.cap && omega_gpu_session_scratch_reserve(&g_out, qo)) || + (tab > g_tab.cap && omega_gpu_session_scratch_reserve(&g_tab, tab))) + rc = OMEGA_GPU_ATTN_CHIP_FAIL; /* growth failed; whatever grew stays reserved at its larger size */ + UNLOCK(); + return rc; +} +void omega_gpu_attention_unreserve(void) { + LOCK(); + omega_gpu_session_scratch_unreserve(&g_pool); omega_gpu_session_scratch_unreserve(&g_q); + omega_gpu_session_scratch_unreserve(&g_out); omega_gpu_session_scratch_unreserve(&g_tab); + UNLOCK(); +} + +/* ------------------------------------------------------- public entries */ + +static void info_begin(OmegaGpuAttnInfo *info, const OmegaBlackwellKernel *k, bool hit) { + if (!info) return; + memset(info, 0, sizeof *info); + info->kernel_cache_hit = hit; + info->gpr_count = k->gpr_count; + info->insn_count = (uint32_t)k->insn_count; + omega_gpu_fmt(info->target_chip, sizeof info->target_chip, "NVIDIA DGX Spark (Grace Blackwell GB10)"); + info->sm_architecture = 121; +} +static uint32_t f2u(float f) { uint32_t u; memcpy(&u, &f, 4); return u; } +static int log2_exact(uint32_t v, uint32_t *out) { + if (v == 0 || (v & (v - 1))) return -1; + uint32_t l = 0; while ((1u << l) != v) l++; + *out = l; return 0; +} +/* log2(e) / sqrt(head_dim) with the square roots as literals (8 and 11.313708498984761 = sqrt(128), both exactly what sqrt() returns): + * the library must not need libm (omegatool links without -lm; a constant head_dim folded sqrt away, a runtime one does not). */ +static float score_scale(uint32_t hd) { return (float)(1.4426950408889634 / (hd == 128u ? 11.313708498984761 : 8.0)); } + +/* Common head-shape checks; returns log2 of the gqa ratio. */ +static int check_heads(uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, uint32_t *log2gqa) { + if (num_q_heads == 0 || num_kv_heads == 0 || head_dim == 0) return OMEGA_GPU_ATTN_BAD_ARGS; + if ((head_dim != 64u && head_dim != 128u) || num_q_heads > OMEGA_GPU_ATTN_MAX_Q_HEADS) return OMEGA_GPU_ATTN_TOO_LARGE; + if (num_q_heads % num_kv_heads != 0 || log2_exact(num_q_heads / num_kv_heads, log2gqa) != 0) return OMEGA_GPU_ATTN_BAD_ARGS; + return OMEGA_GPU_ATTN_OK; +} + +/* Common prologue of every chip entry (lock held on success): device, kernel, info. */ +static int begin(bool f32, uint32_t log2bs, uint32_t log2gqa, uint32_t hd, int split, Slot **ks, OmegaGpuAttnInfo *info) { + LOCK(); + int rc = g_sim ? OMEGA_GPU_ATTN_OK : dev_open_locked(); + bool hit = false; + if (rc == OMEGA_GPU_ATTN_OK) rc = kernel_for(f32, log2bs, log2gqa, hd, split, !g_sim, ks, &hit); + if (rc != OMEGA_GPU_ATTN_OK) { UNLOCK(); return rc; } + info_begin(info, &(*ks)->kernel, hit); + return OMEGA_GPU_ATTN_OK; +} + +int omega_gpu_gqa_attention_f32(const float *q, const float *k_cache, const float *v_cache, + uint32_t seq_len, uint32_t num_q_heads, uint32_t num_kv_heads, + uint32_t head_dim, float *out, OmegaGpuAttnInfo *info) { + uint64_t t0 = now_ns(); + if (!q || !k_cache || !v_cache || !out) return OMEGA_GPU_ATTN_BAD_ARGS; + uint32_t log2gqa; + int rc = check_heads(num_q_heads, num_kv_heads, head_dim, &log2gqa); + if (rc != OMEGA_GPU_ATTN_OK) return rc; + if (seq_len > OMEGA_GPU_ATTN_MAX_GQA_CTX) return OMEGA_GPU_ATTN_TOO_LARGE; + const uint32_t HD = head_dim; + size_t n_out = (size_t)num_q_heads * HD; + if (seq_len == 0) { memset(out, 0, n_out * 4); if (info) { memset(info, 0, sizeof *info); info->call_ns = now_ns() - t0; } return OMEGA_GPU_ATTN_OK; } + Slot *ks = NULL; + const uint32_t log2bs = 12; /* one block of 4096 slots */ + rc = begin(true, log2bs, log2gqa, HD, -1, &ks, info); + if (rc != OMEGA_GPU_ATTN_OK) return rc; + size_t plane = (size_t)seq_len * num_kv_heads * HD * 4; + void *host_tmp = NULL; + int stage_rc; + uint8_t *pool = stage_target(2 * plane, &host_tmp, &stage_rc); + if (!pool) { UNLOCK(); return stage_rc; } + memcpy(pool, k_cache, plane); + memcpy(pool + plane, v_cache, plane); + if (info) { info->kv_bytes_staged += 2 * plane; info->kv_bytes_naive += 2 * plane; info->kv_blocks_logical += 1; info->kv_blocks_unique += 1; } /* one contiguous pseudo-block */ + uint32_t tab[2] = { 0, seq_len }; /* table row {0}, then the context length at byte 4 */ + Launch L = { + .q = q, .q_bytes = n_out * 4, .pool = pool, .pool_bytes = 2 * plane, .tab = tab, .tab_bytes = sizeof tab, + .out = out, .out_bytes = n_out * 4, .grid_x = num_q_heads / heads_per_cta(HD, log2gqa), .grid_y = 1, + .params = { 1, f2u(score_scale(HD)), (uint32_t)(2 * plane), num_kv_heads * HD * 4, (uint32_t)plane, HD * 4, num_q_heads, 4 } + }; + rc = launch(ks, &L, info); + omega_gpu_host_free(host_tmp); + UNLOCK(); + if (info) info->call_ns = now_ns() - t0; + return rc; +} + +/* Rows per launch of the rows path: the CTA bound, then (under a reservation) what the q buffer holds. Caller holds the lock. */ +static uint32_t rows_per_launch(uint32_t num_rows, uint32_t num_q_heads, size_t row_bytes) { + uint32_t per = OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads; + if (per == 0) per = 1; + if (per > num_rows) per = num_rows; + if (!g_sim && g_q.reserved && g_q.cap >= row_bytes) { + size_t fit = g_q.cap / row_bytes; + if (fit < per) per = (uint32_t)fit; + } + return per; +} + +int omega_gpu_gqa_attention_rows_f32(const float *q, const float *k_cache, const float *v_cache, + uint32_t base_len, uint32_t num_rows, uint32_t num_q_heads, + uint32_t num_kv_heads, uint32_t head_dim, float *out, OmegaGpuAttnInfo *info) { + uint64_t t0 = now_ns(); + if (!q || !k_cache || !v_cache || !out || num_rows == 0) return OMEGA_GPU_ATTN_BAD_ARGS; + uint32_t log2gqa; + int rc = check_heads(num_q_heads, num_kv_heads, head_dim, &log2gqa); + if (rc != OMEGA_GPU_ATTN_OK) return rc; + if ((uint64_t)base_len + num_rows > OMEGA_GPU_ATTN_MAX_GQA_CTX) return OMEGA_GPU_ATTN_TOO_LARGE; + const uint32_t HD = head_dim, total = base_len + num_rows; + const size_t row = (size_t)num_q_heads * HD; + Slot *ks = NULL; + const uint32_t log2bs = 12; /* one block of 4096 slots, as the single-row call */ + rc = begin(true, log2bs, log2gqa, HD, -1, &ks, info); + if (rc != OMEGA_GPU_ATTN_OK) return rc; + /* the whole context (every row's keys are a prefix of it) staged once */ + size_t plane = (size_t)total * num_kv_heads * HD * 4; + void *host_tmp = NULL; + int stage_rc; + uint8_t *pool = stage_target(2 * plane, &host_tmp, &stage_rc); + if (!pool) { UNLOCK(); return stage_rc; } + memcpy(pool, k_cache, plane); + memcpy(pool + plane, v_cache, plane); + if (info) { info->kv_bytes_staged += 2 * plane; info->kv_bytes_naive += (uint64_t)num_rows * 2 * plane; info->kv_blocks_logical += num_rows; info->kv_blocks_unique += 1; } + const uint32_t per = rows_per_launch(num_rows, num_q_heads, row * 4); + /* table of one launch: per block ids (all 0: the one staged block), then per context lengths */ + uint32_t *tab = omega_gpu_host_calloc(2 * (size_t)per, sizeof *tab); + if (!tab) { omega_gpu_host_free(host_tmp); UNLOCK(); return OMEGA_GPU_ATTN_CHIP_FAIL; } + for (uint32_t r0 = 0; r0 < num_rows && rc == OMEGA_GPU_ATTN_OK; r0 += per) { + const uint32_t nr = num_rows - r0 < per ? num_rows - r0 : per; + for (uint32_t i = 0; i < nr; i++) { tab[i] = 0; tab[nr + i] = base_len + r0 + i + 1; } + Launch L = { + .q = q + (size_t)r0 * row, .q_bytes = (size_t)nr * row * 4, .pool = pool, .pool_bytes = 2 * plane, + .tab = tab, .tab_bytes = (size_t)2 * nr * 4, .out = out + (size_t)r0 * row, .out_bytes = (size_t)nr * row * 4, + .grid_x = num_q_heads / heads_per_cta(HD, log2gqa), .grid_y = nr, + .params = { 1, f2u(score_scale(HD)), (uint32_t)(2 * plane), num_kv_heads * HD * 4, (uint32_t)plane, HD * 4, num_q_heads, nr * 4 } + }; + rc = launch(ks, &L, info); + } + omega_gpu_host_free(tab); + omega_gpu_host_free(host_tmp); + UNLOCK(); + if (info) info->call_ns = now_ns() - t0; + return rc; +} + +/* Paged path shared by the single and batched entries. tables[s] has n_blocks[s] entries + * (already filtered of negatives), ctx[s] the context length. */ +/* cut F: a sequence's own split count from its context alone (the kernel computes the same): log2 of the largest + * power of two <= min(2^MAX_LOG2SPLIT, chunks), chunks = ceil(ctx / HD) (cut J: one whole chunk per split; cut F took two). */ +static uint32_t own_log2split(uint32_t ctx, uint32_t HD) { + uint32_t x = (ctx + HD - 1) / HD, l = 0; + while (l < OMEGA_GPU_ATTN_MAX_LOG2SPLIT && (2u << l) <= x) l++; + return l; +} + +/* 2^x in float without the math library (the engine archive also links where there is none): round x to the + * nearest integer n, 2^f on f in [-0.5, 0.5] by the Cephes exp2f polynomial, scale by 2^n through the exponent + * bits. x <= -127 (so also -inf, an empty split) is 0. The combine only passes x <= 0. */ +static float host_exp2(float x) { + if (x <= -127.0f) return 0.0f; + if (x > 127.0f) x = 127.0f; + int n = (int)(x + (x < 0.0f ? -0.5f : 0.5f)); + const float f = x - (float)n; + float px = 1.535336188319500e-4f; + px = px * f + 1.339887440266574e-3f; + px = px * f + 9.618437357674640e-3f; + px = px * f + 5.550332471162809e-2f; + px = px * f + 2.402264791363012e-1f; + px = px * f + 6.931472028550421e-1f; + px = 1.0f + f * px; + if (n < -126) { px *= 0.5f; n = -126; } + union { uint32_t u; float f; } sc; + sc.u = (uint32_t)(n + 127) << 23; + return px * sc.f; +} + +/* cut F: fold the per-split partials of each (sequence, head) row into out. w_s = 2^(M_s - max M): the kernel's + * running max and sum live in the log2 domain (scale carries log2 e, MUFU.EX2). A row whose every split is empty + * (context 0) is 0. */ +static void combine_splits(const float *part, float *out, size_t rows, uint32_t S, uint32_t HD) { + const size_t pw = (size_t)HD + 2; + for (size_t r = 0; r < rows; r++) { + const float *p = part + r * S * pw; + float *o = out + r * HD; + float mx = -__builtin_inff(); + for (uint32_t s = 0; s < S; s++) if (p[s * pw + HD] > mx) mx = p[s * pw + HD]; + if (!(mx > -__builtin_inff())) { memset(o, 0, (size_t)HD * 4); continue; } + float w[1u << OMEGA_GPU_ATTN_MAX_LOG2SPLIT], lsum = 0.0f; + for (uint32_t s = 0; s < S; s++) { w[s] = host_exp2(p[s * pw + HD] - mx); lsum += w[s] * p[s * pw + HD + 1]; } + const float inv = 1.0f / lsum; + for (uint32_t d = 0; d < HD; d++) { + float a = 0.0f; + for (uint32_t s = 0; s < S; s++) a += w[s] * p[s * pw + d]; + o[d] = a * inv; + } + } +} + +static int paged_core(const float *q, const uint8_t *pool, const OmegaGpuKvLayout *ly, + const uint32_t *const *tables, const uint32_t *n_blocks, const uint32_t *ctx, + uint32_t num_seqs, uint32_t layer_idx, uint32_t num_q_heads, uint32_t num_kv_heads, + uint32_t head_dim, float *out, OmegaGpuAttnInfo *info) { + uint64_t t0 = now_ns(); + uint32_t log2gqa, log2bs; + int rc = check_heads(num_q_heads, num_kv_heads, head_dim, &log2gqa); + if (rc != OMEGA_GPU_ATTN_OK) return rc; + const uint32_t HD = head_dim; + if (!ly || layer_idx >= ly->num_layers || log2_exact(ly->block_size, &log2bs) != 0) return OMEGA_GPU_ATTN_BAD_ARGS; + /* the oracle addresses heads as kv_head * head_dim * 2 inside a token: the layout must agree */ + if (ly->head_stride_bytes != HD * 2 || ly->token_stride_bytes != (uint64_t)num_kv_heads * HD * 2 || + ly->kv_plane_stride_bytes != (uint64_t)ly->block_size * ly->token_stride_bytes || + ly->layer_stride_bytes != 2 * ly->kv_plane_stride_bytes || ly->block_stride_bytes < (uint64_t)ly->num_layers * ly->layer_stride_bytes) + return OMEGA_GPU_ATTN_BAD_ARGS; + size_t row = (size_t)num_q_heads * HD; + /* effective context per sequence and block id range check */ + uint32_t *eff = omega_gpu_host_calloc(num_seqs ? num_seqs : 1, sizeof *eff); + if (!eff) return OMEGA_GPU_ATTN_CHIP_FAIL; + for (uint32_t s = 0; s < num_seqs; s++) { + uint64_t cap = (uint64_t)n_blocks[s] * ly->block_size; + eff[s] = (uint32_t)(ctx[s] < cap ? ctx[s] : cap); + for (uint32_t b = 0; b < n_blocks[s]; b++) { + uint64_t id = tables[s][b]; + if (id >= ly->num_blocks || id * ly->block_stride_bytes + (uint64_t)(layer_idx + 1) * ly->layer_stride_bytes > ly->pool_bytes) { omega_gpu_host_free(eff); return OMEGA_GPU_ATTN_BAD_ARGS; } + } + } + uint32_t seqs_per_launch = OMEGA_GPU_ATTN_MAX_CTAS / num_q_heads; + if (seqs_per_launch == 0) seqs_per_launch = 1; + /* cut F: split each (sequence, head) over 2^log2split CTAs along the context: at least one whole chunk per + * split, from the longest context in the call, within the split launch bound (the test hook forces it). */ + uint32_t log2split = 0; + if (g_split >= 0) log2split = (uint32_t)g_split; + else for (uint32_t s = 0; s < num_seqs; s++) { uint32_t l = own_log2split(eff[s], HD); if (l > log2split) log2split = l; } + while (log2split && ((uint64_t)num_q_heads * seqs_per_launch << log2split) > OMEGA_GPU_ATTN_SPLIT_MAX_CTAS) log2split--; + const uint32_t S = 1u << log2split; + float *part = omega_gpu_host_alloc((size_t)seqs_per_launch * num_q_heads * S * (HD + 2) * 4); /* the partials of one launch */ + if (!part) { omega_gpu_host_free(eff); return OMEGA_GPU_ATTN_CHIP_FAIL; } + Slot *ks = NULL; + rc = begin(false, log2bs, log2gqa, HD, (int)log2split, &ks, info); + if (rc != OMEGA_GPU_ATTN_OK) { omega_gpu_host_free(eff); omega_gpu_host_free(part); return rc; } + uint32_t maxb = 1; + for (uint32_t s = 0; s < num_seqs; s++) if (n_blocks[s] > maxb) maxb = n_blocks[s]; + /* Resident pool (2026-10-12): the caller's pool IS omega's allocation. Read it in place when the + * layout fits the allocation and every referenced block passes the 32-bit fit rule; else stage. */ + bool resident = g_resident.cpu && (const void *)pool == g_resident.cpu && ly->pool_bytes <= g_resident.size; + for (uint32_t s = 0; resident && s < num_seqs; s++) { + uint32_t need = eff[s] ? (eff[s] + ly->block_size - 1) / ly->block_size : 0; + for (uint32_t b = 0; b < need; b++) if (!resident_fits(ly, tables[s][b])) { resident = false; break; } + } + /* Dedupe map: physical block id -> staged slot of the current launch (-1 = not staged yet), + * plus the list of ids touched by the launch (in slot order) so the reset is O(unique). */ + int32_t *slot_of = NULL; uint32_t *touched = NULL; + if (g_dedupe && !resident) { + size_t nb = ly->num_blocks ? ly->num_blocks : 1; + slot_of = omega_gpu_host_alloc(nb * sizeof *slot_of); + touched = omega_gpu_host_alloc(nb * sizeof *touched); + if (!slot_of || !touched) { omega_gpu_host_free(slot_of); omega_gpu_host_free(touched); omega_gpu_host_free(eff); UNLOCK(); return OMEGA_GPU_ATTN_CHIP_FAIL; } + memset(slot_of, 0xff, nb * sizeof *slot_of); /* every entry -1 */ + } + for (uint32_t s0 = 0; s0 < num_seqs && rc == OMEGA_GPU_ATTN_OK; s0 += seqs_per_launch) { + uint32_t ns = num_seqs - s0 < seqs_per_launch ? num_seqs - s0 : seqs_per_launch; + /* logical references: every sequence's blocks up to its (truncated) context */ + uint32_t total = 0; + for (uint32_t s = 0; s < ns; s++) total += eff[s0 + s] ? (eff[s0 + s] + ly->block_size - 1) / ly->block_size : 0; + uint32_t *tab = omega_gpu_host_calloc((size_t)ns * maxb + ns, sizeof *tab); + if (!tab) { rc = OMEGA_GPU_ATTN_CHIP_FAIL; break; } + if (resident) { + /* the table carries the physical ids; the kernel's block stride is the pool's; the layer + * base is the chip address of this layer's slice of block 0 */ + for (uint32_t s = 0; s < ns; s++) { + uint32_t need = eff[s0 + s] ? (eff[s0 + s] + ly->block_size - 1) / ly->block_size : 0; + for (uint32_t b = 0; b < need; b++) tab[(size_t)s * maxb + b] = tables[s0 + s][b]; + tab[(size_t)ns * maxb + s] = eff[s0 + s]; + } + if (info) { info->kv_blocks_logical += total; info->kv_bytes_naive += (uint64_t)total * ly->layer_stride_bytes; } + Launch L = { + .q = q + (size_t)s0 * row, .q_bytes = (size_t)ns * row * 4, + .pool = (const uint8_t *)pool + (size_t)layer_idx * ly->layer_stride_bytes, .pool_bytes = 0, + .tab = tab, .tab_bytes = ((size_t)ns * maxb + ns) * 4, + .out = part, .out_bytes = (size_t)ns * num_q_heads * S * (HD + 2) * 4, + .grid_x = num_q_heads / heads_per_cta(HD, log2gqa), .grid_y = ns * S, + .params = { maxb, f2u(score_scale(HD)), (uint32_t)ly->block_stride_bytes, (uint32_t)ly->token_stride_bytes, + (uint32_t)ly->kv_plane_stride_bytes, (uint32_t)ly->head_stride_bytes, num_q_heads, ns * maxb * 4 }, + .pool_va = g_resident.va + (uint64_t)layer_idx * ly->layer_stride_bytes, + }; + rc = launch(ks, &L, info); + if (rc == OMEGA_GPU_ATTN_OK) combine_splits(part, out + (size_t)s0 * row, (size_t)ns * num_q_heads, S, HD); + omega_gpu_host_free(tab); + continue; + } + /* pass 1: assign staged slots. Dedupe keys on the PHYSICAL block id (not the table + * position): a CoW prefix block shared by several branches gets one slot. Each + * sequence's compact table keeps its own block order and truncated context. */ + uint32_t g = 0; + for (uint32_t s = 0; s < ns; s++) { + uint32_t need = eff[s0 + s] ? (eff[s0 + s] + ly->block_size - 1) / ly->block_size : 0; + for (uint32_t b = 0; b < need; b++) { + uint32_t id = tables[s0 + s][b]; + if (g_dedupe) { + if (slot_of[id] < 0) { slot_of[id] = (int32_t)g; touched[g] = id; g++; } + tab[(size_t)s * maxb + b] = (uint32_t)slot_of[id]; + } else { + tab[(size_t)s * maxb + b] = g++; /* legacy: one slot per reference */ + } + } + tab[(size_t)ns * maxb + s] = eff[s0 + s]; + } + uint64_t staged_bytes = (uint64_t)(g ? g : 1) * ly->layer_stride_bytes; + if (staged_bytes > 0xffffffffull) { omega_gpu_host_free(tab); rc = OMEGA_GPU_ATTN_TOO_LARGE; break; } + void *host_tmp = NULL; + int stage_rc; + uint8_t *staged = stage_target((size_t)staged_bytes, &host_tmp, &stage_rc); + if (!staged) { omega_gpu_host_free(tab); rc = stage_rc; break; } + /* pass 2: copy each staged slot's (physical block, layer) slice exactly once */ + if (g_dedupe) { + for (uint32_t u = 0; u < g; u++) { + const uint8_t *src = pool + (size_t)touched[u] * ly->block_stride_bytes + (size_t)layer_idx * ly->layer_stride_bytes; + memcpy(staged + (size_t)u * ly->layer_stride_bytes, src, (size_t)ly->layer_stride_bytes); + slot_of[touched[u]] = -1; /* reset for the next launch */ + } + } else { + uint32_t w = 0; + for (uint32_t s = 0; s < ns; s++) { + uint32_t need = eff[s0 + s] ? (eff[s0 + s] + ly->block_size - 1) / ly->block_size : 0; + for (uint32_t b = 0; b < need; b++, w++) { + const uint8_t *src = pool + (size_t)tables[s0 + s][b] * ly->block_stride_bytes + (size_t)layer_idx * ly->layer_stride_bytes; + memcpy(staged + (size_t)w * ly->layer_stride_bytes, src, (size_t)ly->layer_stride_bytes); + } + } + } + if (info) { + info->kv_blocks_logical += total; info->kv_blocks_unique += g; + info->kv_bytes_staged += (uint64_t)g * ly->layer_stride_bytes; + info->kv_bytes_naive += (uint64_t)total * ly->layer_stride_bytes; + } + Launch L = { + .q = q + (size_t)s0 * row, .q_bytes = (size_t)ns * row * 4, .pool = staged, .pool_bytes = (size_t)staged_bytes, + .tab = tab, .tab_bytes = ((size_t)ns * maxb + ns) * 4, + .out = part, .out_bytes = (size_t)ns * num_q_heads * S * (HD + 2) * 4, + .grid_x = num_q_heads / heads_per_cta(HD, log2gqa), .grid_y = ns * S, + .params = { maxb, f2u(score_scale(HD)), (uint32_t)ly->layer_stride_bytes, (uint32_t)ly->token_stride_bytes, + (uint32_t)ly->kv_plane_stride_bytes, (uint32_t)ly->head_stride_bytes, num_q_heads, ns * maxb * 4 } + }; + rc = launch(ks, &L, info); + if (rc == OMEGA_GPU_ATTN_OK) combine_splits(part, out + (size_t)s0 * row, (size_t)ns * num_q_heads, S, HD); + omega_gpu_host_free(host_tmp); omega_gpu_host_free(tab); + } + UNLOCK(); + omega_gpu_host_free(eff); omega_gpu_host_free(slot_of); omega_gpu_host_free(touched); omega_gpu_host_free(part); + if (info) info->call_ns = now_ns() - t0; + return rc; +} + +int omega_gpu_paged_attention_bf16(const float *q, const void *pool, const OmegaGpuKvLayout *layout, + const uint32_t *block_ids, uint32_t num_block_ids, + uint32_t context_len, uint32_t layer_idx, + uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, + float *out, OmegaGpuAttnInfo *info) { + if (!q || !pool || !layout || !out || (num_block_ids && !block_ids)) return OMEGA_GPU_ATTN_BAD_ARGS; + const uint32_t *tables[1] = { block_ids }; + uint32_t nb[1] = { num_block_ids }, cx[1] = { context_len }; + return paged_core(q, pool, layout, tables, nb, cx, 1, layer_idx, num_q_heads, num_kv_heads, head_dim, out, info); +} + +int omega_gpu_paged_attention_batch_bf16(const float *q, const void *pool, const OmegaGpuKvLayout *layout, + const int32_t *block_tables, const int32_t *context_lens, + uint32_t max_blocks_per_seq, uint32_t num_seqs, uint32_t layer_idx, + uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, + float *out, OmegaGpuAttnInfo *info) { + if (!q || !pool || !layout || !out || !block_tables || !context_lens || num_seqs == 0) return OMEGA_GPU_ATTN_BAD_ARGS; + /* the oracle's rules: ctx <= 0 -> 0; a table row past the array -> empty; negatives removed */ + uint32_t **tables = omega_gpu_host_calloc(num_seqs, sizeof *tables); + uint32_t *nb = omega_gpu_host_calloc(num_seqs, sizeof *nb), *cx = omega_gpu_host_calloc(num_seqs, sizeof *cx); + if (!tables || !nb || !cx) { omega_gpu_host_free(tables); omega_gpu_host_free(nb); omega_gpu_host_free(cx); return OMEGA_GPU_ATTN_CHIP_FAIL; } + int rc = OMEGA_GPU_ATTN_OK; + for (uint32_t s = 0; s < num_seqs; s++) { + cx[s] = context_lens[s] > 0 ? (uint32_t)context_lens[s] : 0; + tables[s] = omega_gpu_host_calloc(max_blocks_per_seq ? max_blocks_per_seq : 1, sizeof **tables); + if (!tables[s]) { rc = OMEGA_GPU_ATTN_CHIP_FAIL; break; } + for (uint32_t b = 0; b < max_blocks_per_seq; b++) { + int32_t v = block_tables[(size_t)s * max_blocks_per_seq + b]; + if (v >= 0) tables[s][nb[s]++] = (uint32_t)v; + } + } + if (rc == OMEGA_GPU_ATTN_OK) + rc = paged_core(q, pool, layout, (const uint32_t *const *)tables, nb, cx, num_seqs, layer_idx, num_q_heads, num_kv_heads, head_dim, out, info); + for (uint32_t s = 0; s < num_seqs; s++) omega_gpu_host_free(tables[s]); + omega_gpu_host_free(tables); omega_gpu_host_free(nb); omega_gpu_host_free(cx); + return rc; +} + +static const char *const k_mutant_names[OMEGA_GPU_ATTN_MUTANT_COUNT] = { + "none", "NO_MAX", "KV_HEAD", "SLOT", "NO_RESCALE", "Q_ROW", "OUT_ROW" +}; +_Static_assert(sizeof k_mutant_names / sizeof k_mutant_names[0] == OMEGA_GPU_ATTN_MUTANT_COUNT, "mutant name table"); + +const char *omega_gpu_attention_mutant_name(OmegaGpuAttnMutant m) { + return (m >= 0 && m < OMEGA_GPU_ATTN_MUTANT_COUNT && k_mutant_names[m]) ? k_mutant_names[m] : "?"; +} + +const char *omega_gpu_attention_rc_name(int rc) { + switch (rc) { + case OMEGA_GPU_ATTN_OK: return "OK"; + case OMEGA_GPU_ATTN_BAD_ARGS: return "BAD_ARGS"; + case OMEGA_GPU_ATTN_TOO_LARGE: return "TOO_LARGE"; + case OMEGA_GPU_ATTN_CODEGEN_FAIL: return "CODEGEN_FAIL"; + case OMEGA_GPU_ATTN_CHIP_FAIL: return "CHIP_FAIL"; + case OMEGA_GPU_ATTN_UNWRITTEN: return "UNWRITTEN"; + default: return "UNKNOWN"; + } +} + +/* omega #308 R2 test hook: 0 production, 1 lane-dependent branch inside a reconvergence + * region, 2 the same with the BSYNC dropped (negative control). Clears the kernel cache. */ +void omega_gpu_attention_test_set_divergent(int mode) { + LOCK(); + g_divergent = (mode < 0 || mode > 2) ? 0 : mode; + cache_clear_locked(); + UNLOCK(); +} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.h b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.h new file mode 100644 index 000000000..3610af047 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/omega_gpu_attention_api.h @@ -0,0 +1,290 @@ +#ifndef OMEGA_GPU_ATTENTION_API_H +#define OMEGA_GPU_ATTENTION_API_H +/* + * omega_gpu_attention_api: native (no CUDA) decode attention for the AIEN + * inference stack (FB-1 cut 5, 2026-10-04). + * + * Two kernel families, one query per (sequence, query head), generated by our + * own codegen (src/omega_blackwell_codegen.c IR) and launched through the same + * chip-proven sequence as cuts 1b and 4: every buffer GPU-uncached (nvos.h + * NVOS32_ATTR2_GPU_CACHEABLE: system memory cached by the GPU is not coherent + * with CPU mappings), shader caches invalidated before the launch (clcec0.h + * NVCEC0_INVALIDATE_SHADER_CACHES, cut 1b finding), first marker, + * L2_FLUSH_DIRTY, second marker (C3 tail), poison-filled output scanned for + * unwritten words after readback. + * + * The math follows aien-sovereign-core crates/aien-inference-abi/src/backend.rs + * (ReferenceCpuBackend / TensorBackend defaults), read 2026-10-04 at main 8b5caed: + * gqa_attention(out, q, k_cache, v_cache, seq_len, num_q_heads, num_kv_heads, head_dim) + * k_cache / v_cache are f32 [seq_len][num_kv_heads][head_dim]; query head h reads + * kv head h / (num_q_heads / num_kv_heads); score = (q . k) / sqrt(head_dim); + * softmax over all seq_len tokens (no mask: one query attends to the whole history); + * out[h] = sum_t softmax_t v_t. seq_len == 0 writes zeros. + * paged_attention(out, q, pool, block_ids, context_len, layer_idx, ...) + * the KV pool is bf16 in aien-kv-cache's canonical layout (KvLayout strides in + * bytes: block, layer, kv plane (0 = K, 1 = V), token, head); token t lives in + * block_ids[t / block_size] at slot t % block_size; tokens whose block index is + * past the end of block_ids are dropped; context_len == 0 or no blocks writes zeros. + * paged_attention_batch: per sequence s, context_lens[s] <= 0 means 0, the block + * table row is block_tables[s*max_blocks .. (s+1)*max_blocks] (empty if that row + * runs past the array), negative entries are removed (the rest close up). + * + * Chip math: scores in f32 (FFMA over the head), online softmax per chunk of + * head_dim tokens: running max (FMNMX), p = EX2((s - m) * log2 e) folded into the + * score scale, rescale factor alpha = EX2(m_old - m_new), f32 sums, final MUFU.RCP. + * bf16 K is read as 32-bit pairs (LDG.E) and widened by a 16-bit shift (bf16 is + * the top half of an f32); bf16 V by LDG.E.U16 and the same shift. f32 K/V are + * read directly. Tolerances are stated and justified in tests/gpu_attention_test.c. + * + * Launch envelope: at most OMEGA_GPU_ATTN_MAX_CTAS / num_q_heads sequences per launch (investigation + * I42, same as cuts 1b and 4): grid = (num_q_heads, sequences per launch * context splits); the paged + * path adds up to 2^OMEGA_GPU_ATTN_MAX_LOG2SPLIT context splits per (sequence, head) within + * OMEGA_GPU_ATTN_SPLIT_MAX_CTAS (cut F, the rows path proved 1024 CTAs on the chip). + * Shared memory: the QMD declares 16 * head_dim bytes (clcec0qmd.h SHARED_MEMORY_SIZE_SHIFTED7, + * src/omega_blackwell_qmd.c word 36); the kernel uses exactly 4 arrays of head_dim words: + * 1024 bytes for head_dim 64 (TinyLlama, Llama-3.2-1B; the QMD default) and 2048 bytes for + * head_dim 128 (Qwen3-4B; GB10 parity PASS 126/0 at 7dd92dc, evidence/FB1-CUT5-HD128-7dd92dc). + * head_dim is a kernel parameter (64 or 128): threads per CTA = head_dim = chunk size, one warp + * partial per 32 threads in the softmax reductions. + * + * Staging: the host copies q, the referenced KV blocks' layer slice, the (compacted, + * renumbered) block tables and the context lengths into GPU-uncached staging buffers + * for each launch and copies the result back. The kernel itself walks the block + * table. Resident pool (2026-10-12): a paged call whose pool pointer is the allocation + * omega_gpu_attention_pool_alloc returned reads the KV in place instead (no staging; see + * that declaration for the one rule). Since the attention hardening cut + * (2026-10-04) a launch stages each physical block's layer slice once however many + * sequences of the batch reference it (shared CoW prefixes), and OmegaGpuAttnInfo + * reports the bytes staged against the per-sequence (naive) figure. + * + * Cut 4b (2026-10-04): the device, channel and launch scratch are the process-wide + * session shared with the matmul and elementwise APIs (omega_gpu_session.h): one + * open per process instead of one per call (~40 ms), kernels resident after first + * use, staging buffers reused at their high-water mark (the KV slice is written + * straight into the device staging buffer). Calls serialise on one lock. + */ +#include +#include +#include +#include "omega_blackwell_matmul.h" /* OmegaBlackwellKernel */ +#ifdef __cplusplus +extern "C" { +#endif + +enum { + OMEGA_GPU_ATTN_OK = 0, + OMEGA_GPU_ATTN_BAD_ARGS = -1, /* NULL pointer, zero dimension, head mapping or block id out of range */ + OMEGA_GPU_ATTN_TOO_LARGE = -2, /* head_dim not in {64, 128}, num_q_heads > 64, context past the envelope */ + OMEGA_GPU_ATTN_CODEGEN_FAIL = -3, /* our codegen refused or exceeded the register budget */ + OMEGA_GPU_ATTN_CHIP_FAIL = -4, /* device open, alloc, submit, marker or release failed */ + OMEGA_GPU_ATTN_UNWRITTEN = -5 /* output words still equal to their poison after the run */ +}; + +#define OMEGA_GPU_ATTN_HEAD_DIM 64u /* the original head_dim; threads per CTA = head_dim (one thread per dimension / per token of a chunk) */ +#define OMEGA_GPU_ATTN_HEAD_DIM_128 128u /* the second supported head_dim (Qwen3-4B) */ +#define OMEGA_GPU_ATTN_MAX_CTAS 64u +/* Cut F (2026-10-12): a paged call splits each (sequence, head) over up to 2^MAX_LOG2SPLIT CTAs along the context + * (whole chunks each, at least one chunk per split since cut J, 2026-10-12, which also raised the cap from 8 to 16: at + * 1268 tokens the busiest CTA went from three chunks to two; the launch takes the largest count in the batch) within + * SPLIT_MAX_CTAS CTAs per launch (the rows path proved 1024 on the chip); the CTAs write unnormalised partials + * (acc[head_dim], running max, running sum) that the host combines, also when the split is 1 (the gqa f32 and rows + * kernels keep the direct output and are byte for byte the ones before). Each sequence picks its own split count + * from its own context, so a result never depends on the other sequences in a launch. */ +#define OMEGA_GPU_ATTN_MAX_LOG2SPLIT 4u +#define OMEGA_GPU_ATTN_SPLIT_MAX_CTAS 1024u +#define OMEGA_GPU_ATTN_MAX_Q_HEADS 64u +#define OMEGA_GPU_ATTN_MAX_GQA_CTX 4096u /* contiguous path: one block of 2^12 slots */ + +/* Mirror of aien-kv-cache KvLayoutDesc (crates/aien-kv-cache/src/lib.rs, main 8b5caed), + * field for field, strides in bytes. */ +typedef struct { + uint64_t block_stride_bytes; + uint64_t layer_stride_bytes; + uint64_t kv_plane_stride_bytes; + uint64_t token_stride_bytes; + uint64_t head_stride_bytes; + uint64_t pool_bytes; + uint32_t num_blocks; + uint32_t num_layers; + uint32_t block_size; /* must be a power of two (the kernel shifts and masks) */ +} OmegaGpuKvLayout; + +typedef struct { + uint32_t chip_calls; /* launches made */ + uint64_t elapsed_ns; /* sum of submit-to-second-marker over the launches */ + uint64_t call_ns; /* wall time of the whole API call (staging, launches, copy-out) */ + uint32_t completion_marker; /* first marker word of the last launch */ + uint32_t unwritten_words; /* poison words left in the outputs (0 on OK) */ + uint32_t gpr_count, insn_count; + bool kernel_cache_hit; /* the kernel was already generated */ + uint32_t ctas_last_launch, threads_per_cta; + char target_chip[64]; + uint32_t sm_architecture; + /* Appended (attention hardening cut, 2026-10-04): transfer accounting for the call. + * Existing field order above is ABI; sovereign-core mirrors this struct field for field. */ + uint64_t kv_bytes_staged; /* KV layer-slice bytes actually copied into staging (sum over launches) */ + uint64_t kv_bytes_naive; /* what per-sequence staging would have copied (every sequence its own blocks) */ + uint32_t kv_blocks_logical; /* block references summed over sequences, truncated to each context */ + uint32_t kv_blocks_unique; /* distinct (physical block, layer) slices staged, summed over launches */ + uint64_t q_bytes, tab_bytes, out_bytes; /* q, block-table/context and result traffic (sum over launches) */ + uint32_t kv_source; /* OMEGA_GPU_ATTN_KV_STAGED (slices copied per call) or OMEGA_GPU_ATTN_KV_RESIDENT (read in place) */ +} OmegaGpuAttnInfo; +#define OMEGA_GPU_ATTN_KV_STAGED 0u +#define OMEGA_GPU_ATTN_KV_RESIDENT 1u + +/* Contiguous f32 KV (TensorBackend::gqa_attention). q and out: [num_q_heads][head_dim]. */ +int omega_gpu_gqa_attention_f32(const float *q, const float *k_cache, const float *v_cache, + uint32_t seq_len, uint32_t num_q_heads, uint32_t num_kv_heads, + uint32_t head_dim, float *out, OmegaGpuAttnInfo *info); + +/* Contiguous f32 KV, many query rows in one call (the prompt read, 2026-10-12). q and out are + * [num_rows][num_q_heads][head_dim]; k_cache and v_cache hold base_len + num_rows tokens as + * [token][num_kv_heads][head_dim]. Row i attends over the first base_len + i + 1 tokens (causal: + * its own token and everything before it). The KV is staged once per call; the rows go to the + * chip in launches of up to OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads rows (grid y = row, the + * same kernel as omega_gpu_gqa_attention_f32, so one row per launch is bit-identical to that + * call). Under a serving reservation the rows per launch are also bounded by the q buffer + * omega_gpu_attention_reserve_rows sized. base_len + num_rows <= OMEGA_GPU_ATTN_MAX_GQA_CTX. */ +#define OMEGA_GPU_ATTN_ROWS_MAX_CTAS 1024u +int omega_gpu_gqa_attention_rows_f32(const float *q, const float *k_cache, const float *v_cache, + uint32_t base_len, uint32_t num_rows, uint32_t num_q_heads, + uint32_t num_kv_heads, uint32_t head_dim, float *out, + OmegaGpuAttnInfo *info); + +/* Paged bf16 KV (TensorBackend::paged_attention). pool points at the pool base. */ +int omega_gpu_paged_attention_bf16(const float *q, const void *pool, const OmegaGpuKvLayout *layout, + const uint32_t *block_ids, uint32_t num_block_ids, + uint32_t context_len, uint32_t layer_idx, + uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, + float *out, OmegaGpuAttnInfo *info); + +/* Batched (TensorBackend::paged_attention_batch). block_tables: [num_seqs][max_blocks_per_seq] i32 + * (negative = none), context_lens: [num_seqs] i32. q and out: [num_seqs][num_q_heads][head_dim]. */ +int omega_gpu_paged_attention_batch_bf16(const float *q, const void *pool, const OmegaGpuKvLayout *layout, + const int32_t *block_tables, const int32_t *context_lens, + uint32_t max_blocks_per_seq, uint32_t num_seqs, uint32_t layer_idx, + uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, + float *out, OmegaGpuAttnInfo *info); + +/* Resident KV pool (2026-10-12). One GPU-uncached, host-visible allocation of `bytes` that the caller + * writes its paged bf16 KV into directly (sovereign-core's pool buffer). A paged call whose `pool` + * pointer is this allocation reads the KV in place: nothing is staged, the block table carries the + * physical block ids and the kernel's block stride is the layout's block stride. The kernel forms + * block_id * block_stride + the in-block offsets in 32 bits, so a call takes the resident path only + * when block_stride_bytes and, for every block it references, block_id * block_stride_bytes + + * layer_stride_bytes fit in 32 bits, and the layout's pool_bytes fit the allocation; otherwise that + * call stages exactly as before. OmegaGpuAttnInfo.kv_source says which path ran. One pool per + * process: a second alloc is refused (BAD_ARGS) until omega_gpu_attention_pool_free. The alloc opens + * the session (CHIP_FAIL carries the driver text in omega_gpu_attention_last_error()); under the host + * simulator it is plain host memory. The caller must not free the pool while a call is in flight. */ +int omega_gpu_attention_pool_alloc(size_t bytes, void **cpu); +void omega_gpu_attention_pool_free(void); + +const char *omega_gpu_attention_rc_name(int rc); +void omega_gpu_attention_cache_clear(void); + +/* OPT-IN serving reservation (omega_gpu_reserve_serving in omega_gpu_serving.h calls this). Allocates the KV staging + * pool (2 planes f32, 8 KiB per token at 8 kv heads x 128), q, output and table buffers once for contexts up to + * max_context and up to max_seqs sequences per call. A later call that fits never allocates; one that does not + * returns OMEGA_GPU_ATTN_TOO_LARGE ("serving reservation exceeded" in omega_gpu_attention_last_error()) and asks the + * driver for nothing. Never called = behaviour unchanged. The f32 contiguous path still refuses contexts past + * OMEGA_GPU_ATTN_MAX_GQA_CTX on its own. kv_block_size (power of two, 0 = no paged use) sizes the pool for the paged bf16 + * path too: it stages whole blocks, so under half a block of context it needs more than the f32 formula. The pool is + * sized in BYTES for the larger of the two paths: the paged path therefore admits up to about 2 x max_context tokens + * (whole blocks of the same bytes); what it refuses is a call whose staging exceeds the reserved bytes. max_seqs is + * checked per launch chunk (the batched call splits sequences into chunks of 64 / num_q_heads), so a call with more + * sequences than max_seqs succeeds when every chunk fits. A paged or batched call refused on a LATER chunk has already + * written the outputs of the earlier chunks: treat TOO_LARGE as "output incomplete". If the reserve fails part way it + * rolls back: none of this API's buffers stays flagged. 0 on success, else an OMEGA_GPU_ATTN_* code. */ +int omega_gpu_attention_reserve(uint32_t max_context, uint32_t max_seqs, uint32_t num_q_heads, uint32_t num_kv_heads, uint32_t head_dim, uint32_t kv_block_size); +/* Grows the reservation's q, output and table buffers (never shrinks them) so that + * omega_gpu_gqa_attention_rows_f32 can send min(max_rows, OMEGA_GPU_ATTN_ROWS_MAX_CTAS / num_q_heads) + * rows per launch. The KV staging pool is untouched: the rows of one call share one staged context, + * which omega_gpu_attention_reserve already sized for max_context tokens. Call it after + * omega_gpu_attention_reserve (omega_gpu_reserve_serving does, with its max_rows). Without it the + * rows path still works under a reservation, in launches of as many rows as the q buffer holds. */ +int omega_gpu_attention_reserve_rows(uint32_t max_rows, uint32_t num_q_heads, uint32_t head_dim); +void omega_gpu_attention_unreserve(void); + +/* Stage name of the most recent CHIP_FAIL ("" if none), shared with the other GPU APIs + * (omega_gpu_session_last_error); an open failure carries the driver text. */ +const char *omega_gpu_attention_last_error(void); + +/* Test hooks. Mutants are deliberately wrong kernels the parity test must catch; + * never set in production. */ +typedef enum { + OMEGA_GPU_ATTN_MUTANT_NONE = 0, + OMEGA_GPU_ATTN_MUTANT_NO_MAX, /* softmax without the running-max subtraction (overflows for large scores) */ + OMEGA_GPU_ATTN_MUTANT_KV_HEAD, /* reads kv head (h / ratio) ^ 1 */ + OMEGA_GPU_ATTN_MUTANT_SLOT, /* K read from slot (t + 1) % block_size while V keeps slot t (K/V mismatch) */ + OMEGA_GPU_ATTN_MUTANT_NO_RESCALE, /* the accumulator is not rescaled when the max moves between chunks */ + /* Head-wiring mutants (attention hardening cut, 2026-10-04). Both swap the rows of + * query heads h and h ^ 1, so they need num_q_heads even (>= 2); never run them on a + * one-head shape (row h ^ 1 of the last sequence would be past the buffer). */ + OMEGA_GPU_ATTN_MUTANT_Q_ROW, /* q loaded from query-head row h ^ 1 (kv head and output row stay h) */ + OMEGA_GPU_ATTN_MUTANT_OUT_ROW, /* the correct result for head h stored in flattened output row h ^ 1 */ + OMEGA_GPU_ATTN_MUTANT_COUNT /* one past the last mutant: every battery enumerates 1 .. COUNT-1 */ +} OmegaGpuAttnMutant; +void omega_gpu_attention_test_set_mutant(OmegaGpuAttnMutant m); + +/* TEST ONLY (omega #308 regression R2). 0 = production branch-free chunk loop; 1 = the + * lane-dependent j >= ctx branch restored inside a BSSY/BSYNC reconvergence region; + * 2 = that kernel with the BSYNC dropped (negative control: the host simulator must refuse + * it). Clears the kernel cache. */ +void omega_gpu_attention_test_set_divergent(int mode); +/* "none", "NO_MAX", ... ; "?" past COUNT. The table is checked against COUNT at compile time. */ +const char *omega_gpu_attention_mutant_name(OmegaGpuAttnMutant m); + +/* Generate a kernel without launching (host tests, nvdisasm listings). + * log2_block_size: shift for token -> block; log2_gqa: shift for query head -> kv head. */ +int omega_gpu_attention_codegen(bool kv_f32, uint32_t log2_block_size, uint32_t log2_gqa, + OmegaBlackwellKernel *kernel); + +/* The same with an explicit head_dim (64 or 128; anything else is TOO_LARGE). The 4-argument + * omega_gpu_attention_codegen above is head_dim 64 and emits the same bytes as before head_dim 128 existed. */ +int omega_gpu_attention_codegen_hd(bool kv_f32, uint32_t log2_block_size, uint32_t log2_gqa, uint32_t head_dim, + OmegaBlackwellKernel *kernel); + +/* One launch as the launcher sees it (test hook below). Pointers are host buffers; + * params are the eight argument words after the four buffer addresses: + * max_blocks, scale bits, block stride, token stride, kv plane stride, head stride, + * num_q_heads, context-array byte offset. */ +typedef struct { + const void *q; size_t q_bytes; + const void *pool; size_t pool_bytes; + const void *tab; size_t tab_bytes; + void *out; size_t out_bytes; + uint32_t grid_x, grid_y; + uint32_t params[8]; + uint64_t pool_va; /* resident pool: chip address of the layer base (`pool` is its host mapping, pool_bytes 0); 0 = stage `pool` */ +} OmegaGpuAttnLaunch; + +/* Host simulator hook (tests): when set, every launch runs the allocated IR program + * through `sim` instead of the chip. Lets the whole battery run on the host first + * (review before chip time). The program is post register allocation. */ +struct BlackwellIRProgramTag; +typedef int (*OmegaGpuAttnSim)(const void *prog /* const BlackwellIRProgram * */, const OmegaGpuAttnLaunch *L, OmegaGpuAttnInfo *info); +void omega_gpu_attention_test_set_simulator(OmegaGpuAttnSim sim); +/* The shared memory the launcher declares for the kernel the simulator is running (set before each simulated launch). */ +uint32_t omega_gpu_attention_test_shared_bytes(void); +/* Query heads one CTA serves (cut K): hd 128 groups min(2^log2_gqa, 4) heads of one kv head; hd 64 keeps one head per CTA. */ +uint32_t omega_gpu_attention_heads_per_cta(uint32_t head_dim, uint32_t log2_gqa); + +/* Shared-prefix staging dedupe (attention hardening cut, 2026-10-04): within one launch + * every (physical block, layer) slice referenced by the batch is staged once, keyed by the + * physical block id, and every sequence's compact table points at that one staged slot. + * On by default. `false` selects the legacy per-sequence staging (every sequence copies + * its own blocks), kept as the reference fallback and as the negative control of the + * staging-byte tests. Test hook; never cleared in production. */ +void omega_gpu_attention_test_set_dedupe(bool on); +/* Test hook: force the context split (log2, 0 = one CTA per head) on every paged call; -1 = automatic. */ +void omega_gpu_attention_test_set_split(int log2split); + +/* The resident pool's per-block fit rule (see omega_gpu_attention_pool_alloc), exposed so the + * 4 GiB edge can be checked without allocating a 4 GiB pool. Test hook. */ +bool omega_gpu_attention_test_resident_fits(const OmegaGpuKvLayout *layout, uint32_t block_id); + +#ifdef __cplusplus +} +#endif +#endif /* OMEGA_GPU_ATTENTION_API_H */ diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/receipt.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/receipt.json new file mode 100644 index 000000000..1ec3367ca --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/receipt.json @@ -0,0 +1 @@ +{"schema":"OMEGA_GPU_ATTENTION_V1","tolerances":{"rel":2e-4,"abs":2e-5,"large_scores_rel":1e-3,"large_scores_abs":1e-4},"cases":[{"case":"gqa_f32_tinyllama_32q4kv_ctx1","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0,"pass":true,"chip_elapsed_ns":195602,"call_ns":134747908,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2048,"kv_bytes_naive":2048,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_tinyllama_32q4kv_ctx17","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00189431,"pass":true,"chip_elapsed_ns":103569,"call_ns":226706,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":34816,"kv_bytes_naive":34816,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_tinyllama_32q4kv_ctx256","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00189409,"pass":true,"chip_elapsed_ns":106018,"call_ns":334004,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":524288,"kv_bytes_naive":524288,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_tinyllama_32q4kv_ctx2048","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.0028582,"pass":true,"chip_elapsed_ns":519574,"call_ns":1142284,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":4194304,"kv_bytes_naive":4194304,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":4,"mutants_caught":4,"mutant_note":"SLOT:CAUGHT(rc=OK,bad=2041) NO_RESCALE:CAUGHT(rc=OK,bad=1959) Q_ROW:CAUGHT(rc=OK,bad=2048) OUT_ROW:CAUGHT(rc=OK,bad=2048)"},{"case":"gqa_f32_tinyllama_32q4kv_ctx65","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00174821,"pass":true,"chip_elapsed_ns":104209,"call_ns":212866,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":133120,"kv_bytes_naive":133120,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_tinyllama_32q4kv_ctx128","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00197914,"pass":true,"chip_elapsed_ns":103505,"call_ns":108289,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":262144,"kv_bytes_naive":262144,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_tinyllama_32q4kv_ctx129","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00177573,"pass":true,"chip_elapsed_ns":103249,"call_ns":108033,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":264192,"kv_bytes_naive":264192,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_tinyllama_32q4kv_ctx300","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00259576,"pass":true,"chip_elapsed_ns":207906,"call_ns":216434,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":614400,"kv_bytes_naive":614400,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_tinyllama_32q4kv_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00247545,"pass":true,"chip_elapsed_ns":331540,"call_ns":364036,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2048000,"kv_bytes_naive":2048000,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_llama32_1b_32q8kv_ctx1","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0,"pass":true,"chip_elapsed_ns":104529,"call_ns":210226,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":4096,"kv_bytes_naive":4096,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_llama32_1b_32q8kv_ctx17","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00174276,"pass":true,"chip_elapsed_ns":95857,"call_ns":99025,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":69632,"kv_bytes_naive":69632,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":1,"mutants_caught":1,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2048)"},{"case":"gqa_f32_llama32_1b_32q8kv_ctx256","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00161378,"pass":true,"chip_elapsed_ns":106193,"call_ns":221331,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":1048576,"kv_bytes_naive":1048576,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_llama32_1b_32q8kv_ctx2048","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.0029454,"pass":true,"chip_elapsed_ns":501589,"call_ns":1637889,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":8388608,"kv_bytes_naive":8388608,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":4,"mutants_caught":4,"mutant_note":"SLOT:CAUGHT(rc=OK,bad=2045) NO_RESCALE:CAUGHT(rc=OK,bad=1904) Q_ROW:CAUGHT(rc=OK,bad=2042) OUT_ROW:CAUGHT(rc=OK,bad=2042)"},{"case":"gqa_f32_llama32_1b_32q8kv_ctx65","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.0014332,"pass":true,"chip_elapsed_ns":201938,"call_ns":324771,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":266240,"kv_bytes_naive":266240,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_llama32_1b_32q8kv_ctx128","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00186415,"pass":true,"chip_elapsed_ns":106753,"call_ns":116401,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":524288,"kv_bytes_naive":524288,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_llama32_1b_32q8kv_ctx129","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00185519,"pass":true,"chip_elapsed_ns":104225,"call_ns":111905,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":528384,"kv_bytes_naive":528384,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_llama32_1b_32q8kv_ctx300","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00162705,"pass":true,"chip_elapsed_ns":208019,"call_ns":228259,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":1228800,"kv_bytes_naive":1228800,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_f32_llama32_1b_32q8kv_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00330327,"pass":true,"chip_elapsed_ns":313011,"call_ns":397092,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":4096000,"kv_bytes_naive":4096000,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_rows_f32_tinyllama_32q4kv_base0_rows1","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0,"pass":true,"chip_elapsed_ns":105313,"call_ns":276339,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2048,"kv_bytes_naive":2048,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_rows_f32_tinyllama_32q4kv_base17_rows5","n":10240,"rc":"OK","violations":0,"worst_scaled_err":0.00298047,"pass":true,"chip_elapsed_ns":104545,"call_ns":343875,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":45056,"kv_bytes_naive":225280,"kv_blocks_unique":1,"kv_blocks_logical":5,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_rows_f32_tinyllama_32q4kv_base300_rows40","n":81920,"rc":"OK","violations":0,"worst_scaled_err":0.00332929,"pass":true,"chip_elapsed_ns":635718,"call_ns":993450,"chip_calls":2,"unwritten_words":0,"kv_bytes_staged":696320,"kv_bytes_naive":27852800,"kv_blocks_unique":1,"kv_blocks_logical":40,"mutants_run":4,"mutants_caught":4,"mutant_note":"SLOT:CAUGHT(rc=OK,bad=81807) NO_RESCALE:CAUGHT(rc=OK,bad=64191) Q_ROW:CAUGHT(rc=OK,bad=81812) OUT_ROW:CAUGHT(rc=OK,bad=81812)"},{"case":"gqa_rows_f32_llama32_1b_32q8kv_base0_rows1","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0,"pass":true,"chip_elapsed_ns":104977,"call_ns":196178,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":4096,"kv_bytes_naive":4096,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_rows_f32_llama32_1b_32q8kv_base17_rows5","n":10240,"rc":"OK","violations":0,"worst_scaled_err":0.00177684,"pass":true,"chip_elapsed_ns":104193,"call_ns":113473,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":90112,"kv_bytes_naive":450560,"kv_blocks_unique":1,"kv_blocks_logical":5,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"gqa_rows_f32_llama32_1b_32q8kv_base300_rows40","n":81920,"rc":"OK","violations":0,"worst_scaled_err":0.00325614,"pass":true,"chip_elapsed_ns":830184,"call_ns":913674,"chip_calls":2,"unwritten_words":0,"kv_bytes_staged":1392640,"kv_bytes_naive":55705600,"kv_blocks_unique":1,"kv_blocks_logical":40,"mutants_run":4,"mutants_caught":4,"mutant_note":"SLOT:CAUGHT(rc=OK,bad=81806) NO_RESCALE:CAUGHT(rc=OK,bad=65973) Q_ROW:CAUGHT(rc=OK,bad=81824) OUT_ROW:CAUGHT(rc=OK,bad=81824)"},{"case":"gqa_f32_large_scores_32q4kv_ctx256","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.0830785,"pass":true,"chip_elapsed_ns":106402,"call_ns":239379,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":524288,"kv_bytes_naive":524288,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":1,"mutants_caught":1,"mutant_note":"NO_MAX:CAUGHT(rc=OK,bad=2048)"},{"case":"gqa_f32_mha_16q16kv_ctx300","n":1024,"rc":"OK","violations":0,"worst_scaled_err":0.00184,"pass":true,"chip_elapsed_ns":107921,"call_ns":282483,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2457600,"kv_bytes_naive":2457600,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":3,"mutants_caught":3,"mutant_note":"Q_ROW:CAUGHT(rc=OK,bad=1024) OUT_ROW:CAUGHT(rc=OK,bad=1020) KV_HEAD:CAUGHT(rc=OK,bad=1023)"},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx1","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0,"pass":true,"chip_elapsed_ns":106177,"call_ns":212066,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":16384,"kv_bytes_naive":16384,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":1,"mutants_caught":1,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2048)"},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx17","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00158694,"pass":true,"chip_elapsed_ns":104193,"call_ns":198946,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":32768,"kv_bytes_naive":32768,"kv_blocks_unique":2,"kv_blocks_logical":2,"mutants_run":2,"mutants_caught":2,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2047)"},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx256","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00106953,"pass":true,"chip_elapsed_ns":105329,"call_ns":251843,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":262144,"kv_bytes_naive":262144,"kv_blocks_unique":16,"kv_blocks_logical":16,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx2048","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.000545881,"pass":true,"chip_elapsed_ns":212946,"call_ns":457732,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2097152,"kv_bytes_naive":2097152,"kv_blocks_unique":128,"kv_blocks_logical":128,"mutants_run":5,"mutants_caught":5,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2047) SLOT:CAUGHT(rc=OK,bad=2038) NO_RESCALE:CAUGHT(rc=OK,bad=1901) Q_ROW:CAUGHT(rc=OK,bad=2046) OUT_ROW:CAUGHT(rc=OK,bad=2046)"},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx65","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00144367,"pass":true,"chip_elapsed_ns":104465,"call_ns":246179,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":81920,"kv_bytes_naive":81920,"kv_blocks_unique":5,"kv_blocks_logical":5,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx128","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00159999,"pass":true,"chip_elapsed_ns":104641,"call_ns":112449,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":131072,"kv_bytes_naive":131072,"kv_blocks_unique":8,"kv_blocks_logical":8,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx129","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00170812,"pass":true,"chip_elapsed_ns":105089,"call_ns":112673,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":147456,"kv_bytes_naive":147456,"kv_blocks_unique":9,"kv_blocks_logical":9,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx300","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00140672,"pass":true,"chip_elapsed_ns":106225,"call_ns":254947,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":311296,"kv_bytes_naive":311296,"kv_blocks_unique":19,"kv_blocks_logical":19,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_tinyllama_32q4kv_bs16_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00143935,"pass":true,"chip_elapsed_ns":106705,"call_ns":282195,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":163840,"kv_bytes_naive":1032192,"kv_blocks_unique":10,"kv_blocks_logical":63,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx1","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0,"pass":true,"chip_elapsed_ns":106994,"call_ns":231139,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":32768,"kv_bytes_naive":32768,"kv_blocks_unique":1,"kv_blocks_logical":1,"mutants_run":1,"mutants_caught":1,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2048)"},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx17","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00205197,"pass":true,"chip_elapsed_ns":104529,"call_ns":217362,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":65536,"kv_bytes_naive":65536,"kv_blocks_unique":2,"kv_blocks_logical":2,"mutants_run":2,"mutants_caught":2,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2046) SLOT:CAUGHT(rc=OK,bad=2048)"},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx256","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00105953,"pass":true,"chip_elapsed_ns":106145,"call_ns":265762,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":524288,"kv_bytes_naive":524288,"kv_blocks_unique":16,"kv_blocks_logical":16,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx2048","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00055855,"pass":true,"chip_elapsed_ns":211762,"call_ns":530549,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":4194304,"kv_bytes_naive":4194304,"kv_blocks_unique":128,"kv_blocks_logical":128,"mutants_run":5,"mutants_caught":5,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2044) NO_RESCALE:CAUGHT(rc=OK,bad=1963) Q_ROW:CAUGHT(rc=OK,bad=2048) OUT_ROW:CAUGHT(rc=OK,bad=2048)"},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx65","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00171737,"pass":true,"chip_elapsed_ns":106449,"call_ns":246723,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":163840,"kv_bytes_naive":163840,"kv_blocks_unique":5,"kv_blocks_logical":5,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx128","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00153626,"pass":true,"chip_elapsed_ns":105169,"call_ns":114449,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":262144,"kv_bytes_naive":262144,"kv_blocks_unique":8,"kv_blocks_logical":8,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx129","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00162582,"pass":true,"chip_elapsed_ns":105537,"call_ns":115265,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":294912,"kv_bytes_naive":294912,"kv_blocks_unique":9,"kv_blocks_logical":9,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx300","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00144548,"pass":true,"chip_elapsed_ns":106753,"call_ns":243954,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":622592,"kv_bytes_naive":622592,"kv_blocks_unique":19,"kv_blocks_logical":19,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_llama32_1b_32q8kv_bs16_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00094646,"pass":true,"chip_elapsed_ns":197186,"call_ns":401028,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":327680,"kv_bytes_naive":2064384,"kv_blocks_unique":10,"kv_blocks_logical":63,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split1_32q8kv_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.0028454,"pass":true,"chip_elapsed_ns":212482,"call_ns":369044,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2064384,"kv_bytes_naive":2064384,"kv_blocks_unique":63,"kv_blocks_logical":63,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split2_32q8kv_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00202911,"pass":true,"chip_elapsed_ns":206658,"call_ns":251714,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2064384,"kv_bytes_naive":2064384,"kv_blocks_unique":63,"kv_blocks_logical":63,"mutants_run":2,"mutants_caught":2,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2041)"},{"case":"paged_bf16_split4_32q8kv_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00111551,"pass":true,"chip_elapsed_ns":208882,"call_ns":355540,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2064384,"kv_bytes_naive":2064384,"kv_blocks_unique":63,"kv_blocks_logical":63,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split8_32q8kv_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.000737182,"pass":true,"chip_elapsed_ns":210722,"call_ns":368692,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2064384,"kv_bytes_naive":2064384,"kv_blocks_unique":63,"kv_blocks_logical":63,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split16_32q8kv_ctx1000","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.000577315,"pass":true,"chip_elapsed_ns":210370,"call_ns":379828,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":2064384,"kv_bytes_naive":2064384,"kv_blocks_unique":63,"kv_blocks_logical":63,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split1_32q8kv_ctx100","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.0018292,"pass":true,"chip_elapsed_ns":103873,"call_ns":202674,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":65536,"kv_bytes_naive":229376,"kv_blocks_unique":2,"kv_blocks_logical":7,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split2_32q8kv_ctx100","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00134618,"pass":true,"chip_elapsed_ns":82433,"call_ns":88641,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":65536,"kv_bytes_naive":229376,"kv_blocks_unique":2,"kv_blocks_logical":7,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split4_32q8kv_ctx100","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00134618,"pass":true,"chip_elapsed_ns":103985,"call_ns":114193,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":65536,"kv_bytes_naive":229376,"kv_blocks_unique":2,"kv_blocks_logical":7,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split8_32q8kv_ctx100","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00134618,"pass":true,"chip_elapsed_ns":103521,"call_ns":121522,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":65536,"kv_bytes_naive":229376,"kv_blocks_unique":2,"kv_blocks_logical":7,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_split16_32q8kv_ctx100","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00134618,"pass":true,"chip_elapsed_ns":103217,"call_ns":136881,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":65536,"kv_bytes_naive":229376,"kv_blocks_unique":2,"kv_blocks_logical":7,"mutants_run":0,"mutants_caught":0,"mutant_note":""},{"case":"paged_bf16_batch_3seq_32q8kv_ctx40_0_100","n":6144,"rc":"OK","violations":0,"worst_scaled_err":0.00173417,"pass":true,"chip_elapsed_ns":209346,"call_ns":221522,"chip_calls":2,"unwritten_words":0,"kv_bytes_staged":229376,"kv_bytes_naive":229376,"kv_blocks_unique":7,"kv_blocks_logical":7,"mutants_run":4,"mutants_caught":4,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=4095) SLOT:CAUGHT(rc=OK,bad=4095) Q_ROW:CAUGHT(rc=OK,bad=4092) OUT_ROW:CAUGHT(rc=OK,bad=4092)"},{"case":"paged_bf16_shared_prefix_4seq_8q2kv_10pre","n":2048,"rc":"OK","violations":0,"worst_scaled_err":0.00136352,"pass":true,"chip_elapsed_ns":112689,"call_ns":253522,"chip_calls":1,"unwritten_words":0,"kv_bytes_staged":155648,"kv_bytes_naive":401408,"kv_blocks_unique":19,"kv_blocks_logical":49,"mutants_run":2,"mutants_caught":2,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2046)"},{"case":"paged_bf16_shared_prefix_4seq_32q8kv_10pre","n":8192,"rc":"OK","violations":0,"worst_scaled_err":0.00205105,"pass":true,"chip_elapsed_ns":210274,"call_ns":390900,"chip_calls":2,"unwritten_words":0,"kv_bytes_staged":950272,"kv_bytes_naive":1605632,"kv_blocks_unique":29,"kv_blocks_logical":49,"mutants_run":2,"mutants_caught":2,"mutant_note":"KV_HEAD:CAUGHT(rc=OK,bad=8190) SLOT:CAUGHT(rc=OK,bad=8186)"}],"mutant_count":6,"mutants":{"NO_MAX":{"run":1,"caught":1},"KV_HEAD":{"run":12,"caught":12},"SLOT":{"run":12,"caught":12},"NO_RESCALE":{"run":6,"caught":6},"Q_ROW":{"run":8,"caught":8},"OUT_ROW":{"run":8,"caught":8}},"device_opens":1,"checks":219,"failed":0,"verdict":"OMEGA_GPU_ATTENTION_PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/run.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/run.log new file mode 100644 index 000000000..b85688366 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/run.log @@ -0,0 +1,65 @@ +PASS gqa_f32_tinyllama_32q4kv_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=195602 call_ns=134747908 calls=1 unwritten=0 kv_staged=2048/2048 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00189431 chip_ns=103569 call_ns=226706 calls=1 unwritten=0 kv_staged=34816/34816 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.00189409 chip_ns=106018 call_ns=334004 calls=1 unwritten=0 kv_staged=524288/524288 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.0028582 chip_ns=519574 call_ns=1142284 calls=1 unwritten=0 kv_staged=4194304/4194304 blocks=1/1 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=2041) NO_RESCALE:CAUGHT(rc=OK,bad=1959) Q_ROW:CAUGHT(rc=OK,bad=2048) OUT_ROW:CAUGHT(rc=OK,bad=2048) +PASS gqa_f32_tinyllama_32q4kv_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.00174821 chip_ns=104209 call_ns=212866 calls=1 unwritten=0 kv_staged=133120/133120 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00197914 chip_ns=103505 call_ns=108289 calls=1 unwritten=0 kv_staged=262144/262144 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.00177573 chip_ns=103249 call_ns=108033 calls=1 unwritten=0 kv_staged=264192/264192 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00259576 chip_ns=207906 call_ns=216434 calls=1 unwritten=0 kv_staged=614400/614400 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00247545 chip_ns=331540 call_ns=364036 calls=1 unwritten=0 kv_staged=2048000/2048000 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=104529 call_ns=210226 calls=1 unwritten=0 kv_staged=4096/4096 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00174276 chip_ns=95857 call_ns=99025 calls=1 unwritten=0 kv_staged=69632/69632 blocks=1/1 | mutants 1/1 KV_HEAD:CAUGHT(rc=OK,bad=2048) +PASS gqa_f32_llama32_1b_32q8kv_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.00161378 chip_ns=106193 call_ns=221331 calls=1 unwritten=0 kv_staged=1048576/1048576 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.0029454 chip_ns=501589 call_ns=1637889 calls=1 unwritten=0 kv_staged=8388608/8388608 blocks=1/1 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=2045) NO_RESCALE:CAUGHT(rc=OK,bad=1904) Q_ROW:CAUGHT(rc=OK,bad=2042) OUT_ROW:CAUGHT(rc=OK,bad=2042) +PASS gqa_f32_llama32_1b_32q8kv_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.0014332 chip_ns=201938 call_ns=324771 calls=1 unwritten=0 kv_staged=266240/266240 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00186415 chip_ns=106753 call_ns=116401 calls=1 unwritten=0 kv_staged=524288/524288 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.00185519 chip_ns=104225 call_ns=111905 calls=1 unwritten=0 kv_staged=528384/528384 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00162705 chip_ns=208019 call_ns=228259 calls=1 unwritten=0 kv_staged=1228800/1228800 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00330327 chip_ns=313011 call_ns=397092 calls=1 unwritten=0 kv_staged=4096000/4096000 blocks=1/1 | mutants 0/0 +PASS gqa_rows_f32_tinyllama_32q4kv_base0_rows1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=105313 call_ns=276339 calls=1 unwritten=0 kv_staged=2048/2048 blocks=1/1 | mutants 0/0 +PASS gqa_rows_f32_tinyllama_32q4kv_base17_rows5 n=10240 rc=OK violations=0 worst_scaled_err=0.00298047 chip_ns=104545 call_ns=343875 calls=1 unwritten=0 kv_staged=45056/225280 blocks=1/5 | mutants 0/0 +PASS gqa_rows_f32_tinyllama_32q4kv_base300_rows40 n=81920 rc=OK violations=0 worst_scaled_err=0.00332929 chip_ns=635718 call_ns=993450 calls=2 unwritten=0 kv_staged=696320/27852800 blocks=1/40 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=81807) NO_RESCALE:CAUGHT(rc=OK,bad=64191) Q_ROW:CAUGHT(rc=OK,bad=81812) OUT_ROW:CAUGHT(rc=OK,bad=81812) +PASS gqa_rows_f32_llama32_1b_32q8kv_base0_rows1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=104977 call_ns=196178 calls=1 unwritten=0 kv_staged=4096/4096 blocks=1/1 | mutants 0/0 +PASS gqa_rows_f32_llama32_1b_32q8kv_base17_rows5 n=10240 rc=OK violations=0 worst_scaled_err=0.00177684 chip_ns=104193 call_ns=113473 calls=1 unwritten=0 kv_staged=90112/450560 blocks=1/5 | mutants 0/0 +PASS gqa_rows_f32_llama32_1b_32q8kv_base300_rows40 n=81920 rc=OK violations=0 worst_scaled_err=0.00325614 chip_ns=830184 call_ns=913674 calls=2 unwritten=0 kv_staged=1392640/55705600 blocks=1/40 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=81806) NO_RESCALE:CAUGHT(rc=OK,bad=65973) Q_ROW:CAUGHT(rc=OK,bad=81824) OUT_ROW:CAUGHT(rc=OK,bad=81824) +PASS gqa_f32_large_scores_32q4kv_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.0830785 chip_ns=106402 call_ns=239379 calls=1 unwritten=0 kv_staged=524288/524288 blocks=1/1 | mutants 1/1 NO_MAX:CAUGHT(rc=OK,bad=2048) +PASS gqa_f32_mha_16q16kv_ctx300 n=1024 rc=OK violations=0 worst_scaled_err=0.00184 chip_ns=107921 call_ns=282483 calls=1 unwritten=0 kv_staged=2457600/2457600 blocks=1/1 | mutants 3/3 Q_ROW:CAUGHT(rc=OK,bad=1024) OUT_ROW:CAUGHT(rc=OK,bad=1020) KV_HEAD:CAUGHT(rc=OK,bad=1023) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=106177 call_ns=212066 calls=1 unwritten=0 kv_staged=16384/16384 blocks=1/1 | mutants 1/1 KV_HEAD:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00158694 chip_ns=104193 call_ns=198946 calls=1 unwritten=0 kv_staged=32768/32768 blocks=2/2 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2047) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.00106953 chip_ns=105329 call_ns=251843 calls=1 unwritten=0 kv_staged=262144/262144 blocks=16/16 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.000545881 chip_ns=212946 call_ns=457732 calls=1 unwritten=0 kv_staged=2097152/2097152 blocks=128/128 | mutants 5/5 KV_HEAD:CAUGHT(rc=OK,bad=2047) SLOT:CAUGHT(rc=OK,bad=2038) NO_RESCALE:CAUGHT(rc=OK,bad=1901) Q_ROW:CAUGHT(rc=OK,bad=2046) OUT_ROW:CAUGHT(rc=OK,bad=2046) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.00144367 chip_ns=104465 call_ns=246179 calls=1 unwritten=0 kv_staged=81920/81920 blocks=5/5 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00159999 chip_ns=104641 call_ns=112449 calls=1 unwritten=0 kv_staged=131072/131072 blocks=8/8 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.00170812 chip_ns=105089 call_ns=112673 calls=1 unwritten=0 kv_staged=147456/147456 blocks=9/9 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00140672 chip_ns=106225 call_ns=254947 calls=1 unwritten=0 kv_staged=311296/311296 blocks=19/19 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00143935 chip_ns=106705 call_ns=282195 calls=1 unwritten=0 kv_staged=163840/1032192 blocks=10/63 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=106994 call_ns=231139 calls=1 unwritten=0 kv_staged=32768/32768 blocks=1/1 | mutants 1/1 KV_HEAD:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00205197 chip_ns=104529 call_ns=217362 calls=1 unwritten=0 kv_staged=65536/65536 blocks=2/2 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2046) SLOT:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.00105953 chip_ns=106145 call_ns=265762 calls=1 unwritten=0 kv_staged=524288/524288 blocks=16/16 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.00055855 chip_ns=211762 call_ns=530549 calls=1 unwritten=0 kv_staged=4194304/4194304 blocks=128/128 | mutants 5/5 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2044) NO_RESCALE:CAUGHT(rc=OK,bad=1963) Q_ROW:CAUGHT(rc=OK,bad=2048) OUT_ROW:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.00171737 chip_ns=106449 call_ns=246723 calls=1 unwritten=0 kv_staged=163840/163840 blocks=5/5 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00153626 chip_ns=105169 call_ns=114449 calls=1 unwritten=0 kv_staged=262144/262144 blocks=8/8 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.00162582 chip_ns=105537 call_ns=115265 calls=1 unwritten=0 kv_staged=294912/294912 blocks=9/9 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00144548 chip_ns=106753 call_ns=243954 calls=1 unwritten=0 kv_staged=622592/622592 blocks=19/19 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00094646 chip_ns=197186 call_ns=401028 calls=1 unwritten=0 kv_staged=327680/2064384 blocks=10/63 | mutants 0/0 +PASS paged_bf16_split1_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.0028454 chip_ns=212482 call_ns=369044 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split2_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00202911 chip_ns=206658 call_ns=251714 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2041) +PASS paged_bf16_split4_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00111551 chip_ns=208882 call_ns=355540 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split8_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.000737182 chip_ns=210722 call_ns=368692 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split16_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.000577315 chip_ns=210370 call_ns=379828 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split1_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.0018292 chip_ns=103873 call_ns=202674 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split2_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00134618 chip_ns=82433 call_ns=88641 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split4_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00134618 chip_ns=103985 call_ns=114193 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split8_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00134618 chip_ns=103521 call_ns=121522 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split16_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00134618 chip_ns=103217 call_ns=136881 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_batch_3seq_32q8kv_ctx40_0_100 n=6144 rc=OK violations=0 worst_scaled_err=0.00173417 chip_ns=209346 call_ns=221522 calls=2 unwritten=0 kv_staged=229376/229376 blocks=7/7 | mutants 4/4 KV_HEAD:CAUGHT(rc=OK,bad=4095) SLOT:CAUGHT(rc=OK,bad=4095) Q_ROW:CAUGHT(rc=OK,bad=4092) OUT_ROW:CAUGHT(rc=OK,bad=4092) +PASS paged_bf16_shared_prefix_4seq_8q2kv_10pre n=2048 rc=OK violations=0 worst_scaled_err=0.00136352 chip_ns=112689 call_ns=253522 calls=1 unwritten=0 kv_staged=155648/401408 blocks=19/49 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2046) +PASS paged_bf16_shared_prefix_4seq_32q8kv_10pre n=8192 rc=OK violations=0 worst_scaled_err=0.00205105 chip_ns=210274 call_ns=390900 calls=2 unwritten=0 kv_staged=950272/1605632 blocks=29/49 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=8190) SLOT:CAUGHT(rc=OK,bad=8186) +mutant NO_MAX: caught 1 of 1 +mutant KV_HEAD: caught 12 of 12 +mutant SLOT: caught 12 of 12 +mutant NO_RESCALE: caught 6 of 6 +mutant Q_ROW: caught 8 of 8 +mutant OUT_ROW: caught 8 of 8 +device_opens=1 +PASS: 219 checks, 0 failed diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sim.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sim.log new file mode 100644 index 000000000..ac9a6e448 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sim.log @@ -0,0 +1,65 @@ +PASS gqa_f32_tinyllama_32q4kv_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=0 call_ns=2372297 calls=1 unwritten=0 kv_staged=2048/2048 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00189313 chip_ns=0 call_ns=3269394 calls=1 unwritten=0 kv_staged=34816/34816 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.00183169 chip_ns=0 call_ns=15849523 calls=1 unwritten=0 kv_staged=524288/524288 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.00274869 chip_ns=0 call_ns=123250659 calls=1 unwritten=0 kv_staged=4194304/4194304 blocks=1/1 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=2041) NO_RESCALE:CAUGHT(rc=OK,bad=1959) Q_ROW:CAUGHT(rc=OK,bad=2048) OUT_ROW:CAUGHT(rc=OK,bad=2048) +PASS gqa_f32_tinyllama_32q4kv_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.00145684 chip_ns=0 call_ns=6145119 calls=1 unwritten=0 kv_staged=133120/133120 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00206007 chip_ns=0 call_ns=7975474 calls=1 unwritten=0 kv_staged=262144/262144 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.00165735 chip_ns=0 call_ns=9854517 calls=1 unwritten=0 kv_staged=264192/264192 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00201893 chip_ns=0 call_ns=18848242 calls=1 unwritten=0 kv_staged=614400/614400 blocks=1/1 | mutants 0/0 +PASS gqa_f32_tinyllama_32q4kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00297055 chip_ns=0 call_ns=60179034 calls=1 unwritten=0 kv_staged=2048000/2048000 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=0 call_ns=2321832 calls=1 unwritten=0 kv_staged=4096/4096 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00187227 chip_ns=0 call_ns=2913838 calls=1 unwritten=0 kv_staged=69632/69632 blocks=1/1 | mutants 1/1 KV_HEAD:CAUGHT(rc=OK,bad=2048) +PASS gqa_f32_llama32_1b_32q8kv_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.00201723 chip_ns=0 call_ns=15617121 calls=1 unwritten=0 kv_staged=1048576/1048576 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.0029454 chip_ns=0 call_ns=124083419 calls=1 unwritten=0 kv_staged=8388608/8388608 blocks=1/1 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=2045) NO_RESCALE:CAUGHT(rc=OK,bad=1904) Q_ROW:CAUGHT(rc=OK,bad=2042) OUT_ROW:CAUGHT(rc=OK,bad=2042) +PASS gqa_f32_llama32_1b_32q8kv_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.00195964 chip_ns=0 call_ns=6206464 calls=1 unwritten=0 kv_staged=266240/266240 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00170583 chip_ns=0 call_ns=8108723 calls=1 unwritten=0 kv_staged=524288/524288 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.0017034 chip_ns=0 call_ns=9952999 calls=1 unwritten=0 kv_staged=528384/528384 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00187268 chip_ns=0 call_ns=19031604 calls=1 unwritten=0 kv_staged=1228800/1228800 blocks=1/1 | mutants 0/0 +PASS gqa_f32_llama32_1b_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00303901 chip_ns=0 call_ns=61011619 calls=1 unwritten=0 kv_staged=4096000/4096000 blocks=1/1 | mutants 0/0 +PASS gqa_rows_f32_tinyllama_32q4kv_base0_rows1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=0 call_ns=2327016 calls=1 unwritten=0 kv_staged=2048/2048 blocks=1/1 | mutants 0/0 +PASS gqa_rows_f32_tinyllama_32q4kv_base17_rows5 n=10240 rc=OK violations=0 worst_scaled_err=0.00268496 chip_ns=0 call_ns=14343300 calls=1 unwritten=0 kv_staged=45056/225280 blocks=1/5 | mutants 0/0 +PASS gqa_rows_f32_tinyllama_32q4kv_base300_rows40 n=81920 rc=OK violations=0 worst_scaled_err=0.00333664 chip_ns=0 call_ns=810597529 calls=2 unwritten=0 kv_staged=696320/27852800 blocks=1/40 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=81807) NO_RESCALE:CAUGHT(rc=OK,bad=64191) Q_ROW:CAUGHT(rc=OK,bad=81812) OUT_ROW:CAUGHT(rc=OK,bad=81812) +PASS gqa_rows_f32_llama32_1b_32q8kv_base0_rows1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=0 call_ns=2336888 calls=1 unwritten=0 kv_staged=4096/4096 blocks=1/1 | mutants 0/0 +PASS gqa_rows_f32_llama32_1b_32q8kv_base17_rows5 n=10240 rc=OK violations=0 worst_scaled_err=0.00181178 chip_ns=0 call_ns=14356131 calls=1 unwritten=0 kv_staged=90112/450560 blocks=1/5 | mutants 0/0 +PASS gqa_rows_f32_llama32_1b_32q8kv_base300_rows40 n=81920 rc=OK violations=0 worst_scaled_err=0.00302101 chip_ns=0 call_ns=810878386 calls=2 unwritten=0 kv_staged=1392640/55705600 blocks=1/40 | mutants 4/4 SLOT:CAUGHT(rc=OK,bad=81805) NO_RESCALE:CAUGHT(rc=OK,bad=65973) Q_ROW:CAUGHT(rc=OK,bad=81824) OUT_ROW:CAUGHT(rc=OK,bad=81824) +PASS gqa_f32_large_scores_32q4kv_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.0830785 chip_ns=0 call_ns=15575535 calls=1 unwritten=0 kv_staged=524288/524288 blocks=1/1 | mutants 1/1 NO_MAX:CAUGHT(rc=OK,bad=2048) +PASS gqa_f32_mha_16q16kv_ctx300 n=1024 rc=OK violations=0 worst_scaled_err=0.00163802 chip_ns=0 call_ns=9542962 calls=1 unwritten=0 kv_staged=2457600/2457600 blocks=1/1 | mutants 3/3 Q_ROW:CAUGHT(rc=OK,bad=1024) OUT_ROW:CAUGHT(rc=OK,bad=1020) KV_HEAD:CAUGHT(rc=OK,bad=1023) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=0 call_ns=2661115 calls=1 unwritten=0 kv_staged=16384/16384 blocks=1/1 | mutants 1/1 KV_HEAD:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00259673 chip_ns=0 call_ns=3303826 calls=1 unwritten=0 kv_staged=32768/32768 blocks=2/2 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2047) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.0012428 chip_ns=0 call_ns=20009021 calls=1 unwritten=0 kv_staged=262144/262144 blocks=16/16 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.000511585 chip_ns=0 call_ns=150175363 calls=1 unwritten=0 kv_staged=2097152/2097152 blocks=128/128 | mutants 5/5 KV_HEAD:CAUGHT(rc=OK,bad=2047) SLOT:CAUGHT(rc=OK,bad=2038) NO_RESCALE:CAUGHT(rc=OK,bad=1901) Q_ROW:CAUGHT(rc=OK,bad=2046) OUT_ROW:CAUGHT(rc=OK,bad=2046) +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.00182922 chip_ns=0 call_ns=7713231 calls=1 unwritten=0 kv_staged=81920/81920 blocks=5/5 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00143826 chip_ns=0 call_ns=9862805 calls=1 unwritten=0 kv_staged=131072/131072 blocks=8/8 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.0017437 chip_ns=0 call_ns=11874570 calls=1 unwritten=0 kv_staged=147456/147456 blocks=9/9 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00124488 chip_ns=0 call_ns=23580514 calls=1 unwritten=0 kv_staged=311296/311296 blocks=19/19 | mutants 0/0 +PASS paged_bf16_tinyllama_32q4kv_bs16_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00102811 chip_ns=0 call_ns=80588058 calls=1 unwritten=0 kv_staged=163840/1032192 blocks=10/63 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx1 n=2048 rc=OK violations=0 worst_scaled_err=0 chip_ns=0 call_ns=2698060 calls=1 unwritten=0 kv_staged=32768/32768 blocks=1/1 | mutants 1/1 KV_HEAD:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx17 n=2048 rc=OK violations=0 worst_scaled_err=0.00172089 chip_ns=0 call_ns=3292514 calls=1 unwritten=0 kv_staged=65536/65536 blocks=2/2 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2046) SLOT:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx256 n=2048 rc=OK violations=0 worst_scaled_err=0.00106374 chip_ns=0 call_ns=20004893 calls=1 unwritten=0 kv_staged=524288/524288 blocks=16/16 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx2048 n=2048 rc=OK violations=0 worst_scaled_err=0.0005717 chip_ns=0 call_ns=151308446 calls=1 unwritten=0 kv_staged=4194304/4194304 blocks=128/128 | mutants 5/5 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2044) NO_RESCALE:CAUGHT(rc=OK,bad=1963) Q_ROW:CAUGHT(rc=OK,bad=2048) OUT_ROW:CAUGHT(rc=OK,bad=2048) +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx65 n=2048 rc=OK violations=0 worst_scaled_err=0.00153464 chip_ns=0 call_ns=7683567 calls=1 unwritten=0 kv_staged=163840/163840 blocks=5/5 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx128 n=2048 rc=OK violations=0 worst_scaled_err=0.00162767 chip_ns=0 call_ns=9821221 calls=1 unwritten=0 kv_staged=262144/262144 blocks=8/8 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx129 n=2048 rc=OK violations=0 worst_scaled_err=0.0018236 chip_ns=0 call_ns=11964203 calls=1 unwritten=0 kv_staged=294912/294912 blocks=9/9 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx300 n=2048 rc=OK violations=0 worst_scaled_err=0.00136517 chip_ns=0 call_ns=23511089 calls=1 unwritten=0 kv_staged=622592/622592 blocks=19/19 | mutants 0/0 +PASS paged_bf16_llama32_1b_32q8kv_bs16_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00108243 chip_ns=0 call_ns=80928109 calls=1 unwritten=0 kv_staged=327680/2064384 blocks=10/63 | mutants 0/0 +PASS paged_bf16_split1_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00243892 chip_ns=0 call_ns=68284220 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split2_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00224498 chip_ns=0 call_ns=69096196 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2041) +PASS paged_bf16_split4_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00103684 chip_ns=0 call_ns=70600995 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split8_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.000722397 chip_ns=0 call_ns=73871461 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split16_32q8kv_ctx1000 n=2048 rc=OK violations=0 worst_scaled_err=0.00058086 chip_ns=0 call_ns=80841052 calls=1 unwritten=0 kv_staged=2064384/2064384 blocks=63/63 | mutants 0/0 +PASS paged_bf16_split1_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00156533 chip_ns=0 call_ns=8221621 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split2_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00122616 chip_ns=0 call_ns=8887275 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split4_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00122616 chip_ns=0 call_ns=10218312 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split8_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00122616 chip_ns=0 call_ns=13225528 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_split16_32q8kv_ctx100 n=2048 rc=OK violations=0 worst_scaled_err=0.00122616 chip_ns=0 call_ns=19558136 calls=1 unwritten=0 kv_staged=65536/229376 blocks=2/7 | mutants 0/0 +PASS paged_bf16_batch_3seq_32q8kv_ctx40_0_100 n=6144 rc=OK violations=0 worst_scaled_err=0.002081 chip_ns=0 call_ns=9275247 calls=2 unwritten=0 kv_staged=229376/229376 blocks=7/7 | mutants 4/4 KV_HEAD:CAUGHT(rc=OK,bad=4095) SLOT:CAUGHT(rc=OK,bad=4095) Q_ROW:CAUGHT(rc=OK,bad=4092) OUT_ROW:CAUGHT(rc=OK,bad=4092) +PASS paged_bf16_shared_prefix_4seq_8q2kv_10pre n=2048 rc=OK violations=0 worst_scaled_err=0.00158345 chip_ns=0 call_ns=16326600 calls=1 unwritten=0 kv_staged=155648/401408 blocks=19/49 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=2048) SLOT:CAUGHT(rc=OK,bad=2046) +PASS paged_bf16_shared_prefix_4seq_32q8kv_10pre n=8192 rc=OK violations=0 worst_scaled_err=0.00205105 chip_ns=0 call_ns=65495934 calls=2 unwritten=0 kv_staged=950272/1605632 blocks=29/49 | mutants 2/2 KV_HEAD:CAUGHT(rc=OK,bad=8190) SLOT:CAUGHT(rc=OK,bad=8186) +mutant NO_MAX: caught 1 of 1 +mutant KV_HEAD: caught 12 of 12 +mutant SLOT: caught 12 of 12 +mutant NO_RESCALE: caught 6 of 6 +mutant Q_ROW: caught 8 of 8 +mutant OUT_ROW: caught 8 of 8 +device_opens=0 +PASS: 219 checks, 0 failed diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sweep.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sweep.json new file mode 100644 index 000000000..4ed2294de --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sweep.json @@ -0,0 +1 @@ +{"schema":"OMEGA_GPU_ATTENTION_SWEEP_V1","path":"paged_bf16","head_dim":64,"block_size":16,"timed_calls":20,"host_simulator":false,"tolerances":{"rel":2e-4,"abs":2e-5},"hardware_counters":"unavailable (SM occupancy, bandwidth utilisation, cache hit rates are not observable through this path)","points":[{"q_heads":1,"kv_heads":1,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":64,"out_width":64,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00054275,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":4,"threads_per_cta":64,"call_ms_median":0.1045,"call_ms_p90":0.1047,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1033,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":12288,"kv_bytes_naive":65536,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":256,"tab_bytes":68,"out_bytes":1056,"kv_source":"staged"},{"q_heads":1,"kv_heads":1,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":64,"out_width":64,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000613896,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":16,"threads_per_cta":64,"call_ms_median":0.1061,"call_ms_p90":0.1099,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1038,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":77824,"kv_bytes_naive":524288,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":256,"tab_bytes":516,"out_bytes":4224,"kv_source":"staged"},{"q_heads":2,"kv_heads":1,"gqa_ratio":2,"head_dim":64,"context":256,"q_width":128,"out_width":128,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000915783,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":8,"threads_per_cta":64,"call_ms_median":0.1043,"call_ms_p90":0.1045,"kernel_ms_median":0.1029,"kernel_ms_p90":0.1032,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":12288,"kv_bytes_naive":65536,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":512,"tab_bytes":68,"out_bytes":2112,"kv_source":"staged"},{"q_heads":2,"kv_heads":1,"gqa_ratio":2,"head_dim":64,"context":2048,"q_width":128,"out_width":128,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00051606,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":32,"threads_per_cta":64,"call_ms_median":0.1068,"call_ms_p90":0.1072,"kernel_ms_median":0.1029,"kernel_ms_p90":0.1030,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":77824,"kv_bytes_naive":524288,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":512,"tab_bytes":516,"out_bytes":8448,"kv_source":"staged"},{"q_heads":2,"kv_heads":2,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":128,"out_width":128,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00103359,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":8,"threads_per_cta":64,"call_ms_median":0.1045,"call_ms_p90":0.1047,"kernel_ms_median":0.1029,"kernel_ms_p90":0.1031,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":24576,"kv_bytes_naive":131072,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":512,"tab_bytes":68,"out_bytes":2112,"kv_source":"staged"},{"q_heads":2,"kv_heads":2,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":128,"out_width":128,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000660894,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":32,"threads_per_cta":64,"call_ms_median":0.1079,"call_ms_p90":0.1082,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1034,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":155648,"kv_bytes_naive":1048576,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":512,"tab_bytes":516,"out_bytes":8448,"kv_source":"staged"},{"q_heads":4,"kv_heads":1,"gqa_ratio":4,"head_dim":64,"context":256,"q_width":256,"out_width":256,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00114263,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":16,"threads_per_cta":64,"call_ms_median":0.1053,"call_ms_p90":0.1055,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1034,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":12288,"kv_bytes_naive":65536,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":1024,"tab_bytes":68,"out_bytes":4224,"kv_source":"staged"},{"q_heads":4,"kv_heads":1,"gqa_ratio":4,"head_dim":64,"context":2048,"q_width":256,"out_width":256,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000593025,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1092,"call_ms_p90":0.1095,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":77824,"kv_bytes_naive":524288,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":1024,"tab_bytes":516,"out_bytes":16896,"kv_source":"staged"},{"q_heads":4,"kv_heads":2,"gqa_ratio":2,"head_dim":64,"context":256,"q_width":256,"out_width":256,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000809567,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":16,"threads_per_cta":64,"call_ms_median":0.1053,"call_ms_p90":0.1056,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1034,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":24576,"kv_bytes_naive":131072,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":1024,"tab_bytes":68,"out_bytes":4224,"kv_source":"staged"},{"q_heads":4,"kv_heads":2,"gqa_ratio":2,"head_dim":64,"context":2048,"q_width":256,"out_width":256,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000605015,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1098,"call_ms_p90":0.1101,"kernel_ms_median":0.1031,"kernel_ms_p90":0.1033,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":155648,"kv_bytes_naive":1048576,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":1024,"tab_bytes":516,"out_bytes":16896,"kv_source":"staged"},{"q_heads":4,"kv_heads":4,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":256,"out_width":256,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00100267,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":16,"threads_per_cta":64,"call_ms_median":0.1057,"call_ms_p90":0.1059,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1035,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":49152,"kv_bytes_naive":262144,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":1024,"tab_bytes":68,"out_bytes":4224,"kv_source":"staged"},{"q_heads":4,"kv_heads":4,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":256,"out_width":256,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000600994,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1114,"call_ms_p90":0.1121,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1039,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":311296,"kv_bytes_naive":2097152,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":1024,"tab_bytes":516,"out_bytes":16896,"kv_source":"staged"},{"q_heads":8,"kv_heads":1,"gqa_ratio":8,"head_dim":64,"context":256,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.0012878,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":32,"threads_per_cta":64,"call_ms_median":0.1061,"call_ms_p90":0.1075,"kernel_ms_median":0.1029,"kernel_ms_p90":0.1041,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":12288,"kv_bytes_naive":65536,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":2048,"tab_bytes":68,"out_bytes":8448,"kv_source":"staged"},{"q_heads":8,"kv_heads":1,"gqa_ratio":8,"head_dim":64,"context":2048,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000633052,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1133,"call_ms_p90":0.1144,"kernel_ms_median":0.1030,"kernel_ms_p90":0.1034,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":77824,"kv_bytes_naive":524288,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":2048,"tab_bytes":516,"out_bytes":33792,"kv_source":"staged"},{"q_heads":8,"kv_heads":2,"gqa_ratio":4,"head_dim":64,"context":256,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00108287,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":32,"threads_per_cta":64,"call_ms_median":0.1065,"call_ms_p90":0.1069,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":24576,"kv_bytes_naive":131072,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":2048,"tab_bytes":68,"out_bytes":8448,"kv_source":"staged"},{"q_heads":8,"kv_heads":2,"gqa_ratio":4,"head_dim":64,"context":2048,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000777759,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1138,"call_ms_p90":0.1144,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":155648,"kv_bytes_naive":1048576,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":2048,"tab_bytes":516,"out_bytes":33792,"kv_source":"staged"},{"q_heads":8,"kv_heads":4,"gqa_ratio":2,"head_dim":64,"context":256,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00106688,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":32,"threads_per_cta":64,"call_ms_median":0.1067,"call_ms_p90":0.1072,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1037,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":49152,"kv_bytes_naive":262144,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":2048,"tab_bytes":68,"out_bytes":8448,"kv_source":"staged"},{"q_heads":8,"kv_heads":4,"gqa_ratio":2,"head_dim":64,"context":2048,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00075066,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1152,"call_ms_p90":0.1161,"kernel_ms_median":0.1031,"kernel_ms_p90":0.1038,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":311296,"kv_bytes_naive":2097152,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":2048,"tab_bytes":516,"out_bytes":33792,"kv_source":"staged"},{"q_heads":8,"kv_heads":8,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000945711,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":32,"threads_per_cta":64,"call_ms_median":0.1072,"call_ms_p90":0.1076,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1038,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":98304,"kv_bytes_naive":524288,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":2048,"tab_bytes":68,"out_bytes":8448,"kv_source":"staged"},{"q_heads":8,"kv_heads":8,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":512,"out_width":512,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00074738,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1185,"call_ms_p90":0.2202,"kernel_ms_median":0.1033,"kernel_ms_p90":0.2049,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":622592,"kv_bytes_naive":4194304,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":2048,"tab_bytes":516,"out_bytes":33792,"kv_source":"staged"},{"q_heads":16,"kv_heads":1,"gqa_ratio":16,"head_dim":64,"context":256,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00116708,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1082,"call_ms_p90":0.1086,"kernel_ms_median":0.1029,"kernel_ms_p90":0.1033,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":12288,"kv_bytes_naive":65536,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":4096,"tab_bytes":68,"out_bytes":16896,"kv_source":"staged"},{"q_heads":16,"kv_heads":1,"gqa_ratio":16,"head_dim":64,"context":2048,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000804221,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1215,"call_ms_p90":0.1222,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1042,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":77824,"kv_bytes_naive":524288,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":4096,"tab_bytes":516,"out_bytes":67584,"kv_source":"staged"},{"q_heads":16,"kv_heads":2,"gqa_ratio":8,"head_dim":64,"context":256,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.0012559,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1085,"call_ms_p90":0.1092,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":24576,"kv_bytes_naive":131072,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":4096,"tab_bytes":68,"out_bytes":16896,"kv_source":"staged"},{"q_heads":16,"kv_heads":2,"gqa_ratio":8,"head_dim":64,"context":2048,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000721877,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1222,"call_ms_p90":0.1229,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1039,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":155648,"kv_bytes_naive":1048576,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":4096,"tab_bytes":516,"out_bytes":67584,"kv_source":"staged"},{"q_heads":16,"kv_heads":4,"gqa_ratio":4,"head_dim":64,"context":256,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00105089,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1089,"call_ms_p90":0.1092,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1034,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":49152,"kv_bytes_naive":262144,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":4096,"tab_bytes":68,"out_bytes":16896,"kv_source":"staged"},{"q_heads":16,"kv_heads":4,"gqa_ratio":4,"head_dim":64,"context":2048,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000986507,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1238,"call_ms_p90":0.1241,"kernel_ms_median":0.1034,"kernel_ms_p90":0.1038,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":311296,"kv_bytes_naive":2097152,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":4096,"tab_bytes":516,"out_bytes":67584,"kv_source":"staged"},{"q_heads":16,"kv_heads":8,"gqa_ratio":2,"head_dim":64,"context":256,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000962271,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1094,"call_ms_p90":0.1097,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":98304,"kv_bytes_naive":524288,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":4096,"tab_bytes":68,"out_bytes":16896,"kv_source":"staged"},{"q_heads":16,"kv_heads":8,"gqa_ratio":2,"head_dim":64,"context":2048,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000765968,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1271,"call_ms_p90":0.1285,"kernel_ms_median":0.1034,"kernel_ms_p90":0.1045,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":622592,"kv_bytes_naive":4194304,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":4096,"tab_bytes":516,"out_bytes":67584,"kv_source":"staged"},{"q_heads":16,"kv_heads":16,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00104407,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":64,"threads_per_cta":64,"call_ms_median":0.1101,"call_ms_p90":0.1106,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1034,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":196608,"kv_bytes_naive":1048576,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":4096,"tab_bytes":68,"out_bytes":16896,"kv_source":"staged"},{"q_heads":16,"kv_heads":16,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":1024,"out_width":1024,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000910028,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1343,"call_ms_p90":0.1353,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1037,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":1245184,"kv_bytes_naive":8388608,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":4096,"tab_bytes":516,"out_bytes":67584,"kv_source":"staged"},{"q_heads":24,"kv_heads":1,"gqa_ratio":24,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":1,"gqa_ratio":24,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":2,"gqa_ratio":12,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":2,"gqa_ratio":12,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":3,"gqa_ratio":8,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00116392,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":96,"threads_per_cta":64,"call_ms_median":0.1107,"call_ms_p90":0.1112,"kernel_ms_median":0.1030,"kernel_ms_p90":0.1031,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":36864,"kv_bytes_naive":196608,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":6144,"tab_bytes":68,"out_bytes":25344,"kv_source":"staged"},{"q_heads":24,"kv_heads":3,"gqa_ratio":8,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000687275,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":384,"threads_per_cta":64,"call_ms_median":0.1307,"call_ms_p90":0.2323,"kernel_ms_median":0.1029,"kernel_ms_p90":0.2044,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":233472,"kv_bytes_naive":1572864,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":6144,"tab_bytes":516,"out_bytes":101376,"kv_source":"staged"},{"q_heads":24,"kv_heads":4,"gqa_ratio":6,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":4,"gqa_ratio":6,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":6,"gqa_ratio":4,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00134672,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":96,"threads_per_cta":64,"call_ms_median":0.1113,"call_ms_p90":0.1116,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":73728,"kv_bytes_naive":393216,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":6144,"tab_bytes":68,"out_bytes":25344,"kv_source":"staged"},{"q_heads":24,"kv_heads":6,"gqa_ratio":4,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000869373,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":384,"threads_per_cta":64,"call_ms_median":0.1337,"call_ms_p90":0.1345,"kernel_ms_median":0.1035,"kernel_ms_p90":0.1040,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":466944,"kv_bytes_naive":3145728,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":6144,"tab_bytes":516,"out_bytes":101376,"kv_source":"staged"},{"q_heads":24,"kv_heads":8,"gqa_ratio":3,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":8,"gqa_ratio":3,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"unsupported_by_kernel_envelope","rc":"BAD_ARGS","pass":true},{"q_heads":24,"kv_heads":12,"gqa_ratio":2,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00109466,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":96,"threads_per_cta":64,"call_ms_median":0.1116,"call_ms_p90":0.1122,"kernel_ms_median":0.1030,"kernel_ms_p90":0.1035,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":147456,"kv_bytes_naive":786432,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":6144,"tab_bytes":68,"out_bytes":25344,"kv_source":"staged"},{"q_heads":24,"kv_heads":12,"gqa_ratio":2,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000905124,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":384,"threads_per_cta":64,"call_ms_median":0.1389,"call_ms_p90":0.1396,"kernel_ms_median":0.1034,"kernel_ms_p90":0.1039,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":933888,"kv_bytes_naive":6291456,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":6144,"tab_bytes":516,"out_bytes":101376,"kv_source":"staged"},{"q_heads":24,"kv_heads":24,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00115814,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":96,"threads_per_cta":64,"call_ms_median":0.1131,"call_ms_p90":0.1137,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1039,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":294912,"kv_bytes_naive":1572864,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":6144,"tab_bytes":68,"out_bytes":25344,"kv_source":"staged"},{"q_heads":24,"kv_heads":24,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":1536,"out_width":1536,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000723758,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":384,"threads_per_cta":64,"call_ms_median":0.1528,"call_ms_p90":0.1554,"kernel_ms_median":0.1034,"kernel_ms_p90":0.1048,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":1867776,"kv_bytes_naive":12582912,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":6144,"tab_bytes":516,"out_bytes":101376,"kv_source":"staged"},{"q_heads":32,"kv_heads":1,"gqa_ratio":32,"head_dim":64,"context":256,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000983527,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1123,"call_ms_p90":0.1128,"kernel_ms_median":0.1028,"kernel_ms_p90":0.1030,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":12288,"kv_bytes_naive":65536,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":8192,"tab_bytes":68,"out_bytes":33792,"kv_source":"staged"},{"q_heads":32,"kv_heads":1,"gqa_ratio":32,"head_dim":64,"context":2048,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00096523,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":512,"threads_per_cta":64,"call_ms_median":0.1378,"call_ms_p90":0.1386,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1046,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":77824,"kv_bytes_naive":524288,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":8192,"tab_bytes":516,"out_bytes":135168,"kv_source":"staged"},{"q_heads":32,"kv_heads":2,"gqa_ratio":16,"head_dim":64,"context":256,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00107618,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1131,"call_ms_p90":0.1133,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":24576,"kv_bytes_naive":131072,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":8192,"tab_bytes":68,"out_bytes":33792,"kv_source":"staged"},{"q_heads":32,"kv_heads":2,"gqa_ratio":16,"head_dim":64,"context":2048,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000909898,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":512,"threads_per_cta":64,"call_ms_median":0.3424,"call_ms_p90":0.3442,"kernel_ms_median":0.3073,"kernel_ms_p90":0.3091,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":155648,"kv_bytes_naive":1048576,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":8192,"tab_bytes":516,"out_bytes":135168,"kv_source":"staged"},{"q_heads":32,"kv_heads":4,"gqa_ratio":8,"head_dim":64,"context":256,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00148519,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1130,"call_ms_p90":0.1136,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":49152,"kv_bytes_naive":262144,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":8192,"tab_bytes":68,"out_bytes":33792,"kv_source":"staged"},{"q_heads":32,"kv_heads":4,"gqa_ratio":8,"head_dim":64,"context":2048,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000728955,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":512,"threads_per_cta":64,"call_ms_median":0.3435,"call_ms_p90":0.3450,"kernel_ms_median":0.3069,"kernel_ms_p90":0.3084,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":311296,"kv_bytes_naive":2097152,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":8192,"tab_bytes":516,"out_bytes":135168,"kv_source":"staged"},{"q_heads":32,"kv_heads":8,"gqa_ratio":4,"head_dim":64,"context":256,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00120324,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1136,"call_ms_p90":0.1140,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1037,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":98304,"kv_bytes_naive":524288,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":8192,"tab_bytes":68,"out_bytes":33792,"kv_source":"staged"},{"q_heads":32,"kv_heads":8,"gqa_ratio":4,"head_dim":64,"context":2048,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000902204,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":512,"threads_per_cta":64,"call_ms_median":0.2451,"call_ms_p90":0.2480,"kernel_ms_median":0.2050,"kernel_ms_p90":0.2078,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":622592,"kv_bytes_naive":4194304,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":8192,"tab_bytes":516,"out_bytes":135168,"kv_source":"staged"},{"q_heads":32,"kv_heads":16,"gqa_ratio":2,"head_dim":64,"context":256,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00134401,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1144,"call_ms_p90":0.4178,"kernel_ms_median":0.1032,"kernel_ms_p90":0.4049,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":196608,"kv_bytes_naive":1048576,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":8192,"tab_bytes":68,"out_bytes":33792,"kv_source":"staged"},{"q_heads":32,"kv_heads":16,"gqa_ratio":2,"head_dim":64,"context":2048,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000943157,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":512,"threads_per_cta":64,"call_ms_median":0.3480,"call_ms_p90":0.4199,"kernel_ms_median":0.2945,"kernel_ms_p90":0.3690,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":1245184,"kv_bytes_naive":8388608,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":8192,"tab_bytes":516,"out_bytes":135168,"kv_source":"staged"},{"q_heads":32,"kv_heads":32,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.0011642,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":128,"threads_per_cta":64,"call_ms_median":0.1174,"call_ms_p90":0.2188,"kernel_ms_median":0.1040,"kernel_ms_p90":0.2040,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":393216,"kv_bytes_naive":2097152,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":8192,"tab_bytes":68,"out_bytes":33792,"kv_source":"staged"},{"q_heads":32,"kv_heads":32,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":2048,"out_width":2048,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000786263,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":512,"threads_per_cta":64,"call_ms_median":0.2906,"call_ms_p90":0.3799,"kernel_ms_median":0.2125,"kernel_ms_p90":0.3103,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":2490368,"kv_bytes_naive":16777216,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":8192,"tab_bytes":516,"out_bytes":135168,"kv_source":"staged"},{"q_heads":64,"kv_heads":1,"gqa_ratio":64,"head_dim":64,"context":256,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00130635,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1207,"call_ms_p90":0.1216,"kernel_ms_median":0.1030,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":12288,"kv_bytes_naive":65536,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":16384,"tab_bytes":68,"out_bytes":67584,"kv_source":"staged"},{"q_heads":64,"kv_heads":1,"gqa_ratio":64,"head_dim":64,"context":2048,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00103163,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":1024,"threads_per_cta":64,"call_ms_median":0.1701,"call_ms_p90":0.2305,"kernel_ms_median":0.1031,"kernel_ms_p90":0.1639,"kernel_cache_hits":20,"first_call_cache_hit":false,"kv_bytes_staged":77824,"kv_bytes_naive":524288,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":16384,"tab_bytes":516,"out_bytes":270336,"kv_source":"staged"},{"q_heads":64,"kv_heads":2,"gqa_ratio":32,"head_dim":64,"context":256,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00117469,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1212,"call_ms_p90":0.1214,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1036,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":24576,"kv_bytes_naive":131072,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":16384,"tab_bytes":68,"out_bytes":67584,"kv_source":"staged"},{"q_heads":64,"kv_heads":2,"gqa_ratio":32,"head_dim":64,"context":2048,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000887297,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":1024,"threads_per_cta":64,"call_ms_median":0.3754,"call_ms_p90":0.3769,"kernel_ms_median":0.3078,"kernel_ms_p90":0.3098,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":155648,"kv_bytes_naive":1048576,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":16384,"tab_bytes":516,"out_bytes":270336,"kv_source":"staged"},{"q_heads":64,"kv_heads":4,"gqa_ratio":16,"head_dim":64,"context":256,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.0014115,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1215,"call_ms_p90":0.1224,"kernel_ms_median":0.1034,"kernel_ms_p90":0.1043,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":49152,"kv_bytes_naive":262144,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":16384,"tab_bytes":68,"out_bytes":67584,"kv_source":"staged"},{"q_heads":64,"kv_heads":4,"gqa_ratio":16,"head_dim":64,"context":2048,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000843739,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":1024,"threads_per_cta":64,"call_ms_median":0.4788,"call_ms_p90":0.4811,"kernel_ms_median":0.4096,"kernel_ms_p90":0.4123,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":311296,"kv_bytes_naive":2097152,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":16384,"tab_bytes":516,"out_bytes":270336,"kv_source":"staged"},{"q_heads":64,"kv_heads":8,"gqa_ratio":8,"head_dim":64,"context":256,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.0011426,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1219,"call_ms_p90":0.1222,"kernel_ms_median":0.1034,"kernel_ms_p90":0.1038,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":98304,"kv_bytes_naive":524288,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":16384,"tab_bytes":68,"out_bytes":67584,"kv_source":"staged"},{"q_heads":64,"kv_heads":8,"gqa_ratio":8,"head_dim":64,"context":2048,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000889638,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":1024,"threads_per_cta":64,"call_ms_median":0.5898,"call_ms_p90":0.6898,"kernel_ms_median":0.5166,"kernel_ms_p90":0.6171,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":622592,"kv_bytes_naive":4194304,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":16384,"tab_bytes":516,"out_bytes":270336,"kv_source":"staged"},{"q_heads":64,"kv_heads":16,"gqa_ratio":4,"head_dim":64,"context":256,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00133774,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1226,"call_ms_p90":0.1230,"kernel_ms_median":0.1032,"kernel_ms_p90":0.1034,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":196608,"kv_bytes_naive":1048576,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":16384,"tab_bytes":68,"out_bytes":67584,"kv_source":"staged"},{"q_heads":64,"kv_heads":16,"gqa_ratio":4,"head_dim":64,"context":2048,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000935371,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":1024,"threads_per_cta":64,"call_ms_median":0.6018,"call_ms_p90":0.7065,"kernel_ms_median":0.5193,"kernel_ms_p90":0.6216,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":1245184,"kv_bytes_naive":8388608,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":16384,"tab_bytes":516,"out_bytes":270336,"kv_source":"staged"},{"q_heads":64,"kv_heads":32,"gqa_ratio":2,"head_dim":64,"context":256,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.0013971,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1247,"call_ms_p90":0.1253,"kernel_ms_median":0.1033,"kernel_ms_p90":0.1040,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":393216,"kv_bytes_naive":2097152,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":16384,"tab_bytes":68,"out_bytes":67584,"kv_source":"staged"},{"q_heads":64,"kv_heads":32,"gqa_ratio":2,"head_dim":64,"context":2048,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.000789703,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":1024,"threads_per_cta":64,"call_ms_median":0.5213,"call_ms_p90":0.5317,"kernel_ms_median":0.4149,"kernel_ms_p90":0.4244,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":2490368,"kv_bytes_naive":16777216,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":16384,"tab_bytes":516,"out_bytes":270336,"kv_source":"staged"},{"q_heads":64,"kv_heads":64,"gqa_ratio":1,"head_dim":64,"context":256,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00124046,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":256,"threads_per_cta":64,"call_ms_median":0.1293,"call_ms_p90":0.1308,"kernel_ms_median":0.1034,"kernel_ms_p90":0.1043,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":786432,"kv_bytes_naive":4194304,"kv_blocks_logical":16,"kv_blocks_unique":3,"q_bytes":16384,"tab_bytes":68,"out_bytes":67584,"kv_source":"staged"},{"q_heads":64,"kv_heads":64,"gqa_ratio":1,"head_dim":64,"context":2048,"q_width":4096,"out_width":4096,"class":"supported","rc":"OK","pass":true,"violations":0,"worst_scaled_err":0.00162937,"unwritten_words":0,"launches_per_call":1,"ctas_last_launch":1024,"threads_per_cta":64,"call_ms_median":0.5622,"call_ms_p90":0.6612,"kernel_ms_median":0.4131,"kernel_ms_p90":0.5158,"kernel_cache_hits":20,"first_call_cache_hit":true,"kv_bytes_staged":4980736,"kv_bytes_naive":33554432,"kv_blocks_logical":128,"kv_blocks_unique":19,"q_bytes":16384,"tab_bytes":516,"out_bytes":270336,"kv_source":"staged"}],"points_total":72,"points_supported":64,"points_unsupported":8,"device_opens":1,"checks":73,"failed":0,"verdict":"OMEGA_GPU_ATTENTION_SWEEP_PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sweep.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sweep.log new file mode 100644 index 000000000..68ee0fa64 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/sweep.log @@ -0,0 +1,74 @@ +PASS sweep 1q/ 1kv ratio 1 ctx 256: launches=1 ctas=4 call_ms med=0.104 p90=0.105 kernel_ms med=0.103 p90=0.103 kv_staged=12288 (naive 65536) blocks=3/16 q=256 tab=68 out=1056 worst=0.00054275 +PASS sweep 1q/ 1kv ratio 1 ctx 2048: launches=1 ctas=16 call_ms med=0.106 p90=0.110 kernel_ms med=0.103 p90=0.104 kv_staged=77824 (naive 524288) blocks=19/128 q=256 tab=516 out=4224 worst=0.000613896 +PASS sweep 2q/ 1kv ratio 2 ctx 256: launches=1 ctas=8 call_ms med=0.104 p90=0.105 kernel_ms med=0.103 p90=0.103 kv_staged=12288 (naive 65536) blocks=3/16 q=512 tab=68 out=2112 worst=0.000915783 +PASS sweep 2q/ 1kv ratio 2 ctx 2048: launches=1 ctas=32 call_ms med=0.107 p90=0.107 kernel_ms med=0.103 p90=0.103 kv_staged=77824 (naive 524288) blocks=19/128 q=512 tab=516 out=8448 worst=0.00051606 +PASS sweep 2q/ 2kv ratio 1 ctx 256: launches=1 ctas=8 call_ms med=0.105 p90=0.105 kernel_ms med=0.103 p90=0.103 kv_staged=24576 (naive 131072) blocks=3/16 q=512 tab=68 out=2112 worst=0.00103359 +PASS sweep 2q/ 2kv ratio 1 ctx 2048: launches=1 ctas=32 call_ms med=0.108 p90=0.108 kernel_ms med=0.103 p90=0.103 kv_staged=155648 (naive 1048576) blocks=19/128 q=512 tab=516 out=8448 worst=0.000660894 +PASS sweep 4q/ 1kv ratio 4 ctx 256: launches=1 ctas=16 call_ms med=0.105 p90=0.106 kernel_ms med=0.103 p90=0.103 kv_staged=12288 (naive 65536) blocks=3/16 q=1024 tab=68 out=4224 worst=0.00114263 +PASS sweep 4q/ 1kv ratio 4 ctx 2048: launches=1 ctas=64 call_ms med=0.109 p90=0.110 kernel_ms med=0.103 p90=0.104 kv_staged=77824 (naive 524288) blocks=19/128 q=1024 tab=516 out=16896 worst=0.000593025 +PASS sweep 4q/ 2kv ratio 2 ctx 256: launches=1 ctas=16 call_ms med=0.105 p90=0.106 kernel_ms med=0.103 p90=0.103 kv_staged=24576 (naive 131072) blocks=3/16 q=1024 tab=68 out=4224 worst=0.000809567 +PASS sweep 4q/ 2kv ratio 2 ctx 2048: launches=1 ctas=64 call_ms med=0.110 p90=0.110 kernel_ms med=0.103 p90=0.103 kv_staged=155648 (naive 1048576) blocks=19/128 q=1024 tab=516 out=16896 worst=0.000605015 +PASS sweep 4q/ 4kv ratio 1 ctx 256: launches=1 ctas=16 call_ms med=0.106 p90=0.106 kernel_ms med=0.103 p90=0.103 kv_staged=49152 (naive 262144) blocks=3/16 q=1024 tab=68 out=4224 worst=0.00100267 +PASS sweep 4q/ 4kv ratio 1 ctx 2048: launches=1 ctas=64 call_ms med=0.111 p90=0.112 kernel_ms med=0.103 p90=0.104 kv_staged=311296 (naive 2097152) blocks=19/128 q=1024 tab=516 out=16896 worst=0.000600994 +PASS sweep 8q/ 1kv ratio 8 ctx 256: launches=1 ctas=32 call_ms med=0.106 p90=0.108 kernel_ms med=0.103 p90=0.104 kv_staged=12288 (naive 65536) blocks=3/16 q=2048 tab=68 out=8448 worst=0.0012878 +PASS sweep 8q/ 1kv ratio 8 ctx 2048: launches=1 ctas=128 call_ms med=0.113 p90=0.114 kernel_ms med=0.103 p90=0.103 kv_staged=77824 (naive 524288) blocks=19/128 q=2048 tab=516 out=33792 worst=0.000633052 +PASS sweep 8q/ 2kv ratio 4 ctx 256: launches=1 ctas=32 call_ms med=0.107 p90=0.107 kernel_ms med=0.103 p90=0.104 kv_staged=24576 (naive 131072) blocks=3/16 q=2048 tab=68 out=8448 worst=0.00108287 +PASS sweep 8q/ 2kv ratio 4 ctx 2048: launches=1 ctas=128 call_ms med=0.114 p90=0.114 kernel_ms med=0.103 p90=0.104 kv_staged=155648 (naive 1048576) blocks=19/128 q=2048 tab=516 out=33792 worst=0.000777759 +PASS sweep 8q/ 4kv ratio 2 ctx 256: launches=1 ctas=32 call_ms med=0.107 p90=0.107 kernel_ms med=0.103 p90=0.104 kv_staged=49152 (naive 262144) blocks=3/16 q=2048 tab=68 out=8448 worst=0.00106688 +PASS sweep 8q/ 4kv ratio 2 ctx 2048: launches=1 ctas=128 call_ms med=0.115 p90=0.116 kernel_ms med=0.103 p90=0.104 kv_staged=311296 (naive 2097152) blocks=19/128 q=2048 tab=516 out=33792 worst=0.00075066 +PASS sweep 8q/ 8kv ratio 1 ctx 256: launches=1 ctas=32 call_ms med=0.107 p90=0.108 kernel_ms med=0.103 p90=0.104 kv_staged=98304 (naive 524288) blocks=3/16 q=2048 tab=68 out=8448 worst=0.000945711 +PASS sweep 8q/ 8kv ratio 1 ctx 2048: launches=1 ctas=128 call_ms med=0.119 p90=0.220 kernel_ms med=0.103 p90=0.205 kv_staged=622592 (naive 4194304) blocks=19/128 q=2048 tab=516 out=33792 worst=0.00074738 +PASS sweep 16q/ 1kv ratio 16 ctx 256: launches=1 ctas=64 call_ms med=0.108 p90=0.109 kernel_ms med=0.103 p90=0.103 kv_staged=12288 (naive 65536) blocks=3/16 q=4096 tab=68 out=16896 worst=0.00116708 +PASS sweep 16q/ 1kv ratio 16 ctx 2048: launches=1 ctas=256 call_ms med=0.122 p90=0.122 kernel_ms med=0.103 p90=0.104 kv_staged=77824 (naive 524288) blocks=19/128 q=4096 tab=516 out=67584 worst=0.000804221 +PASS sweep 16q/ 2kv ratio 8 ctx 256: launches=1 ctas=64 call_ms med=0.108 p90=0.109 kernel_ms med=0.103 p90=0.104 kv_staged=24576 (naive 131072) blocks=3/16 q=4096 tab=68 out=16896 worst=0.0012559 +PASS sweep 16q/ 2kv ratio 8 ctx 2048: launches=1 ctas=256 call_ms med=0.122 p90=0.123 kernel_ms med=0.103 p90=0.104 kv_staged=155648 (naive 1048576) blocks=19/128 q=4096 tab=516 out=67584 worst=0.000721877 +PASS sweep 16q/ 4kv ratio 4 ctx 256: launches=1 ctas=64 call_ms med=0.109 p90=0.109 kernel_ms med=0.103 p90=0.103 kv_staged=49152 (naive 262144) blocks=3/16 q=4096 tab=68 out=16896 worst=0.00105089 +PASS sweep 16q/ 4kv ratio 4 ctx 2048: launches=1 ctas=256 call_ms med=0.124 p90=0.124 kernel_ms med=0.103 p90=0.104 kv_staged=311296 (naive 2097152) blocks=19/128 q=4096 tab=516 out=67584 worst=0.000986507 +PASS sweep 16q/ 8kv ratio 2 ctx 256: launches=1 ctas=64 call_ms med=0.109 p90=0.110 kernel_ms med=0.103 p90=0.104 kv_staged=98304 (naive 524288) blocks=3/16 q=4096 tab=68 out=16896 worst=0.000962271 +PASS sweep 16q/ 8kv ratio 2 ctx 2048: launches=1 ctas=256 call_ms med=0.127 p90=0.128 kernel_ms med=0.103 p90=0.104 kv_staged=622592 (naive 4194304) blocks=19/128 q=4096 tab=516 out=67584 worst=0.000765968 +PASS sweep 16q/16kv ratio 1 ctx 256: launches=1 ctas=64 call_ms med=0.110 p90=0.111 kernel_ms med=0.103 p90=0.103 kv_staged=196608 (naive 1048576) blocks=3/16 q=4096 tab=68 out=16896 worst=0.00104407 +PASS sweep 16q/16kv ratio 1 ctx 2048: launches=1 ctas=256 call_ms med=0.134 p90=0.135 kernel_ms med=0.103 p90=0.104 kv_staged=1245184 (naive 8388608) blocks=19/128 q=4096 tab=516 out=67584 worst=0.000910028 +PASS sweep 24q/ 1kv ratio 24 ctx 256: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/ 1kv ratio 24 ctx 2048: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/ 2kv ratio 12 ctx 256: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/ 2kv ratio 12 ctx 2048: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/ 3kv ratio 8 ctx 256: launches=1 ctas=96 call_ms med=0.111 p90=0.111 kernel_ms med=0.103 p90=0.103 kv_staged=36864 (naive 196608) blocks=3/16 q=6144 tab=68 out=25344 worst=0.00116392 +PASS sweep 24q/ 3kv ratio 8 ctx 2048: launches=1 ctas=384 call_ms med=0.131 p90=0.232 kernel_ms med=0.103 p90=0.204 kv_staged=233472 (naive 1572864) blocks=19/128 q=6144 tab=516 out=101376 worst=0.000687275 +PASS sweep 24q/ 4kv ratio 6 ctx 256: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/ 4kv ratio 6 ctx 2048: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/ 6kv ratio 4 ctx 256: launches=1 ctas=96 call_ms med=0.111 p90=0.112 kernel_ms med=0.103 p90=0.104 kv_staged=73728 (naive 393216) blocks=3/16 q=6144 tab=68 out=25344 worst=0.00134672 +PASS sweep 24q/ 6kv ratio 4 ctx 2048: launches=1 ctas=384 call_ms med=0.134 p90=0.134 kernel_ms med=0.103 p90=0.104 kv_staged=466944 (naive 3145728) blocks=19/128 q=6144 tab=516 out=101376 worst=0.000869373 +PASS sweep 24q/ 8kv ratio 3 ctx 256: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/ 8kv ratio 3 ctx 2048: unsupported_by_kernel_envelope (rc=BAD_ARGS) +PASS sweep 24q/12kv ratio 2 ctx 256: launches=1 ctas=96 call_ms med=0.112 p90=0.112 kernel_ms med=0.103 p90=0.103 kv_staged=147456 (naive 786432) blocks=3/16 q=6144 tab=68 out=25344 worst=0.00109466 +PASS sweep 24q/12kv ratio 2 ctx 2048: launches=1 ctas=384 call_ms med=0.139 p90=0.140 kernel_ms med=0.103 p90=0.104 kv_staged=933888 (naive 6291456) blocks=19/128 q=6144 tab=516 out=101376 worst=0.000905124 +PASS sweep 24q/24kv ratio 1 ctx 256: launches=1 ctas=96 call_ms med=0.113 p90=0.114 kernel_ms med=0.103 p90=0.104 kv_staged=294912 (naive 1572864) blocks=3/16 q=6144 tab=68 out=25344 worst=0.00115814 +PASS sweep 24q/24kv ratio 1 ctx 2048: launches=1 ctas=384 call_ms med=0.153 p90=0.155 kernel_ms med=0.103 p90=0.105 kv_staged=1867776 (naive 12582912) blocks=19/128 q=6144 tab=516 out=101376 worst=0.000723758 +PASS sweep 32q/ 1kv ratio 32 ctx 256: launches=1 ctas=128 call_ms med=0.112 p90=0.113 kernel_ms med=0.103 p90=0.103 kv_staged=12288 (naive 65536) blocks=3/16 q=8192 tab=68 out=33792 worst=0.000983527 +PASS sweep 32q/ 1kv ratio 32 ctx 2048: launches=1 ctas=512 call_ms med=0.138 p90=0.139 kernel_ms med=0.103 p90=0.105 kv_staged=77824 (naive 524288) blocks=19/128 q=8192 tab=516 out=135168 worst=0.00096523 +PASS sweep 32q/ 2kv ratio 16 ctx 256: launches=1 ctas=128 call_ms med=0.113 p90=0.113 kernel_ms med=0.103 p90=0.104 kv_staged=24576 (naive 131072) blocks=3/16 q=8192 tab=68 out=33792 worst=0.00107618 +PASS sweep 32q/ 2kv ratio 16 ctx 2048: launches=1 ctas=512 call_ms med=0.342 p90=0.344 kernel_ms med=0.307 p90=0.309 kv_staged=155648 (naive 1048576) blocks=19/128 q=8192 tab=516 out=135168 worst=0.000909898 +PASS sweep 32q/ 4kv ratio 8 ctx 256: launches=1 ctas=128 call_ms med=0.113 p90=0.114 kernel_ms med=0.103 p90=0.104 kv_staged=49152 (naive 262144) blocks=3/16 q=8192 tab=68 out=33792 worst=0.00148519 +PASS sweep 32q/ 4kv ratio 8 ctx 2048: launches=1 ctas=512 call_ms med=0.344 p90=0.345 kernel_ms med=0.307 p90=0.308 kv_staged=311296 (naive 2097152) blocks=19/128 q=8192 tab=516 out=135168 worst=0.000728955 +PASS sweep 32q/ 8kv ratio 4 ctx 256: launches=1 ctas=128 call_ms med=0.114 p90=0.114 kernel_ms med=0.103 p90=0.104 kv_staged=98304 (naive 524288) blocks=3/16 q=8192 tab=68 out=33792 worst=0.00120324 +PASS sweep 32q/ 8kv ratio 4 ctx 2048: launches=1 ctas=512 call_ms med=0.245 p90=0.248 kernel_ms med=0.205 p90=0.208 kv_staged=622592 (naive 4194304) blocks=19/128 q=8192 tab=516 out=135168 worst=0.000902204 +PASS sweep 32q/16kv ratio 2 ctx 256: launches=1 ctas=128 call_ms med=0.114 p90=0.418 kernel_ms med=0.103 p90=0.405 kv_staged=196608 (naive 1048576) blocks=3/16 q=8192 tab=68 out=33792 worst=0.00134401 +PASS sweep 32q/16kv ratio 2 ctx 2048: launches=1 ctas=512 call_ms med=0.348 p90=0.420 kernel_ms med=0.295 p90=0.369 kv_staged=1245184 (naive 8388608) blocks=19/128 q=8192 tab=516 out=135168 worst=0.000943157 +PASS sweep 32q/32kv ratio 1 ctx 256: launches=1 ctas=128 call_ms med=0.117 p90=0.219 kernel_ms med=0.104 p90=0.204 kv_staged=393216 (naive 2097152) blocks=3/16 q=8192 tab=68 out=33792 worst=0.0011642 +PASS sweep 32q/32kv ratio 1 ctx 2048: launches=1 ctas=512 call_ms med=0.291 p90=0.380 kernel_ms med=0.212 p90=0.310 kv_staged=2490368 (naive 16777216) blocks=19/128 q=8192 tab=516 out=135168 worst=0.000786263 +PASS sweep 64q/ 1kv ratio 64 ctx 256: launches=1 ctas=256 call_ms med=0.121 p90=0.122 kernel_ms med=0.103 p90=0.104 kv_staged=12288 (naive 65536) blocks=3/16 q=16384 tab=68 out=67584 worst=0.00130635 +PASS sweep 64q/ 1kv ratio 64 ctx 2048: launches=1 ctas=1024 call_ms med=0.170 p90=0.231 kernel_ms med=0.103 p90=0.164 kv_staged=77824 (naive 524288) blocks=19/128 q=16384 tab=516 out=270336 worst=0.00103163 +PASS sweep 64q/ 2kv ratio 32 ctx 256: launches=1 ctas=256 call_ms med=0.121 p90=0.121 kernel_ms med=0.103 p90=0.104 kv_staged=24576 (naive 131072) blocks=3/16 q=16384 tab=68 out=67584 worst=0.00117469 +PASS sweep 64q/ 2kv ratio 32 ctx 2048: launches=1 ctas=1024 call_ms med=0.375 p90=0.377 kernel_ms med=0.308 p90=0.310 kv_staged=155648 (naive 1048576) blocks=19/128 q=16384 tab=516 out=270336 worst=0.000887297 +PASS sweep 64q/ 4kv ratio 16 ctx 256: launches=1 ctas=256 call_ms med=0.122 p90=0.122 kernel_ms med=0.103 p90=0.104 kv_staged=49152 (naive 262144) blocks=3/16 q=16384 tab=68 out=67584 worst=0.0014115 +PASS sweep 64q/ 4kv ratio 16 ctx 2048: launches=1 ctas=1024 call_ms med=0.479 p90=0.481 kernel_ms med=0.410 p90=0.412 kv_staged=311296 (naive 2097152) blocks=19/128 q=16384 tab=516 out=270336 worst=0.000843739 +PASS sweep 64q/ 8kv ratio 8 ctx 256: launches=1 ctas=256 call_ms med=0.122 p90=0.122 kernel_ms med=0.103 p90=0.104 kv_staged=98304 (naive 524288) blocks=3/16 q=16384 tab=68 out=67584 worst=0.0011426 +PASS sweep 64q/ 8kv ratio 8 ctx 2048: launches=1 ctas=1024 call_ms med=0.590 p90=0.690 kernel_ms med=0.517 p90=0.617 kv_staged=622592 (naive 4194304) blocks=19/128 q=16384 tab=516 out=270336 worst=0.000889638 +PASS sweep 64q/16kv ratio 4 ctx 256: launches=1 ctas=256 call_ms med=0.123 p90=0.123 kernel_ms med=0.103 p90=0.103 kv_staged=196608 (naive 1048576) blocks=3/16 q=16384 tab=68 out=67584 worst=0.00133774 +PASS sweep 64q/16kv ratio 4 ctx 2048: launches=1 ctas=1024 call_ms med=0.602 p90=0.706 kernel_ms med=0.519 p90=0.622 kv_staged=1245184 (naive 8388608) blocks=19/128 q=16384 tab=516 out=270336 worst=0.000935371 +PASS sweep 64q/32kv ratio 2 ctx 256: launches=1 ctas=256 call_ms med=0.125 p90=0.125 kernel_ms med=0.103 p90=0.104 kv_staged=393216 (naive 2097152) blocks=3/16 q=16384 tab=68 out=67584 worst=0.0013971 +PASS sweep 64q/32kv ratio 2 ctx 2048: launches=1 ctas=1024 call_ms med=0.521 p90=0.532 kernel_ms med=0.415 p90=0.424 kv_staged=2490368 (naive 16777216) blocks=19/128 q=16384 tab=516 out=270336 worst=0.000789703 +PASS sweep 64q/64kv ratio 1 ctx 256: launches=1 ctas=256 call_ms med=0.129 p90=0.131 kernel_ms med=0.103 p90=0.104 kv_staged=786432 (naive 4194304) blocks=3/16 q=16384 tab=68 out=67584 worst=0.00124046 +PASS sweep 64q/64kv ratio 1 ctx 2048: launches=1 ctas=1024 call_ms med=0.562 p90=0.661 kernel_ms med=0.413 p90=0.516 kv_staged=4980736 (naive 33554432) blocks=19/128 q=16384 tab=516 out=270336 worst=0.00162937 +sweep: 72 points (64 supported, 8 unsupported by the kernel envelope), device_opens=1 +PASS: 73 checks, 0 failed diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/timing.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/timing.json new file mode 100644 index 000000000..7bd7eac12 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/timing.json @@ -0,0 +1 @@ +{"schema":"OMEGA_GPU_ATTENTION_TIMING_V1","gate_median_ms":3.0,"calls":100,"cases":[{"case":"gqa_f32_tinyllama_32q4kv_ctx2048","first_call_ms":138.472,"ok_calls":100,"violations":0,"worst_scaled_err":0.00323017,"median_ms":0.5815,"p90_ms":0.5896,"min_ms":0.5443,"max_ms":0.8859,"chip_us_mean":523.4,"device_opens":1,"pass":true}],"checks":2,"failed":0,"verdict":"OMEGA_GPU_ATTENTION_TIMING_PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/timing.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/timing.log new file mode 100644 index 000000000..8b45a9362 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/attention/FB1-CUT5-710d438c/timing.log @@ -0,0 +1,2 @@ +PASS timing gqa_f32_tinyllama_32q4kv_ctx2048 first_call_ms=138.472 ok_calls=100/100 violations=0 worst_scaled_err=0.00323017 median_ms=0.581 p90_ms=0.590 min_ms=0.544 max_ms=0.886 chip_us_mean=523.4 device_opens=1 +PASS: 2 checks, 0 failed diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv.out b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv.out new file mode 100644 index 000000000..16f62aa14 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv.out @@ -0,0 +1,83 @@ +host-only: emulation, oracle, budgets +emulation vs oracle: abs 3.577e-08, scale 63.821 +codegen rows 1 warps 4 depth 8: 266 instructions, 60 registers (declared 64, register file 8192 of 65536) +codegen rows 1 warps 8 depth 8: 234 instructions, 60 registers (declared 64, register file 16384 of 65536) +codegen rows 1 warps 16 depth 8: 218 instructions, 60 registers (declared 64, register file 32768 of 65536) +codegen rows 1 warps 32 depth 8: 210 instructions, 60 registers (declared 64, register file 65536 of 65536) +gpu_bf16_gemv_test: 185 checks, 0 failed: PASS +sim k 2048 n 100 rows 1 warps 8 depth 8 grid 2: ok 0 of 100 rows differ from the emulation (bit-identical) +sim k 2048 n 100 rows 1 warps 8 depth 4 grid 3: ok 0 of 100 rows differ from the emulation (bit-identical) +sim k 2048 n 64 rows 1 warps 8 depth 1 grid 2: ok 0 of 64 rows differ from the emulation (bit-identical) +sim k 2048 n 96 rows 2 warps 8 depth 4 grid 2: ok 0 of 96 rows differ from the emulation (bit-identical) +sim k 2048 n 96 rows 4 warps 8 depth 4 grid 1: ok 0 of 96 rows differ from the emulation (bit-identical) +sim k 512 n 70 rows 1 warps 8 depth 2 grid 2: ok 0 of 70 rows differ from the emulation (bit-identical) +sim k 512 n 70 rows 2 warps 4 depth 1 grid 3: ok 0 of 70 rows differ from the emulation (bit-identical) +sim k 4096 n 40 rows 1 warps 8 depth 16 grid 2: ok 0 of 40 rows differ from the emulation (bit-identical) +sim mutant 1: caught 64 of 64 rows differ from the emulation +sim mutant 2: caught 64 of 64 rows differ from the emulation +sim mutant 3: caught 64 of 64 rows differ from the emulation +sim: 297068 warp issues in total +gpu_bf16_gemv_test: 11 checks, 0 failed: PASS +PASS timing 1x2048x8192 upload_ms=239.1 ok_calls=100 median_ms=0.411 p90_ms=0.479 min_ms=0.297 max_ms=1.026 chip_ns_mean=411717 grid=64x1 e2e_first=2.36603e-07 e2e_last=2.36603e-07 repeat_mismatch=0 +PASS timing 1x8192x2048 upload_ms=105.2 ok_calls=100 median_ms=0.513 p90_ms=0.627 min_ms=0.418 max_ms=1.068 chip_ns_mean=540529 grid=64x1 e2e_first=5.21488e-07 e2e_last=5.21488e-07 repeat_mismatch=0 +PASS: 4 checks, 0 failed +baseline exit 0 (recorded) +upload 151936 x 2048 bf16 (622 MB): rc=OK 312 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 50, evict 1): rows 1 warps 16 depth 8 ctas 96: chip 2935.1 us = 212.0 GB/s on 622 MB; call 3044.9 us = 204.4 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +upload 151936 x 2048 bf16 (622 MB): rc=OK 304 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 30, evict 0): rows 1 warps 16 depth 8 ctas 96: chip 2920.3 us = 213.1 GB/s on 622 MB; call 3016.1 us = 206.3 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +--no-evict exit 0 (informational) +upload 151936 x 2048 bf16 (622 MB): rc=OK 302 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 30, evict 1): rows 1 warps 16 depth 4 ctas 96: chip 2933.0 us = 212.2 GB/s on 622 MB; call 3039.4 us = 204.8 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +--depth 4 exit 0 (informational) +upload 151936 x 2048 bf16 (622 MB): rc=OK 305 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 30, evict 1): rows 1 warps 32 depth 8 ctas 96: chip 3034.5 us = 205.1 GB/s on 622 MB; call 3141.7 us = 198.1 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +--warps 32 exit 0 (informational) +upload 151936 x 2048 bf16 (622 MB): rc=OK 312 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 30, evict 1): rows 1 warps 16 depth 8 ctas 48: chip 3028.9 us = 205.5 GB/s on 622 MB; call 3138.6 us = 198.3 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +--ctas 48 exit 0 (informational) +quantised lm_head: weight rms error 0.0265 of weight rms (block-scaled e4m3) +uploads: bf16 OK, fp8 OK +state 0: bf16 argmax 68534 (18.378), fp8 argmax 68534 (18.330), margin 3.2326, logit rms rel diff 0.0276 +lm_head fp8 vs bf16 argmax study (real lm_head.weight, 1000 random hidden states = gaussian x model.norm.weight, seed 20261013) +argmax agreement: 931 of 1000 (93.10%); bf16 argmax within fp8 top-5: 1000 of 1000 +logit rms relative difference, worst over states: 0.0284 +agreement by bf16 top1-top2 logit gap: <0.05: 30/66 disagree, <0.2: 36/154, <1: 3/490, >=1: 0/290 +chip medians: bf16 kernel 2920.9 us, fp8 kernel 1545.7 us +study exit 0 (informational) +GPU_BF16_GEMV_CHIP: PASS diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/SHA256SUMS b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/SHA256SUMS new file mode 100644 index 000000000..5722d5461 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/SHA256SUMS @@ -0,0 +1,18 @@ +c30ce0570b48a3dfd633a707e89232cb94298004c1766c15b7f69794181c22a4 receipt-baseline-matmul.json +3e7b0b081da03897ee26d084b9c19fbddfdc8b966ac422fa2caf7000e9ba1245 receipt-c48.json +2bddc5fd5dc162319c381561db0583bd9c93288a121c5c677843b766efc82af8 receipt-d4.json +3b932f11acdd24bc99e5336be8754b119c415b9e97c65639a050006f92ecdf16 receipt-main.json +d591ddae0932d85f7b75c4f5c1fc055ec5234ea278721dafd0e1c9bf83bb07ea receipt-noevict.json +56160f45f6bd46fae1fea7f8473664ea6a97506d1358e758a46079c5567e943f receipt-w32.json +3c79518545f86cd1cf23b39b2736f4b766e8bfc5e6f6c265a3b30e1bff2204d4 argmax-study.log +ce143cd8bcc80fe52c158180203029c62d8fe267ab05b5974e431de98cd751d8 baseline-matmul.log +44e4397ef3869cb7ba829bcafe6d3eea50e131737329e9b01c13ac944ddb6435 build.log +48b0f59368c5dbbb0106709c7c92578b1a9a0c852d6f114ef68bd7e873dbdee3 c48.log +f9777ba52406fb11012b166939d9c5374a6037e8a3f86ab762fa1a46d22b64c5 d4.log +4c1f60495b79c58a6f5ec1ea63e40ff751422fd4b6352010730151d777034d45 host-only.log +34beab99dc077b5c5558dcc27786f707f74fed89dcdd294efb1013b2deaf788b main.log +a9c6e2f5ab479cd2c3c5bbade0f33be12e56de203364741728489344d9b3e201 noevict.log +266b57b755f3daceb851de6be9e35d6ce10ff57bfd25320cf660159c588b0a68 sim.log +6d2acee120dab886cce1550b20291eb68b511c81a891a487a4e5258fb286c06d w32.log +c8ad2b00b50647c021d67152192a5733cce0be342d42f153c1fab6fccc270f7a argmax-study.txt +08e1e83ce2ce1a2fe2f896a6d9f1b9fcd5b98d4bc37d0c96ce93acf350dd6a5e device.txt diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/argmax-study.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/argmax-study.log new file mode 100644 index 000000000..1d91e7aa2 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/argmax-study.log @@ -0,0 +1,9 @@ +quantised lm_head: weight rms error 0.0265 of weight rms (block-scaled e4m3) +uploads: bf16 OK, fp8 OK +state 0: bf16 argmax 68534 (18.378), fp8 argmax 68534 (18.330), margin 3.2326, logit rms rel diff 0.0276 +lm_head fp8 vs bf16 argmax study (real lm_head.weight, 1000 random hidden states = gaussian x model.norm.weight, seed 20261013) +argmax agreement: 931 of 1000 (93.10%); bf16 argmax within fp8 top-5: 1000 of 1000 +logit rms relative difference, worst over states: 0.0284 +agreement by bf16 top1-top2 logit gap: <0.05: 30/66 disagree, <0.2: 36/154, <1: 3/490, >=1: 0/290 +chip medians: bf16 kernel 2920.9 us, fp8 kernel 1545.7 us +study exit 0 (informational) diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/argmax-study.txt b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/argmax-study.txt new file mode 100644 index 000000000..8717bf657 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/argmax-study.txt @@ -0,0 +1,5 @@ +lm_head fp8 vs bf16 argmax study (real lm_head.weight, 1000 random hidden states = gaussian x model.norm.weight, seed 20261013) +argmax agreement: 931 of 1000 (93.10%); bf16 argmax within fp8 top-5: 1000 of 1000 +logit rms relative difference, worst over states: 0.0284 +agreement by bf16 top1-top2 logit gap: <0.05: 30/66 disagree, <0.2: 36/154, <1: 3/490, >=1: 0/290 +chip medians: bf16 kernel 2920.9 us, fp8 kernel 1545.7 us diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/baseline-matmul.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/baseline-matmul.log new file mode 100644 index 000000000..f1891fb11 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/baseline-matmul.log @@ -0,0 +1,4 @@ +PASS timing 1x2048x8192 upload_ms=239.1 ok_calls=100 median_ms=0.411 p90_ms=0.479 min_ms=0.297 max_ms=1.026 chip_ns_mean=411717 grid=64x1 e2e_first=2.36603e-07 e2e_last=2.36603e-07 repeat_mismatch=0 +PASS timing 1x8192x2048 upload_ms=105.2 ok_calls=100 median_ms=0.513 p90_ms=0.627 min_ms=0.418 max_ms=1.068 chip_ns_mean=540529 grid=64x1 e2e_first=5.21488e-07 e2e_last=5.21488e-07 repeat_mismatch=0 +PASS: 4 checks, 0 failed +baseline exit 0 (recorded) diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/build.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/build.log new file mode 100644 index 000000000..0abcbde4f --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/build.log @@ -0,0 +1,2 @@ +make: 'build/gpu_matmul_api_test' is up to date. +make: 'build/gpu_lmhead_fp8_study' is up to date. diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/c48.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/c48.log new file mode 100644 index 000000000..b94e0bd7e --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/c48.log @@ -0,0 +1,10 @@ +upload 151936 x 2048 bf16 (622 MB): rc=OK 312 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 30, evict 1): rows 1 warps 16 depth 8 ctas 48: chip 3028.9 us = 205.5 GB/s on 622 MB; call 3138.6 us = 198.3 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +--ctas 48 exit 0 (informational) diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/d4.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/d4.log new file mode 100644 index 000000000..f5459bead --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/d4.log @@ -0,0 +1,10 @@ +upload 151936 x 2048 bf16 (622 MB): rc=OK 302 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 30, evict 1): rows 1 warps 16 depth 4 ctas 96: chip 2933.0 us = 212.2 GB/s on 622 MB; call 3039.4 us = 204.8 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +--depth 4 exit 0 (informational) diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/device.txt b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/device.txt new file mode 100644 index 000000000..14eb2a228 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/device.txt @@ -0,0 +1,6 @@ +start 2026-10-15T00:55:00Z omega=710d438cac6c1159b4ca2b39af49812ce08f554b branch=HEAD dirty=0 physics=/home/drakestapleton/workspace/pkv514-pins/physics physics_commit=6d7cf0d4d8eb2cda7b512100ff6058e25dbb3ddf +Linux spark-b87b 7.0.0-1019-nvidia #19~24.04.2-Ubuntu SMP PREEMPT_DYNAMIC Sun Sep 6 18:35:11 UTC 2 aarch64 aarch64 aarch64 GNU/Linux +NVIDIA GB10, 580.173.02 + total used free shared buff/cache available +Mem: 121 14 75 2 36 107 +end 2026-10-15T00:55:26Z diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/host-only.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/host-only.log new file mode 100644 index 000000000..59abc5658 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/host-only.log @@ -0,0 +1,7 @@ +host-only: emulation, oracle, budgets +emulation vs oracle: abs 3.577e-08, scale 63.821 +codegen rows 1 warps 4 depth 8: 266 instructions, 60 registers (declared 64, register file 8192 of 65536) +codegen rows 1 warps 8 depth 8: 234 instructions, 60 registers (declared 64, register file 16384 of 65536) +codegen rows 1 warps 16 depth 8: 218 instructions, 60 registers (declared 64, register file 32768 of 65536) +codegen rows 1 warps 32 depth 8: 210 instructions, 60 registers (declared 64, register file 65536 of 65536) +gpu_bf16_gemv_test: 185 checks, 0 failed: PASS diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/main.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/main.log new file mode 100644 index 000000000..94ece1442 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/main.log @@ -0,0 +1,9 @@ +upload 151936 x 2048 bf16 (622 MB): rc=OK 312 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 50, evict 1): rows 1 warps 16 depth 8 ctas 96: chip 2935.1 us = 212.0 GB/s on 622 MB; call 3044.9 us = 204.4 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/noevict.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/noevict.log new file mode 100644 index 000000000..786c1761f --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/noevict.log @@ -0,0 +1,10 @@ +upload 151936 x 2048 bf16 (622 MB): rc=OK 304 ms () +parity: 0 of 151936 rows differ from the f32 emulation (bit compare); worst error vs double oracle 2.36e-08 of the term scale (y -1.416); argmax chip 74730 oracle 74730 +second call: bit-identical +bf16-x entry: bit-identical to the emulation +timing (medians of 30, evict 0): rows 1 warps 16 depth 8 ctas 96: chip 2920.3 us = 213.1 GB/s on 622 MB; call 3016.1 us = 206.3 GB/s +chip mutant 1: caught (4096 of 4096 rows differ) +chip mutant 2: caught (4096 of 4096 rows differ) +chip mutant 3: caught (4096 of 4096 rows differ) +gpu_bf16_gemv_test: 12 checks, 0 failed: PASS +--no-evict exit 0 (informational) diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-baseline-matmul.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-baseline-matmul.json new file mode 100644 index 000000000..9df7900e7 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-baseline-matmul.json @@ -0,0 +1 @@ +{"schema":"OMEGA_GPU_MATMUL_API_TIMING_V1","cta_budget":64,"spin_us":0,"calls":100,"shapes":[{"m":1,"k":2048,"n":8192,"pass":true,"upload_ms":239.055,"ok_calls":100,"median_ms":0.4115,"p90_ms":0.4787,"min_ms":0.2966,"max_ms":1.0261,"chip_ns_mean":411717,"grid_x":64,"grid_y":1,"e2e_first":2.36603e-07,"e2e_last":2.36603e-07,"e2e_bad_first":0,"e2e_bad_last":0,"repeat_mismatch":0},{"m":1,"k":8192,"n":2048,"pass":true,"upload_ms":105.229,"ok_calls":100,"median_ms":0.5128,"p90_ms":0.6274,"min_ms":0.4185,"max_ms":1.0677,"chip_ns_mean":540529,"grid_x":64,"grid_y":1,"e2e_first":5.21488e-07,"e2e_last":5.21488e-07,"e2e_bad_first":0,"e2e_bad_last":0,"repeat_mismatch":0}],"blocked":false,"checks":4,"failed":0,"verdict":"OMEGA_GPU_MATMUL_TIMING_PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-c48.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-c48.json new file mode 100644 index 000000000..429067e98 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-c48.json @@ -0,0 +1 @@ +{"receipt":"OMEGA_GPU_BF16_GEMV_V1","n":151936,"k":2048,"reps":30,"evict":1,"spin_us":2000,"points":[{"point":"parity","rows_bad":0,"worst_rel":2.360e-08,"argmax_chip":74730,"argmax_oracle":74730},{"point":"timing","rows":1,"warps":16,"depth":8,"ctas":48,"reps":30,"chip_median_ns":3028858,"call_median_ns":3138635,"weight_bytes":622329856,"chip_gbps":205.47,"call_gbps":198.28,"marker":1145324612},{"point":"mutant 1","caught":1},{"point":"mutant 2","caught":1},{"point":"mutant 3","caught":1}],"checks":12,"failed":0,"verdict":"PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-d4.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-d4.json new file mode 100644 index 000000000..36176251f --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-d4.json @@ -0,0 +1 @@ +{"receipt":"OMEGA_GPU_BF16_GEMV_V1","n":151936,"k":2048,"reps":30,"evict":1,"spin_us":2000,"points":[{"point":"parity","rows_bad":0,"worst_rel":2.360e-08,"argmax_chip":74730,"argmax_oracle":74730},{"point":"timing","rows":1,"warps":16,"depth":4,"ctas":96,"reps":30,"chip_median_ns":2932969,"call_median_ns":3039402,"weight_bytes":622329856,"chip_gbps":212.18,"call_gbps":204.75,"marker":1145324612},{"point":"mutant 1","caught":1},{"point":"mutant 2","caught":1},{"point":"mutant 3","caught":1}],"checks":12,"failed":0,"verdict":"PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-main.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-main.json new file mode 100644 index 000000000..564e03b57 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-main.json @@ -0,0 +1 @@ +{"receipt":"OMEGA_GPU_BF16_GEMV_V1","n":151936,"k":2048,"reps":50,"evict":1,"spin_us":2000,"points":[{"point":"parity","rows_bad":0,"worst_rel":2.360e-08,"argmax_chip":74730,"argmax_oracle":74730},{"point":"timing","rows":1,"warps":16,"depth":8,"ctas":96,"reps":50,"chip_median_ns":2935113,"call_median_ns":3044922,"weight_bytes":622329856,"chip_gbps":212.03,"call_gbps":204.38,"marker":1145324612},{"point":"mutant 1","caught":1},{"point":"mutant 2","caught":1},{"point":"mutant 3","caught":1}],"checks":12,"failed":0,"verdict":"PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-noevict.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-noevict.json new file mode 100644 index 000000000..cdeb8089c --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-noevict.json @@ -0,0 +1 @@ +{"receipt":"OMEGA_GPU_BF16_GEMV_V1","n":151936,"k":2048,"reps":30,"evict":0,"spin_us":2000,"points":[{"point":"parity","rows_bad":0,"worst_rel":2.360e-08,"argmax_chip":74730,"argmax_oracle":74730},{"point":"timing","rows":1,"warps":16,"depth":8,"ctas":96,"reps":30,"chip_median_ns":2920345,"call_median_ns":3016089,"weight_bytes":622329856,"chip_gbps":213.10,"call_gbps":206.34,"marker":1145324612},{"point":"mutant 1","caught":1},{"point":"mutant 2","caught":1},{"point":"mutant 3","caught":1}],"checks":12,"failed":0,"verdict":"PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-w32.json b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-w32.json new file mode 100644 index 000000000..8520967a2 --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/receipt-w32.json @@ -0,0 +1 @@ +{"receipt":"OMEGA_GPU_BF16_GEMV_V1","n":151936,"k":2048,"reps":30,"evict":1,"spin_us":2000,"points":[{"point":"parity","rows_bad":0,"worst_rel":2.360e-08,"argmax_chip":74730,"argmax_oracle":74730},{"point":"timing","rows":1,"warps":32,"depth":8,"ctas":96,"reps":30,"chip_median_ns":3034505,"call_median_ns":3141691,"weight_bytes":622329856,"chip_gbps":205.08,"call_gbps":198.09,"marker":1145324612},{"point":"mutant 1","caught":1},{"point":"mutant 2","caught":1},{"point":"mutant 3","caught":1}],"checks":12,"failed":0,"verdict":"PASS"} diff --git a/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/sim.log b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/sim.log new file mode 100644 index 000000000..b1192252a --- /dev/null +++ b/evidence/OWN30B-REQUAL-MAIN-710d438c-20261015/gates/bf16_gemv/sim.log @@ -0,0 +1,13 @@ +sim k 2048 n 100 rows 1 warps 8 depth 8 grid 2: ok 0 of 100 rows differ from the emulation (bit-identical) +sim k 2048 n 100 rows 1 warps 8 depth 4 grid 3: ok 0 of 100 rows differ from the emulation (bit-identical) +sim k 2048 n 64 rows 1 warps 8 depth 1 grid 2: ok 0 of 64 rows differ from the emulation (bit-identical) +sim k 2048 n 96 rows 2 warps 8 depth 4 grid 2: ok 0 of 96 rows differ from the emulation (bit-identical) +sim k 2048 n 96 rows 4 warps 8 depth 4 grid 1: ok 0 of 96 rows differ from the emulation (bit-identical) ``` The diff is longer than this page shows; the raw diff has all of it.