interplane.Get Omega
Read in your language

aien-architecture-mv

Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.

Brought by drakestapleton

branch main Branches Tags History

aien-architecture-mv / docs / milestone-19-spec.md

181 lines · 15026 bytes Raw Blame History Rendered
1# Specification: Milestone 19: OMEGA Accelerator Resident Substrate (`OMEGA_ACCELERATOR_RESIDENT`)
2
3```text
4Document ID: SPEC-ACCEL-M19
5Milestone: Milestone 19 (OMEGA_ACCELERATOR_RESIDENT)
6Classification: Sovereign Machine Canonical Specification
7Target Substrate: Persistent Omega Execution Substrate in Coherent Memory on NVIDIA DGX Spark (GB10, sm_121)
8Status: REOPENED / IN PROGRESS (see docs/errata/m19-errata.md; closes via docs/m19r-recovery-program.md)
9Opened: 2026-09-26
10Authority: aien-spark/physics M16 (commit b64753d), aien-spark/omega M18 (commit 7273c37)
11Lineage: SILICON -> ATLAS (M1) -> PHYSICS (M2/M3/M15/M16) -> OMEGA (M4-M14) -> M16 (Native Submission) -> M17 (Blackwell Vector) -> M18 (Blackwell MatMul) -> M19 (Accelerator Resident)
12```
13
14---
15
16## 1. Executive Summary & Sovereignty Boundary
17
18Milestones 16, 17, and 18 established native Blackwell hardware interaction on physical NVIDIA DGX Spark silicon without foreign userspace runtimes (`libcuda.so`, `libcudart.so`):
19- M16 characterized and verified the native submit path (MMIO, GPFIFO queues, doorbells, completions).
20- M17 executed a verified canonical machine-code artifact for vector addition via dynamic QMD and parameter synthesis.
21- M18 established dynamic Blackwell code generation, instruction selection, bounded register allocation, 128-bit machine word encoding, and tensor-core MMA execution with FP32 accumulation.
22
23In Milestones 16 through 18, execution followed an ephemeral lifecycle: each operation or test suite invocation performed a full sequence of RM client creation, device allocation, VAS aperture binding, GPFIFO channel initialization, pushbuffer dispatch, completion wait, and teardown.
24
25Milestone 19 transitions Omega from an ephemeral execution model to a **persistent accelerator resident substrate** (`OmegaAcceleratorWorld`):
26
27> **EPHEMERAL DISPATCH INITIALIZES AND TEARS DOWN SUBSYSTEMS PER OPERATION.**
28> **ACCELERATOR RESIDENCY MAINTAINS PERSISTENT CHANNELS, APERTURES, CODE REGISTRIES, AND BUFFERS ACROSS CONTINUOUS HETEROGENEOUS DISPATCH LOOPS.**
29
30### The Core Architectural Invariant: `resident != immortal`
31Residency provides persistent operational availability without incurring per-operation channel initialization latency. Residency does not confer unrevocable authority or perpetual resource retention:
321. **Explicit Generation Counters**: Every registered buffer, code object, and channel handle binds to a strictly monotonic generation counter.
332. **Capability-Bounded Handles**: Handles declare explicit bounds and access permissions. Ambient or untracked access to coherent memory apertures is prohibited.
343. **Fail-Closed Stale Handle Refusal**: Access attempts using invalidated, expired, or out-of-generation handles are rejected with explicit error codes before submission.
354. **Deterministic Capability Revocation**: Buffers and code modules can be dynamically revoked and purged from the resident substrate without tearing down the parent world.
365. **Deterministic Teardown**: The entire resident substrate terminates deterministically, releasing all NVRM allocations, coherent mappings, and doorbells without leaking host or GPU resources.
37
38---
39
40## 2. Persistent Substrate Architecture (`OmegaAcceleratorWorld`)
41
42The resident substrate resides in accelerator-accessible coherent memory and host memory on Grace Blackwell GB10 (128 GiB unified LPDDR5x RAM, `sm_121`):
43
44```text
45+-----------------------------------------------------------------------------------+
46| OmegaAcceleratorWorld |
47| |
48| +--------------------+ +--------------------+ +-----------------------------+ |
49| | RM Client & Device | | VAS Virtual Space | | Persistent GPFIFO Channel | |
50| | - Client handle | | - Coherent aperture| | - Channel group & GPFIFO ring| |
51| | - Subdevice handle | | - SMMUv3 mappings | | - USERD & Doorbell (+0x90) | |
52| +--------------------+ +--------------------+ +-----------------------------+ |
53| |
54| +--------------------+ +--------------------+ +-----------------------------+ |
55| | Code Registry | | Buffer Registry | | Coherent Scratch Arena | |
56| | - Cached kernels | | - Persistent memory| | - Zero-allocation scratch | |
57| | - Code digests | | - Generation tags | | - Dynamic sub-arenas | |
58| +--------------------+ +--------------------+ +-----------------------------+ |
59| |
60| +--------------------+ +--------------------+ +-----------------------------+ |
61| | Semaphore Ring | | Monotonic Gen Id | | Rolling State Digest | |
62| | - WFI completions | | - Object lifetimes | | - SHA-256 rolling execution | |
63| | - State progression| | - Invalidation | | integrity trace | |
64| +--------------------+ +--------------------+ +-----------------------------+ |
65+-----------------------------------------------------------------------------------+
66```
67
68### Persistent Components Maintained Across Operations
69The resident world maintains eleven persistent state components across continuous execution:
701. **RM Client & Root**: A single persistent NVRM client (`m16_native_open`) initialized once and preserved across operations.
712. **GPU Device & Subdevice Objects**: Established device object hierarchy bound to Grace Blackwell GB10 (`sm_121`).
723. **Virtual Address Space (VAS)**: A unified, coherent memory aperture avoiding per-operation virtual address space construction and teardown.
734. **Channel Group & GPFIFO Channel**: A persistent compute channel with configured methods, work submission structures, and engine bindings.
745. **USERD & Hardware Doorbell Mapping**: Direct MMIO aperture mapping for doorbell triggers (`offset +0x90`) held open across dispatches.
756. **Completion Mechanism & Semaphore Ring**: Coherent memory semaphore tracking task completion markers (`0x44444444`) and monotonic completion counters.
767. **Code Registry**: In-memory registry of compiled and verified sm_121 machine code artifacts (Vector Add, MatMul INT32, MatMul FP16, MatMul BF16) with deduplication by SHA-256 code digest.
778. **Buffer Registry**: Registered persistent input/output tensors and scratch regions tracked with generation identifiers and memory bounds.
789. **Coherent Scratch Arena**: Pre-allocated, reusable coherent memory buffer eliminating heap fragmentation and dynamic memory allocations on the hot dispatch path.
7910. **Monotonic Generation Counter**: Process-wide monotonic counter incremented on buffer allocation, reallocation, and revocation to invalidate dangling references.
8011. **Rolling State Digest**: Cryptographic SHA-256 hash chaining all dispatched operations, kernel digests, parameter hashes, and completion markers into an immutable execution trace.
81
82---
83
84## 3. Sustained Heterogeneous Execution & Queue Wraparound
85
86Milestone 19 requires continuous execution across varied compute primitives to demonstrate true substrate residency rather than a single looped microbenchmark.
87
88### Heterogeneous Workload Specification
89The resident substrate must execute continuous mixed workloads consisting of:
901. **Unsigned 32-bit Vector Addition** (`OMEGA_BLACKWELL_VECTOR`, M17 semantic contract).
912. **Integer Matrix Multiplication** (`OMEGA_BLACKWELL_MATMUL` INT32 intermediate contract).
923. **Tensor Core Matrix Multiplication FP16** (`HMMA.16816.F32` with FP32 accumulation).
934. **Tensor Core Matrix Multiplication BF16** (`HMMA.16816.F32.BF16` with FP32 accumulation).
94
95Each operation runs dynamically through the persistent GPFIFO channel, referencing resident buffers or dynamically bound inputs, without tearing down or reconstructing the accelerator world.
96
97### Queue Wraparound Management Invariant
98The GPFIFO submission channel uses a circular ring buffer of finite entries:
991. As dispatches accumulate (reaching and exceeding 1,000 operations), the GPFIFO put/get indices wrap around the ring boundary modulo the ring capacity.
1002. The submission driver must advance the put index across the ring boundary without pipeline stalls, race conditions, or pushbuffer corruption.
1013. Completed entries must be acknowledged via semaphore progress before overwrite.
102
103### The 1,000-Operation Benchmark
104Qualification requires continuous execution of at least 1,000 heterogeneous dispatches:
105- Total dispatches: $\ge 1,000$.
106- Workload: Alternating sequence across all four compute classes.
107- Zero Context Recreations: `m16_native_open` and channel construction invoked exactly once at world initialization.
108- Exact Parity: Every operation verified against its CPU reference oracle or mathematical bounds.
109- Memory Consumption: Resident heap and coherent memory consumption must remain bounded and flat (zero memory leak across 1,000 operations).
110
111---
112
113## 4. Capability Lifecycle, Invalidation, and Fault Recovery
114
115### Object Registration & Capability Tokens
116When buffers or code modules are registered in `OmegaAcceleratorWorld`, the caller receives a capability handle:
117
118$$\text{Handle} = \langle \text{handle\_id}, \text{object\_type}, \text{generation}, \text{base\_addr}, \text{size\_bytes}, \text{permissions} \rangle$$
119
120Dispatch validation requires:
1211. $\text{generation}_{\text{handle}} == \text{generation}_{\text{current}}$
1222. Requested dispatch bounds fall strictly within $[\text{base\_addr}, \text{base\_addr} + \text{size\_bytes})$.
1233. Operation requirements match granted permissions (read, write, execute).
124
125### Fail-Closed Stale Handle Refusal
126If an operation references a handle whose generation does not match the active registry state (for example, after buffer reallocation or revocation), the dispatch path rejects the request immediately:
127- Refusal occurs on the host driver side before pushbuffer generation or doorbell ringing.
128- An explicit error code (`OMEGA_ERR_STALE_HANDLE`) is returned.
129- Hardware state and channel integrity remain unaffected.
130
131### Fault Recovery Protocol
132If an operation encounters an intentional or accidental fault (such as a timeout or illegal instruction injection):
1331. The fault is contained within the resident channel.
1342. The substrate executes an isolated channel reset and state resynchronization.
1353. The root RM client, GPU device, and VAS remain intact.
1364. Subsequent valid operations resume execution successfully.
137
138---
139
140## 5. Zero Foreign Userspace Runtime Verification
141
142Strict execution invariant:
1431. `ldd <binary>`: Must show zero dynamic dependency on `libcuda.so*` or `libcudart.so*`.
1442. `nm -u <binary>`: Must show zero undefined symbols containing `cu` or `cuda`.
1453. `/proc/self/maps`: During persistent execution on DGX Spark, memory maps must confirm no loaded CUDA userspace drivers.
146
147---
148
149## 6. Qualification Gates & Cumulative Accounting
150
151Milestone 19 qualification requires passing 18 Milestone 19 gates in addition to the 157 cumulative regression gates established through Milestone 18. Total evaluated gates: 175.
152
153### Milestone 19 Qualification Gates
154- **Gate 1: `OMEGA_ACCEL_RESIDENT_WORLD_CREATE_PASS`**: Creation and deterministic initialization of persistent `OmegaAcceleratorWorld` substrate in coherent memory.
155- **Gate 2: `OMEGA_ACCEL_RESIDENT_CONTEXT_REUSE_PASS`**: Successful dispatch of successive distinct compute tasks reusing the same persistent RM client, GPU device, and VAS aperture without re-initialization.
156- **Gate 3: `OMEGA_ACCEL_RESIDENT_CHANNEL_REUSE_PASS`**: Successful reuse of GPFIFO channel, USERD, and doorbell mapping across successive pushbuffer submissions.
157- **Gate 4: `OMEGA_ACCEL_RESIDENT_CODE_REGISTRY_PASS`**: Resident code registry registration, lookup, deduplication, and execution of distinct sm_121 kernels (VecAdd, MatMul INT32, MatMul FP16, MatMul BF16).
158- **Gate 5: `OMEGA_ACCEL_RESIDENT_BUFFER_REGISTRY_PASS`**: Resident buffer registry managing persistent coherent memory buffers with handle tracking and bounds checking.
159- **Gate 6: `OMEGA_ACCEL_RESIDENT_MIXED_WORKLOAD_PASS`**: Alternating execution of mixed workloads (Vector Add, INT32 MatMul, FP16 MatMul, BF16 MatMul) on the shared resident channel.
160- **Gate 7: `OMEGA_ACCEL_RESIDENT_QUEUE_WRAP_PASS`**: GPFIFO pushbuffer ring buffer wraparound verified under continuous dispatch without channel stalls or pushbuffer corruption.
161- **Gate 8: `OMEGA_ACCEL_RESIDENT_1000_OP_PASS`**: Sustained continuous execution of $\ge 1,000$ heterogeneous operations on physical GB10 silicon without context teardown or re-initialization.
162- **Gate 9: `OMEGA_ACCEL_RESIDENT_GENERATION_PASS`**: Monotonic generation counters on resident objects correctly incrementing upon lifecycle transitions and updates.
163- **Gate 10: `OMEGA_ACCEL_RESIDENT_STALE_HANDLE_REFUSAL_PASS`**: Fail-closed refusal and error reporting when attempting dispatch with expired or stale capability handles from prior generations.
164- **Gate 11: `OMEGA_ACCEL_RESIDENT_REVOCATION_PASS`**: Deterministic capability revocation immediately invalidating registered buffers or code handles, with subsequent access rejected.
165- **Gate 12: `OMEGA_ACCEL_RESIDENT_FAULT_RECOVERY_PASS`**: Isolated channel reset and deterministic recovery upon fault injection without leaking system resources or corrupting device state.
166- **Gate 13: `OMEGA_ACCEL_RESIDENT_MEMORY_BOUND_PASS`**: Flat, bounded resident memory consumption with zero heap or coherent memory leaks measured across 1,000 operations.
167- **Gate 14: `OMEGA_ACCEL_RESIDENT_STATE_DIGEST_PASS`**: Deterministic rolling SHA-256 state digest verifying cumulative execution integrity across all completed operations.
168- **Gate 15: `OMEGA_ACCEL_RESIDENT_ZERO_LIBCUDA_PASS`**: Zero foreign userspace runtime verification (`ldd`, `nm -u`, `/proc/self/maps`) throughout resident substrate lifecycle.
169- **Gate 16: `OMEGA_ACCEL_RESIDENT_CLEAN_CLONE_PASS`**: Clean-clone isolated reproduction on DGX Spark silicon from scratch.
170- **Gate 17: `OMEGA_ACCEL_RESIDENT_REGRESSION_PASS`**: Cumulative regression parity: 157 / 157 prior milestone gates passing (M4 through M18).
171- **Gate 18: `OMEGA_ACCEL_RESIDENT_RECEIPT_PASS`**: Milestone 19 cryptographic qualification receipt generation with hardware trace evidence.
172
173---
174
175## 7. Deliverables & Acceptance Criteria
176
1771. **Architecture & Specification**: Canonical specification `docs/milestone-19-spec.md` ratified in `aien-spark/aien-architecture`.
1782. **Substrate Implementation**: Complete `OmegaAcceleratorWorld` implementation in `aien-spark/omega`.
1793. **Silicon Proof**: Physical execution receipts recorded on NVIDIA DGX Spark (Grace Blackwell GB10, `sm_121`).
1804. **Zero-Libcuda Audit**: Verification receipts confirming zero proprietary userspace CUDA runtime linkage or symbols.
1815. **Cortex Memory Commit**: Milestone qualification receipt committed to Spark Cortex space `atlas-memory`.