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 / c1 / README.md

107 lines · 6152 bytes Raw Blame History Rendered
1# C1 checked kernels
2
3The source of record for the kernel language, checker2 and language-to-IR
4lowering is omega-mv at `omega-mv.lock` in this directory:
5`37920c935ce2c2d6b4629a50ac474c0c933f4728` (omega-mv branch `ham/integ-280-c1`:
6the unsigned conversions at BlackwellIR 65/66 so published op 64 stays ATOMG MIN,
7evidence/INTEG-280-20261110/numbering.txt), on `bb552199e8970bbdcb42c79acc8a36f9c1189e23`
8of [draft #1044](https://github.com/aien-dev/omega-mv/pull/1044), not a merged
9compiler release. CUDApp owns sm_121 instruction encoding and cubin packaging.
10No frontend source is copied into CUDApp.
11
12## Host acceptance
13
14Set `OMEGA_C1_SOURCE` to a clean checkout of the exact pin, with its pinned
15`seed/out/omc` artifact present. Then run:
16
17```
18bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make -j3 test-c1
19bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make -j3 test
20```
21
22The device-free namespace is mandatory for host, simulator, differential and
23mutant checks. A missing-device failure is a host-path defect, not permission
24to rerun outside it. During the parallel integration wave, only the Integrator
25runs the full `make test` command after all writers finish.
26
27`test-c1` remains standalone while its omega-mv source is a pending draft;
28it joins `HOST_TESTS` only once that draft merges. Missing or changed source
29or a mismatched compiler SHA-256 is NOT_RUN (the source-check script exits 3,
30and Make reports failure), never PASS. No fallback checkout or compiler is used.
31
32`test-c1-predicate` independently checks guarded unsigned conversions, MOV and
33SHFL with inactive, active, inverted and mixed lane predicates. Predicated-off
34lanes retain canaries; an inactive SHFL walks past structural checks, while
35an active SHFL after a lane exits is still refused. This catches the former
36scalar dispatch bug that used the fragment mask instead of the predicate mask.
37
38The pipeline is:
39
401. Omegese source kernels, including vector add, shared-memory tiled GEMM and
41 decode attention, emit canonical OSC IR.
422. checker2 verifies types, ownership, memory phases and races. Named negative
43 fixtures must be refused. The seeded Omega checker is compared to the C
44 migration oracle on the same bytes.
453. `seed/oscgpu/*.om` lowers the checked unit to Blackwell IR. All dumps,
46 refusals, metadata and machine bytes are compared with the C migration
47 oracle, including deliberately broken lowering variants.
484. CUDApp's default `om/encoder/bw_enc_sm121.om` encodes those instructions.
49 Conversion opcodes 65/66 follow main's ATOMG MIN opcode 64; training opcodes 60..63 retain
50 their existing meanings. Ordinary guard predicates are encoded fail-closed.
515. CUDApp's default `om/cubin/cubin_elf.om` packs sm_121 ELF cubins. The test
52 parses the section table and checks exact `.text` roundtrip; changing a text
53 byte must be caught.
546. The existing SIMT simulator runs the matched Blackwell IR against the host
55 references under both fragment schedules. It models divergence, shared
56 memory, barriers and shuffles. It is an IR simulator, **not** an independent
57 machine-byte decoder or a GPU driver. Byte equality and ELF roundtrip bind
58 its input to the generated cubin, but do not establish hardware correctness.
59
60Buffer bounds remain checked at runtime: invalid indices trap with status code
613 and poison propagation, and cannot perform later stores. They are not a
62claim that checker2 statically proves every dynamic buffer index in bounds.
63A literal index beyond a fixed shared-array length is statically refused as
64`C2-GPU-BOUNDS`. The dynamic bounds tests separately exercise refused execution;
65neither tier is a claim of a complete static bounds proof.
66
67Host build dependencies are the pinned compiler artifact, C compiler and the
68omega-bridge-generated bindings already committed in each repository. C glue
69in `sim.c` only adapts the test ABI and checks ELF output; the language lowering,
70encoder and cubin writer are Omega. Existing C lowering/checker implementations
71are retained as explicit migration/differential oracles, not represented as
72removed dependencies.
73
74## Chip runbook — NOT_RUN
75
76No command in `test-c1` builds a device launcher or opens `/dev/nvidia*`.
77A fresh Drake-authorized exclusive GPU window is required for all steps below.
78Historical omega-mv receipts do not qualify the draft pin.
79The current device-free policy does not authorize the unwrapped chip command:
80later authorization must explicitly permit the required GPU device exposure.
81
82After authorization and the current hardware runbook's preflight, repeat the
83host command above and preserve its output and the exact source/compiler/image
84hashes. In the pinned language checkout, use the generated CUDApp machine bytes:
85
86```
87taskset -c 10-14 nice -n 10 make -C "$OMEGA_C1_SOURCE" -j3 \
88 test-osc-gpu-chip OSC_GPU_OM_DIR="$PWD/build/c1/om/om"
89```
90
91That launcher is the existing migration path in omega-mv. It checks the generated
92machine bytes against the CUDApp corpus before launch. It does not test cubin
93loading; that requires CUDApp's module-loader hardware acceptance as a separate
94receipt. Collect the vector add/GEMM/attention reference verdicts, status-word
95bounds refusals, and a red run for each lowering mutant. Do not weaken the gate
96or use a historical receipt if the new path is refused.
97
98The live-35B replacement gate is also **NOT_RUN**. In a separately authorized
99serving window, the operator must identify the actual serving process/model,
100freeze a prompt corpus plus deterministic generation settings and golden token
101IDs, and select one matching live kernel shape. Capture baseline tokens before
102changing the kernel dispatch. Replace only that dispatch with the checked
103kernel, capture token IDs under identical settings, require exact ID equality,
104and restore the original dispatch on any refusal or mismatch. Record model,
105weights/tokenizer hashes, dispatch identity, source/image hashes, settings,
106baseline and replacement token streams, and rollback result. No live model or
107service is modified by this PR, and simulator equality is not that receipt.