interplane.Get Omega
Read in your language

CUDApp

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

Brought by drakestapleton

branch main Branches Tags History

CUDApp / om / codegen / GDN.md

80 lines · 4227 bytes Raw Blame History Rendered
1# Seeded Omega GDN builders
2
3The default implementation of `src/omega_blackwell_codegen_gdn.c` is seeded Omega.
4`CUDAPP_MIGRATION_PENDING_C_CODEGEN_GDN=1` selects the retained C differential
5oracle. The switch is private to the C file. The public header and API are unchanged.
6
7## Units and host boundary
8
9- `cg_gdn_shape.om`: `omega_gdn_shape` (ratio 0 means 3, ratios 1..3, the
10 parameter, tail and state sizes, bf16 halving). Shared by both units.
11- `cg_gdn_common.om`: the eight-word record emitter, control words, the held
12 scoreboard prefetch bookkeeping, branch/region/loop records and the operand
13 helpers (`omega_gd_*`).
14- `cg_gdn.om`: entry `cg_gdn k a c d b m`. Kind 0 decode, 1 multi-token decode,
15 2 state copy/zero, 3 prefill prep, 4 prefill scan, 5 prefill post. `a` is the
16 mutant selector, `c` the copy mode, `d` the ratio with `state_bf16 != 0` in bit 32.
17 Every refusal the C builders make is made here (unknown kind, copy with a mutant
18 or an unknown mode, a GDN kernel with a copy mode, mutant outside 0..4, an
19 unsupported ratio). Multi sets the GPR limit 246 through metadata word 6.
20- `cg_gdn_policy.om`: entry `cg_gdn_policy q ra bf`, the public shape queries.
21
22The C shell keeps API/null handling and the three stats accessors; the stats
23accessors are shared by the oracle and the default build. Register allocation,
24loop-interval checks and record replay use `omega_gpu_om_ir_replay`; no replay op
25or metadata word was added.
26
27Vreg ids live in a flat state view (`s`, 512 words). A slot is a name only; the
28allocation order is the C order, phase by phase. Phase functions are split where
29the seeded compiler's live-name/register bound requires it (`pr1`/`pr1b`,
30`pr2`/`pr2b`/`pr2c`), and argument expressions deeper than one operation are
31first assigned to `h1..h4`. Neither changes the emitted order.
32
33## Verification
34
35Run every gate in the device-free namespace. A missing device node is a host-path
36defect to fix, not permission to rerun without the wrapper.
37
38```sh
39export OMEGA_OMC=/path/to/omega-mv/seed/out/omc
40export OMEGA_BRIDGE=/path/to/omega-bridge OMEGA_BRIDGE_DIR=/path/to/omega-bridge
41export OMEGA_MV=/path/to/omega-mv
42W="bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10"
43$W sh om/units.sh --check
44$W make -j3 test-codegen-gdn-diff
45$W make -j3 test-codegen-gdn-mutants
46$W make -j3 test-codegen-gdn-sim
47```
48
49`test-codegen-gdn-diff` links the C oracle into the test translation unit and
50enumerates mutant -1..5, copy -1..3, ratio {0,1,2,3,4,UINT32_MAX} and
51state_bf16 {0,1,2,UINT32_MAX} for all six builders. It compares refusals, IR
52instructions, register allocation, encoded bytes, the shape policy (including
53untouched output on refusal) and all stats accessors, checks NULL handling, and
54ends with a negative control: one flipped bit in an emitted Omega record must
55show up as an IR difference.
56
57`gdn_mutants.py` changes one unique site in the Omega sources, regenerates every
58unit that contains it through `tools/bridge-seeded`, rebuilds the differential and
59requires it to fail with `GDN DIFF` or `GDN SHAPE DIFF`. Temporary sources, C and
60binaries are deleted. Python and the retained C are verification tools only.
61
62`test-codegen-gdn-sim` runs the existing `gpu_gdn_test --host-only`, `--sim` and
63`gpu_gdn_multi_test --sim` batteries against `libomega_gpu.a`, which now contains
64the Omega builders.
65
66## Qualification boundary (chip tier NOT_RUN)
67
68Host byte equality and warp-simulator parity are not GB10 qualification. No GPU
69window was granted to this lane. In a separately authorized exclusive window:
70
711. Run the integrated host and simulator gates above on the exact revision.
722. Build `build/gpu_gdn_test` and `build/gpu_gdn_multi_test` from that revision and
73 record the CUDApp revision and binary SHA-256 values.
743. Run `build/gpu_gdn_test` (default mode is the chip battery: chained steps against
75 the double oracle, rerun bit-identity, mutants 1-4 caught, record path), then
76 `build/gpu_gdn_test --bf16`, then `build/gpu_gdn_multi_test` without `--sim`.
774. Keep each final verdict line and the `--out` receipt as the chip receipt.
78
79Do not change live services, chip locks, driver state or boot configuration as
80part of host work.