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

87 lines · 8151 bytes Raw Blame History Rendered
1# Seeded model graph recording
2
3The default graph recorders use seeded Omega plans for scalar decode, Qwen3.6, Qwen3.8, batched Q36 heads, prefill mixer/expert ordering, MoE grouping/window bindings, output heads, allocation region offsets/sizes, standalone residual/SwiGLU glue, debug-copy launch records, and prefill launch/copy planning. `CUDAPP_MIGRATION_PENDING_C_GRAPHS=1` selects the retained C differential oracle in the four migrated translation units. It is not enabled by default.
4
5`om/units.sh` composes the units and commits their portable C ABI bindings. The compiler is omega-mv e5b32567, omc SHA-256 `2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`. The final entry function of each composition is the bridge export. Plans use fixed-size ulong descriptor views; the shell copies packed uint argument words and calls existing CUDApp recorder APIs. It does not add an execution backend or GPU launcher.
6
7The C shell retains tensor object observation, allocation/lifetime, recorder dispatch, statistics, errors, queue execution, and existing closure/admission API calls. Slice 8 moves the remaining Q38 dimensional defaults and derived widths, model scalar configuration/shape checks, layer classification and counters, rotary/FP8 gather tables, decode barrier normalization and timeline admission, prefill register-budget admission and allocation rounding into seeded Omega. Pure allocation layout and debug-copy/standalone glue descriptors are Omega units. Pointer/null/lifetime checks around host objects remain C; this is not a claim that every line in the four C files has been replaced.
8
9## Host checks
10
11Run inside the device-free namespace, never against live devices:
12
13```
14bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 make -j3 CUDAPP_OMC_HOST=1 OMEGA_OMC=../omega-mv/seed/out/omc OMEGA_BRIDGE=../omega-bridge test-model-graphs-om
15```
16
17The wire test compares seven argument-bank formats with an independent C oracle. The command-list differential compiles the actual graph translation units with old/new selection, compares complete command-list argument banks, QMD slots, launch code, waits, independence and graph state. Nested GDN, attention, GEMM and router recorders are deterministic ABI adapters: their complete input arguments become launches in the real command list. This isolates the migrated graph decisions, but is **not** end-to-end parity of actual nested kernel recordings or real model weights.
18
19Fixtures cover boundaries and generated sequence positions/configurations, scalar/batched heads, GDN/attention, Q38 BF16/split-down shapes and exact-head records, prefill multi-token paths, native MoE windows, combine, grouping and standalone glue. Independent layout/copy/transfer/launch checks compare generated descriptors with C expressions. Record flips are rejected. `mutants.py` recompiles five semantic wire changes; compilation errors are not mutant kills. Fake-platform submission probes exercise one complete token's layer/final plans without device access.
20
21`make test-model-graphs-warp` interprets the actual GATHER glue program with Omega-packed arguments in both warp orders, and rejects its source-index mutant. This is simulator evidence, not hardware qualification.
22
23`make test-model-graphs-nested` independently compiles old/new graph objects and invokes unwrapped production GDN, attention, FP8/BF16 GEMV, native GEMM and router recorders with synthetic resource observations and fake platform/RM. It compares every bank/QMD and submitted word, requires one submission per complete word, and kills a changed real plan descriptor. Q36 native MoE windows use actual seeded staged artifacts, temporary cubin export/snapshot admission and real leases; these device-free host paths are exercised. Weight/state contents are not kernel-executed. This complements, rather than replaces, the larger ABI-adapter randomized differential. Hardware qualification and the integrated full suite remain NOT_RUN. See `CHIP.md` and the dated receipt.
24
25## Slice 8: graph residue and hello
26
27`residue.om` exports scalar metadata decisions over fixed descriptors;
28`table.om` produces rotary/gather permutation words. The independent scalar
29oracle is selected only with default-OFF
30`CUDAPP_MIGRATION_PENDING_GRAPH_RESIDUE=1`. Existing #310 C graph oracles remain
31separately selectable. `hello.om` and `hello-plan.om` cover hello input/output
32checking and host plans; see [the hello runbook](../../examples/hello_gpu/README.md).
33
34`test-graph-residue` compares deterministic output against the C oracle, with a
35deliberately corrupted result as a red check. Cases follow constructor branches:
36dimension defaults, divisibility and capacity limits; vocabulary and layer/head
37limits; mask bits and both layer classes; all legal gather layouts; barrier
38values; timeline empty/full/overflow; explicit/default register budgets; full,
39short, poisoned and bit-flipped output; all launch chunks and both bug modes.
40Dimension and scalar rejection cases include 0, UINT32_MAX and adjacent source
41boundaries. Non-NaN float output is compared bit-exact with contraction disabled.
42
43`test-graph-residue-mutants` compiles seven changed Omega units and requires
44behavioral disagreement: poison, input period, checker add/sub, dimension cap,
45timeline capacity, gather stride and load scoreboard. A compiler refusal is a
46failed gate, never a mutant kill.
47
48`test-graph-residue-coverage` instruments the C oracle at O0 and runs the actual
49hello oracle simulator plus both fault controls. The scalar header has every
50executable line and branch reached. Its untaken `!in` branch is unreachable
51after zero selects the nonzero default. ABI-status/abort branches in the glue
52are deliberately not invoked with forged pointers or lengths. The hello oracle's
53remaining uncovered branches are the device-only main path and device error
54cleanup (NOT_RUN: no GPU window), allocation/IR-append failure handling (not
55injected), CLI usage/invalid-option I/O, alternate diagnostic opcode strings and
56nearest-buffer ties/ranges not generated by the vecadd fault. These are retained
57host/device glue, not untested alternate C computation selected in production.
58The differential separately exercises bandwidth target/positive-time branches
59and wrong-answer checking that the normal/past-end/short simulator does not.
60Warp-simulator opcode/MUFU branches unused by vecadd belong to the simulator's
61own tests; coverage here does not qualify them.
62
63Q36 formerly silently truncated a full timeline; Q38 could copy past its fixed
64stamp array. Both now reject a batch that cannot fit before copying any stamps.
65The shared capacity regression checks the last fitting batch and the first
66overflow, including UINT32_MAX count. Failure leaves the output index unchanged.
67
68### Runtime table view pin (pending upstream)
69
70The converter/frontend pins in `om/units.sh` select omega-bridge #73
71`79e8c3613a6f`, stacked on unmerged #71. This CUDApp change is pending both PRs.
72Only `model_graph_table` selects `bridge-seeded --runtime-views`. Its numeric
73`edit uint 24576` is a capacity: the actual allocation length is passed to the
74checked entry, so Omega writes packed uint32 values directly. The old fixed-512
75scratch buffer, widening/narrowing copy and C chunk loop are removed. All legal
76Q/KV layouts are compared up to the maximum extent, including q=kv=24; admission
77controls cover empty/null, over-capacity, nonempty-null and result/view overlap.
78WolframLanguageEvaluator: `(24+24)*512` -> `24576`.
79
80This is the hosted checked converter profile, not native/freestanding. The
81existing freestanding units and pins retain their original path. Build the
82bridge generator with its existing pinned bootstrap seed using `tools/build.sh`;
83set `OMEGA_SEED` to that baseline executable when a separate bridge worktree
84does not contain `build/bootstrap/omc`. The seeded source validator remains
85e5b32567 through `OMEGA_OMC`. Re-run `om/units.sh --check` with the same bridge,
86seed and validator. Every hosted generated file/identity is refreshed because
87the converter pin changes; integration must regenerate the union of lane units.