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 / gpu / amd / gfx942 / fp8gemv / PROPOSAL.md
| 1 | # What Omega cannot say yet |
| 2 | |
| 3 | The GEMV is a gfx942 instruction table (`fp8gemv_stream.isa`) packed by |
| 4 | `gpu/amd/gfx942/hsaco.om`. That is the path this tree already uses for a kernel. |
| 5 | The numeric references in `check.om` (a column-order loop and the kernel's own |
| 6 | order, composed with `exec/fma.om`) are OM-2. The table is data. It is not a |
| 7 | typed Omega load. |
| 8 | |
| 9 | These are the operations the kernel needs and OM-2 does not have as operations. |
| 10 | Each one is emitted as instruction fields instead. |
| 11 | |
| 12 | 1. A 128-bit global load with a cache policy. `global_load_dwordx4` plus the |
| 13 | nt bit is three fields in format 7 (OP 23, NT at the bit `llvm-mc` sets, SADDR). |
| 14 | A language operation would be a typed load of four u32, or sixteen u8, with an |
| 15 | enum for the Table 48 row (wave temporal, wave nontemporal, and the scoped |
| 16 | rows) rather than a raw bit. |
| 17 | |
| 18 | 2. `V_CVT_PK_F32_FP8`. Table 31 names it as a VOP1 packed convert, destination |
| 19 | even. The kernel uses the `e32` form `llvm-mc` encodes (opcode 86) on the low |
| 20 | 16 bits, then `v_lshrrev_b32` by 16 and the same convert. The ISA sentence on |
| 21 | 8-bit converts says SRC0 is SDWA and the byte select lives in the SDWA word. |
| 22 | This kernel does not invent an SDWA select code. A language operation would |
| 23 | name the source bytes. |
| 24 | |
| 25 | 3. DPP `row_shr` with the assembler's default row mask and bank mask, and with |
| 26 | bounds control clear (ISA ยง13.3.9, BC = 0 means do not write when the source |
| 27 | is out of the row). The reduction is four of those adds and four |
| 28 | `v_readlane_b32`. A language reduction would name the row sum. It would not |
| 29 | make the programmer pick lane 15. |
| 30 | |
| 31 | 4. `buffer_wbl2` and `buffer_inv` with the sc0/sc1 pairs LLVM's GFX942 acquire |
| 32 | and release sequences use, and a global atomic whose sc1 is the scope bit. |
| 33 | The probe encodes them. The GEMV does not issue them. OM-2 has no memory |
| 34 | scope on a store. |
| 35 | |
| 36 | 5. A cross-wave reduction. The fused epilogue multiplies by an `inv_rms` the |
| 37 | host passes in. One wave owns one row and cannot compute the RMS of the |
| 38 | whole vector. A workgroup or device reduction would have to exist before the |
| 39 | kernel could produce that scale itself. |
| 40 | |
| 41 | The closest expressible program is the one in this directory: the table, the |
| 42 | probe, and the CPU reference. Per-block scales and OCP E4M3 are reference-only. |
| 43 | The device code object is Table 30 FP8 and a per-row scale. |