aien-architecture-mv
Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.
Brought by drakestapleton
aien-architecture-mv / docs / adr / 0044-one-cubin-writer-per-nvidia-target-family.md
| 1 | # ADR 0044: One cubin writer per NVIDIA target family, owned by CUDApp |
| 2 | |
| 3 | **Status:** Accepted (Drake, 2026-10-30). |
| 4 | This ADR moves no code. |
| 5 | **Related:** ADR 0042 (ARCH-0042) Decision 7, ADR 0043 call 15 (merged #343; CUDApp pin `780a0af1`). |
| 6 | [CUDApp#108](https://github.com/aien-dev/CUDApp/issues/108) tracks consolidation. |
| 7 | [CUDApp#170](https://github.com/aien-dev/CUDApp/issues/170) rebases onto this layout. |
| 8 | [CUDApp#190](https://github.com/aien-dev/CUDApp/pull/190), merged 2026-10-30 as `78fea51d`, added the inventory `docs/CUBIN_WRITERS.md`. |
| 9 | [omega-mv#864](https://github.com/aien-dev/omega-mv/pull/864) holds `seed/sm80/cubin.om`. |
| 10 | |
| 11 | --- |
| 12 | |
| 13 | ## Context |
| 14 | |
| 15 | On CUDApp main `d79519e0` the sm_121 ABI 8 writer is one writer with two bodies (inventory: |
| 16 | `docs/CUBIN_WRITERS.md`, added by [CUDApp#190](https://github.com/aien-dev/CUDApp/pull/190)). `src/omega_cubin.c` writes the |
| 17 | container only: it opens no device and performs no launch. The hosted build packs through |
| 18 | `om/cubin/cubin_elf.om`. The C body is slated for deletion. ADR 0043 call 15 cites the older |
| 19 | CUDApp pin `780a0af1`, where the GB10 column of `ob_code_load` names `omega_cubin.c` for cubins. |
| 20 | |
| 21 | omega-mv `seed/sm80/cubin.om` exists only on closed draft omega-mv#864. It accepts SM 80, 86, |
| 22 | 87, 89, 90, 100, 103, and 120, and it refuses 121. The body of |
| 23 | [omega-mv#864](https://github.com/aien-dev/omega-mv/pull/864#issue-6050605672) reports libcuda |
| 24 | load PASS lines: vecadd/ctl PASS on an RTX 4090 (sm_80/86/89), a B200 (sm_100), and an RTX 5090 |
| 25 | (sm_120). Those lines are reported by that PR and were not independently re-run for this ADR. |
| 26 | The same body reports what did not pass: the cubin without `.note.nv.tkinfo` still LOAD_FAILs |
| 27 | (200) on sm89 and sm120; sm_103 is NOT_RUN; sm_90 ABI 8 is NOT_RUN (the H100 hosts had driver |
| 28 | 550), while sm_90 ABI 7 vecadd/ctl PASS; the alu.s2 schedule race (WRONG/700 on sm89) is open. |
| 29 | sm_87 is in the accepted list but has no load line. |
| 30 | |
| 31 | ADR 0042 (ARCH-0042) makes CUDApp the owner. Decision 7 requires a separate consolidation |
| 32 | decision by Drake. This ADR records that decision (option B, 2026-10-30). ADR 0043 |
| 33 | does not cover the sm_80 family. |
| 34 | |
| 35 | ## Options |
| 36 | |
| 37 | The count is the one in CUDApp `docs/CUBIN_WRITERS.md` (CUDApp#190): two bodies of the sm_121 writer, plus `cubin.om`. |
| 38 | |
| 39 | - **A.** Keep both bodies and keep `cubin.om`. |
| 40 | - **B.** `cubin_elf.om` is canonical. |
| 41 | - **C.** `omega_cubin.c` is canonical. |
| 42 | |
| 43 | ## Decision |
| 44 | |
| 45 | Option B. One cubin writer per NVIDIA target family, owned by CUDApp. |
| 46 | |
| 47 | CUDApp owns all cubin writing, the sm_80 family included, under `backend/<target>/`. The |
| 48 | NVIDIA `backend/<target>/` directory does not exist on CUDApp yet. It is created when the |
| 49 | work moves. New writer work goes only into `.om`. `omega_cubin.c` is frozen, and it is |
| 50 | retired only after the `.om` writer produces byte-identical sm_121 cubins and loads on GB10. |
| 51 | That removal is a later, separate PR. The source names a different trigger: the header comment |
| 52 | of `src/omega_cubin.c` (CUDApp main `183fa4f1`, line 18) says the C body "is deleted once the |
| 53 | freestanding binding lands". The two conditions differ. The freestanding binding is a build |
| 54 | prerequisite, because the freestanding build (`OMEGA_GPU_NO_POSIX`) still packs through the C |
| 55 | body (`docs/CUBIN_WRITERS.md`, writer row C). Retirement also needs this ADR's condition. This |
| 56 | ADR does not edit that comment. |
| 57 | |
| 58 | omega-mv#864's ABI 8 and register-reserve findings are ported into CUDApp as new work. No |
| 59 | writer stays in omega-mv except a declared, pinned oracle (ADR 0042 Decision 4). CUDApp#170 |
| 60 | rebases onto this layout. |
| 61 | |
| 62 | ## Consequences |
| 63 | |
| 64 | CUDApp#108 tracks consolidation. ADR 0042 Consequences names each owner's issue as the place a |
| 65 | later consolidation decision is recorded; for the cubin writer that issue is |
| 66 | [CUDApp#108](https://github.com/aien-dev/CUDApp/issues/108), and this ADR is that decision. |
| 67 | The inventory is CUDApp `docs/CUBIN_WRITERS.md`, added by merged PR CUDApp#190. It records the |
| 68 | tkinfo difference on sm_121 ABI 8 and the stored register count; that open work is tracked in |
| 69 | CUDApp#108 (its REGS+2 and tkinfo findings, "Done when" 3). |
| 70 | The alu.s2 race issue is [CUDApp#191](https://github.com/aien-dev/CUDApp/issues/191). Hardware tiers stay NOT_RUN until an authorized window. |
| 71 | This ADR moves no code. |
| 72 | |
| 73 | ## Source |
| 74 | |
| 75 | - ADR 0042, merged as #342. Decision 7 requires the separate consolidation decision recorded here. |
| 76 | - ADR 0043, merged as #343 (`a0a7146`). Call 15 (`ob_code_load`) cites CUDApp `780a0af1`. |
| 77 | - CUDApp main `d79519e0`: `src/omega_cubin.c` and `om/cubin/cubin_elf.om`. |
| 78 | - CUDApp#108, CUDApp#170, CUDApp#190 (merged as `78fea51d`; `docs/CUBIN_WRITERS.md` on CUDApp main `183fa4f1`). |
| 79 | - omega-mv#864, `seed/sm80/cubin.om` on `ck/cubin-om` (`76639738`). |