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 / tests / NO_POSIX.md

108 lines · 7455 bytes Raw Blame History Rendered
1<!-- SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception -->
2# NO_POSIX inventory and native cutover
3
4Inventory anchor: CUDApp `eceb8c542fa6` (PR #330, this lane's specified base).
5Line numbers below refer to that revision, not to moving main. The supplied
641-site origin/main inventory and this stacked base are not identical inventories.
7Comments and build definitions are included so every textual occurrence is classified.
8
9Classes: **guard** means an include, unavailable hosted operation or its syscall
10stub; **shell** means ABI, callback selection, memory ownership or build glue;
11**compute** means computation previously selected in C specifically by NO_POSIX.
12This is an inventory of macro sites, not a claim that every C function in the
13surrounding files has migrated. Other lanes own those surrounding functions.
14
15| Base file | Base lines | Class | Disposition |
16|---|---|---|---|
17| `src/omega_blackwell_codegen.c` | 7, 11 | guard | Hosted includes and diagnostic stub. No syscall in freestanding. |
18| same | 274, 280, 284 | compute | C encoder exception removed. `bw_enc_sm121.om`, composed with `om2`, called through `tools/native --freestanding`. C remains default-OFF oracle. |
19| same | 1257 | guard | Hosted dump uses file IO; freestanding dump is inert. |
20| same | 1550, 1843, 2036, 2206, 2396 | shell | Allocating convenience entry points excluded. Allocation-free program/encode interfaces remain; unrelated generator migrations belong to their lanes. |
21| same | 2770 | guard | Printing hosted self-test excluded. |
22| `src/omega_blackwell_codegen.h` | 251 | shell | Documents caller-owned code-buffer ABI. |
23| `src/omega_blackwell_codegen_bf16.c` | 9 | guard | Hosted allocator include. |
24| same | 304 | shell | Allocating convenience entry excluded. |
25| `src/omega_blackwell_codegen_gemm.c` | 7 | guard | Hosted allocator include. |
26| `src/omega_blackwell_codegen_moe.c` | 12 | guard | Hosted allocator include. |
27| same | 490 | shell | Allocating convenience entry excluded. |
28| `src/omega_blackwell_codegen_moe2.c` | 329 | shell | Allocating convenience entry and allocator include excluded. |
29| `src/omega_blackwell_matmul.c` | 4 | guard | Hosted allocator include. |
30| same | 8 | shell | Import declarations only. |
31| same | 98 | compute | Already calls seeded `native_f16` through the checked import-free scalar binding; retained, not duplicated. |
32| same | 115 | compute | C integer bf16 fallback replaced by native seeded `no_bf16.om`; old integer oracle only selected by default-OFF `CUDAPP_MIGRATION_PENDING_C_NO_POSIX`. |
33| same | 155, 193 | shell | Hosted allocation/free conveniences excluded. |
34| `src/omega_cubin.c` | 10, 42, 46 | compute | C ELF-packing exception removed. Native `cubin_elf.om` now handles freestanding selection; C remains default-OFF oracle. Allocation, pointers and diagnostic formatting remain shell operations. |
35| `src/omega_gpu_engine.c` | 25 | guard | No errno or POSIX clock imports. |
36| same | 155 | shell | Invoke installed clock callback, or zero; no platform clock invented. |
37| same | 352 | shell | Require clock capability before device work; existing ABI refusal, not numeric computation. |
38| `src/omega_gpu_engine.h` | 243 | shell | Clock callback contract documentation. |
39| `src/omega_gpu_session.c` | 8, 24 | guard | No Linux/pthread dependency. |
40| same | 96, 108 | shell | No hosted platform default installation. Explicit platform required. |
41| same | 376 | shell | No Linux platform identity query for a custom platform. |
42| same | 587 | guard | Excludes hosted Ampere launch path; freestanding keeps its existing refusal. Command-list work remains owned by SessionCmdlistOm. |
43| `src/omega_gpu_session.h` | 49 | shell | Explicit-platform ABI documentation. |
44| `src/omega_gpu_wait.c` | 6 | guard | No POSIX clock; platform callback required. |
45| `src/omega_gpu_wait.h` | 81 | shell | Callback ABI documentation. |
46| `mk/omega-gpu-engine.mk` | 16, 119, 125, 154, 181, 210, 225, 297 | shell | Build definitions, comments and host-test link rules. Now links native caller-stack objects. |
47
48## Build and custody
49
50`om/units.sh --native-no-posix` dispatches to `om/no-posix.sh`, the native-unit
51registry. It composes the existing encoder and cubin roots plus
52`om/numeric/no_bf16.om` by prefixing exactly `om2\n`.
53No handwritten C implementation or converter is introduced. Native generated
54machine-code bindings and custody inputs are build products under
55`build/no_posix/native`, not a second editable implementation. The existing
56portable generated units remain committed and checked by `om/units.sh --check`.
57
58Use the stage-5 combined omega-bridge `741c1ebb` (#76), as directed by Main
59through Integrator4. The registry pins both `tools/native` and
60`src/native.om` by SHA-256. `OMEGA_OMC` remains seeded `e5b32567`, digest
61`2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f`.
62The bridge's *generator bootstrap* separately requires its pinned compiler digest
63`734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61`,
64as `OMEGA_NATIVE_OMC`; this does not change the compiler of the computation
65units. `OMEGA_NATIVE_OMC2` is forced to `OMEGA_OMC` by the registry.
66
67The whole GPU partial link retains only its pre-existing mem/str allowlist.
68The new native binding objects and the static bare-ELF differential have no
69libc imports. `omega_cubin.c` itself is still an allocating diagnostic ABI
70shell, not part of the allocator-free GPU partial link. Defining NO_POSIX on
71that shell chooses native computation; it does not make malloc or snprintf
72available in firmware. The bare test directly calls its same native unit.
73
74## Focused gates
75
76Run every command in the device-free wrapper:
77
78```sh
79bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 \
80 make -j3 gpu-engine-freestanding test-gpu-engine-freestanding test-codegen-freestanding
81bwrap --dev-bind / / --dev /dev --proc /proc -- taskset -c 10-14 nice -n 10 \
82 make -j3 test-no-posix-native
83```
84
85Set `OMEGA_BRIDGE` to the native bridge checkout for these targets. For the
86unchanged portable `om/units.sh --check`, use the bridge checkout matching
87`om/omega-bridge.lock` instead. See the dated evidence README for observed
88results, exact environment, negative controls and chip runbook.
89
90Protected regions (`frag_pack_*`, `result_sentinels`, session command lists,
91and #327's codegen-base migration) were not edited. No runtime API changes.
92
93## Encoder/core codegen completion on ham/encoder-om-primary
94
95The preceding inventory is historical at its named anchor. The core codegen
96NO_POSIX exceptions for allocator, five matmul IR builders, scalar matmul
97policies, fragment packing, result sentinels, vecadd and binding decisions now
98use their existing seeded units through native caller-stack bindings. The
99encoder itself already used that route at integration base `cb3395aa`.
100Explicit C switches still provide independent differential oracles; there is
101no C retry after an Omega refusal. No instruction forms or allocation rules
102were added. C1b refuses P0 guards on the uniform LDCU and LDCU.64 forms in both
103the seeded encoder and C oracle.
104
105`make test-om-encoder-primary` exercises the production freestanding encoder
106on 1024 samples per operand form (eight forms for every opcode 0..79). Accepted/refused counts are
107written to `build/om-encoder/primary-counts.txt`; a flipped response byte must
108be rejected. Run with the same pinned `OMEGA_OMC` and `OMEGA_BRIDGE` as above.