omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / spec / blackwell-matmul.md
| 1 | # OMEGA Blackwell Tensor MatMul Specification (Milestone 18) |
| 2 | |
| 3 | Canonical Reference: `SPEC-ACCEL-M18` (`docs/milestone-18-spec.md` in `aien-architecture`) |
| 4 | |
| 5 | ## 1. Scope & Sovereignty Mandate |
| 6 | Milestone 18 establishes native Blackwell tensor matrix multiplication on physical NVIDIA DGX Spark GB10 silicon. |
| 7 | |
| 8 | Milestone 18 strictly forbids qualifying through static precompiled instruction tables. OMEGA must operate as a dynamic sm_121 machine code generator: |
| 9 | 1. **Instruction Selection**: Lowering matrix multiplication semantic graph ($G_S$) into native sm_121 instruction nodes. |
| 10 | 2. **Bounded Deterministic Register Allocation**: Live-interval computation and physical register assignment (R0-R255, UR0-UR63) scoped to matrix multiplication kernels. Rejects predetermined hardcoded register tables. |
| 11 | 3. **Operand & Field Encoding**: Programmatic synthesis of 128-bit sm_121 machine code words. |
| 12 | 4. **Instruction Sequencing**: Dynamic assembly of load stages, tensor-core matrix multiply-accumulate operations, synchronization barriers, and global memory stores. |
| 13 | 5. **Dynamic QMD v5.0 Launch Descriptors**: 2D CTA grid rasterization configured for matrix tile geometry. |
| 14 | 6. **Native M16 GPFIFO Pushbuffer Submission**: Direct hardware launch and coherent semaphore completion on physical GB10 silicon. |
| 15 | 7. **Zero Foreign Userspace Runtime**: Zero dynamic linkage to `libcuda.so` or `libcudart.so`. |
| 16 | |
| 17 | ## 2. Mandatory Tensor-Core Completion Invariant |
| 18 | INT32 matrix multiplication serves strictly as an intermediate codegen qualification step. Milestone 18 cannot complete until: |
| 19 | 1. FP16 or BF16 tensor-core MMA executes on physical GB10 silicon. |
| 20 | 2. Accumulation executes in FP32 precision. |
| 21 | 3. Machine code is generated dynamically by OMEGA without static instruction tables. |
| 22 | 4. Numerical parity falls strictly within bounded reference tolerances. |
| 23 | 5. Empirical hardware evidence proves that the physical tensor-core MMA execution path was utilized. |
| 24 | |
| 25 | ## 3. Mathematical Contract |
| 26 | $$C[m, n] = \sum_{k=0}^{K-1} A[m, k] B[k, n] \quad \text{for } m \in [0, M-1], n \in [0, N-1]$$ |
| 27 | |
| 28 | - Intermediate Stage: Signed/unsigned 32-bit integer arithmetic ($C[m, n] \pmod{2^{32}}$) with exact bit-for-bit mathematical parity against CPU reference oracle. |
| 29 | - Mandatory Final Stage: FP16/BF16 tensor-core arithmetic with FP32 accumulator within ULP bounds. |
| 30 | - Dimensions: Square canonical tiles ($16\times 16$, $32\times 32$) and rectangular sweeps ($16\times 64 \times 32$). |
| 31 | |
| 32 | ## 4. Four-Component Realization Identity |
| 33 | $$\text{REALIZATION\_ID} = \text{SHA-256}(\text{spec\_id} \parallel \text{machine\_id} \parallel \text{code\_digest} \parallel \text{sm\_arch})$$ |
| 34 | Where `code_digest` is computed over the dynamically generated machine code. |
| 35 | |
| 36 | ## 5. Ordered Development Sequence |
| 37 | 1. INT32 semantic matrix multiplication contract. |
| 38 | 2. Minimal IR and selected instruction nodes. |
| 39 | 3. Bounded deterministic register allocator. |
| 40 | 4. Dynamic scalar integer instruction encoder. |
| 41 | 5. Physical INT32 matrix multiplication pass on GB10. |
| 42 | 6. Stage-1 Dynamic codegen variation proof (`M18_CODEGEN_VARIATION_PASS`). |
| 43 | 7. FP16/BF16 semantic matrix contract with FP32 accumulation. |
| 44 | 8. Empirical determination of minimum sm_121 tensor MMA instruction forms using allowed research oracles. |
| 45 | 9. Integration of tensor MMA instruction forms into OMEGA dynamic encoder. |
| 46 | 10. Tensor tile register allocation. |
| 47 | 11. Dynamic tensor-core kernel generation. |
| 48 | 12. Physical GB10 tensor execution. |
| 49 | 13. FP32-accumulation numerical parity verification. |
| 50 | 14. Hardware evidence proof of tensor-core utilization (9-point evidence bundle). |
| 51 | 15. Clean-clone isolated reproduction, zero-libcuda proof, and durable qualification receipt. |
| 52 | |
| 53 | ## 6. Milestone 18 Qualification Gates |
| 54 | - Gate 1: `OMEGA_BW_MATMUL_SEMANTIC_CONTRACT_PASS` |
| 55 | - Gate 2: `OMEGA_BW_MATMUL_MACHINE_GRAPH_PASS` |
| 56 | - Gate 3: `OMEGA_BW_MATMUL_ENCODER_UNIT_PASS` |
| 57 | - Gate 4: `OMEGA_BW_MATMUL_BOUNDED_REGALLOC_PASS` |
| 58 | - Gate 5: `OMEGA_BW_MATMUL_INSTRUCTION_SEQUENCING_PASS` |
| 59 | - Gate 6: `OMEGA_BW_MATMUL_CODE_TRUTH_PASS` |
| 60 | - Gate 7: `OMEGA_BW_MATMUL_CODEGEN_VARIATION_PASS` (Stage-1: 16x16x16 INT32 vs 32x16x64 INT32 distinct allocation, code bytes, digests) |
| 61 | - Gate 8: `OMEGA_BW_MATMUL_REALIZATION_ID_PASS` |
| 62 | - Gate 9: `OMEGA_BW_MATMUL_QMD_2D_PASS` |
| 63 | - Gate 10: `OMEGA_BW_MATMUL_NATIVE_SUBMIT_PASS` |
| 64 | - Gate 11: `OMEGA_BW_MATMUL_INT32_INTERMEDIATE_PASS` |
| 65 | - Gate 12: `OMEGA_BW_MATMUL_TENSOR_CORE_EXECUTION_PASS` (Mandatory completion gate with 9-point evidence bundle & FP16 != BF16 variation) |
| 66 | - Gate 13: `OMEGA_BW_MATMUL_NUMERICAL_BOUND_PASS` |
| 67 | - Gate 14: `OMEGA_BW_MATMUL_BOUNDARY_ANNIHILATION_PASS` |
| 68 | - Gate 15: `OMEGA_BW_MATMUL_ZERO_LIBCUDA_PASS` |
| 69 | - Gate 16: `OMEGA_BW_MATMUL_CLEAN_CLONE_PASS` |
| 70 | - Gate 17: `OMEGA_BW_MATMUL_REGRESSION_PASS` (139 / 139 prior milestone gates) |
| 71 | - Gate 18: `OMEGA_BW_MATMUL_RECEIPT_PASS` |