omega-blas
aien-dev/omega-blas
Brought by drakestapleton
omega-blas / receipts / netlib-gb10-20261027.md
| 1 | # Receipt: netlib SGEMM / SGEMV and the batched entry points on the GB10 device path, 2026-10-27 |
| 2 | |
| 3 | Status: EXERCISED on the chip (GB10, DGX Spark) and on the host. This is not QUALIFIED: omega-blas |
| 4 | has no named GB10 qualification gate yet. |
| 5 | |
| 6 | ## Revision and target |
| 7 | |
| 8 | - omega-blas: the commit that adds this receipt. Source: `src/omegablas.c`, `include/omegablas.h`, |
| 9 | `Makefile`, `tests/netlib/run.sh`, `tests/gb10/hooks.c`. The source was unchanged between the runs |
| 10 | and the commit. `build-gb10/libomegablas.so` sha256 |
| 11 | `b672534f8669f09bfc578532142f5d8337cbe32652c39dea7e8b1d3566ca162d`. |
| 12 | - CUDApp `b28372d1f9ebb4edf5f347eb6ce2e8d7ca21e2c5` (aien-dev/CUDApp#139, `gemm-general/gemm-ex`, |
| 13 | draft), clean tree. It was built by `make GB10=1` with `-fPIC` and |
| 14 | `CUDAPP_MIGRATION_PENDING_GEMM_EX=1`. `libomega_gpu.a` sha256 |
| 15 | `725341d11fb8d879f70101fbf1c580aadee6aa113dfe1e46ca0374ad76a3543e`. Every route line in the logs |
| 16 | prints this CUDApp sha. |
| 17 | - OM-2 omc and omega-bridge as in PINS. Toolchain: cc and GNU Fortran 13.3.0 (Ubuntu |
| 18 | 13.3.0-6ubuntu2~24.04.1). LAPACK v3.12.1, tarball sha256 `2ca6407a…2422` (tests/netlib/fetch.sh). |
| 19 | - Platform: kernel 7.0.0-1019-nvidia, NVIDIA open kernel module 580.173.02. The holds ran beside the |
| 20 | live 35B server; its health was `"status":"ok"` before and after every hold (`*/health.txt`). |
| 21 | - Paths in the copied logs are rewritten to `$WORK` / `$HOME`. |
| 22 | |
| 23 | ## Holds (flock /tmp/aien-gb10.lock, each under 15 min, UTC) |
| 24 | |
| 25 | | Hold | Start to end | Command (`OMB_BUILD=build-gb10 OMEGABLAS_DEVICE=gb10 sh tests/netlib/run.sh` plus) | Exit | |
| 26 | |---|---|---|---| |
| 27 | | h1 | 08:13:28 to 08:13:30 | `DRIVERS=sblat2` (sizing run) | 1, because three drivers were NOT_RUN by selection | |
| 28 | | h2 | 08:14:22 to 08:14:35 | none: stock decks, THRESH 16.0, the **gate** | 0 | |
| 29 | | h3 | 08:14:41 to 08:14:54 | `THRESH=0.0` (measurement) | 0 | |
| 30 | | h4 | 08:14:54 to 08:14:55 | `GB10_HOOKS=<CUDApp> OMB_TEST_MUTANT=1` | 1 (expected) | |
| 31 | | h5 | 08:15:04 to 08:15:06 | the same with `OMB_TEST_MUTANT=2`, then `OMB_TEST_MUTANT=4` | 1, 1 (expected) | |
| 32 | | h6 | 08:15:15 to 08:15:18 | `strace -f -e trace=openat,ioctl ./sblat2`, with the h2 binaries | 0 | |
| 33 | | h7 | 08:27:42 to 08:27:43 | `CHIP_TEST=gb10`: `tests/gb10/run.sh` (batched.c) | 0 | |
| 34 | | h8 | 08:27:43 to 08:27:43 | the same with `GB10_HOOKS=<CUDApp> OMB_TEST_MUTANT=2` | 1 (expected) | |
| 35 | |
| 36 | ## Results |
| 37 | |
| 38 | Gate, h2 (`chip-h2-stock-all/run.log`). Each driver's route line reads `device gb10 host 0`, so every |
| 39 | call reached the device path. |
| 40 | |
| 41 | | Driver | Netlib verdict | Calls (netlib count) | Device calls / tensor-core calls | Wall | |
| 42 | |---|---|---|---|---| |
| 43 | | sblat2 | SGEMV PASSED computational and error exits | 3461 | 3072 / 2304 | 0.989 s | |
| 44 | | sblat3 | SGEMM PASSED computational and error exits | 17496 | 10350 / 6750 | 2.802 s | |
| 45 | | c_sblat2 | cblas_sgemv PASSED column-major and row-major, and error exits | 3460 + 3460 | 6144 / 4608 | 2.278 s | |
| 46 | | c_sblat3 | cblas_sgemm PASSED column-major and row-major, and error exits | 17496 + 17496 | 20700 / 13500 | 6.184 s | |
| 47 | |
| 48 | Device calls are fewer than netlib calls because quick returns (m or n = 0, or alpha = 0 with |
| 49 | beta = 1) never leave the host. That is correct BLAS behaviour, and the counters do not include |
| 50 | them. `gb10_host_fixed` is 0 in all four drivers: no non-finite input reached CUDApp's host repair. |
| 51 | |
| 52 | Tolerance (docs/TOLERANCE.md, derived in Wolfram): for k <= 9 a correct bf16x3 result has a netlib |
| 53 | ratio of at most **11.19993**, below the deck's **THRESH 16.0**. The stock decks are therefore the |
| 54 | gate, unmodified. |
| 55 | |
| 56 | Measured largest ratio, h3 (`chip-h3-thresh0/run.log`): SGEMV **1.61** (sblat2, and c_sblat2 in |
| 57 | both orders) and SGEMM **1.87** (sblat3, and c_sblat3 in both orders). On the host, the same |
| 58 | measurement gave 1.48 / 1.51 for SGEMV and 0.00 for SGEMM (`host/host-thresh0.log`). |
| 59 | |
| 60 | ## Negative controls |
| 61 | |
| 62 | - h4, mutant 1 (CUDApp drops the last k element): all four drivers FATAL. It never reached the |
| 63 | tensor core (`gb10_core_calls 0`): the first failing call has k = 1, which leaves the core no work. |
| 64 | - h5, mutant 2 (CUDApp forces op(B) = N): all four FATAL, after 97 tensor-core calls (sblat2 and |
| 65 | c_sblat2) and 73 (sblat3 and c_sblat3). This is the control that exercises the chip. |
| 66 | - h5, mutant 4 (CUDApp forces beta = 0): all four FATAL on their first beta != 0 call, before any |
| 67 | tensor-core call. |
| 68 | - h6, device evidence (`chip-h6-strace/strace-summary.txt`): during a passing sblat2 run, the process |
| 69 | opened `/dev/nvidia0` 2 times, `/dev/nvidia-uvm` 2 times and `/dev/nvidiactl` 2315 times, and made |
| 70 | 18508 ioctls. [INFERENCE] The per-call control-handle opens look like CUDApp's per-call buffer |
| 71 | setup and probably account for most of the per-call time below. Not profiled. |
| 72 | |
| 73 | ## Batched, strided and single f32 products (tests/gb10/batched.c) |
| 74 | |
| 75 | There are 46 cases: strided batches of 3 in both layouts and all four transpose pairs, with shapes |
| 76 | (M,N,K) of (1,1,1), (3,5,2), (9,7,9), (16,13,16) and (4,6,0), and ld padding plus gaps between |
| 77 | batches. Two cases have overlapping C (stride 0, beta 0: the last problem wins). Two use pointer |
| 78 | arrays. One is `omb_gemm_ex` with a row bias and one is bf16, and both must stay on the host. Each |
| 79 | case checks every element against a double reference within the derived limit (device route 5.70, |
| 80 | host route 9.51; docs/TOLERANCE.md), checks that no element outside the products moved, and |
| 81 | checks the predicted route-counter movement. |
| 82 | |
| 83 | - Chip h7 (`chip-h7-batched/run.log`): 46 of 46 pass. Largest ratio: device route **1.116**, host |
| 84 | route 0.832. Routes: host 2, gb10 52 (40 strided batches in one call each, plus 2 x 3 |
| 85 | overlapping and 2 x 3 pointer problems), 108 tensor-core calls. |
| 86 | - Host, with the HMMA model in place of the chip (`host/batched-model.log`): 46 of 46 pass, with |
| 87 | the same 1.116 / 0.832 and the same route and core counts. Host path on both builds |
| 88 | (`host/batched-gb10build-host.log`, `host/batched-default-host.log`): 46 of 46 pass, largest |
| 89 | ratio 1.330, routes host 134 gb10 0. |
| 90 | - Negative controls. Chip h8, CUDApp mutant 2: 16 cases fail, exit 1. On the model, CUDApp |
| 91 | mutant 1: 36 fail; mutant 2: 16 fail; mutant 4: 42 fail. Mutant 5 changes only the fp8 |
| 92 | block-scale path and passes (0 fail), as expected. |
| 93 | - Library-side mutants, planted in a throwaway copy of `src/omegablas.c` and built `GB10=1`, run on |
| 94 | the model: |
| 95 | - op(A) and op(B) swapped in the gemm_ex mapping (`host/libmutant-opswap.diff`): two cases fail |
| 96 | on their values, then gemm_ex rejects a call with BAD_ARGS and the process aborts with exit |
| 97 | 134. |
| 98 | - stride_a and stride_b swapped (`host/libmutant-strideswap.txt`): gemm_ex rejects the first |
| 99 | batched call and the process aborts with exit 134. |
| 100 | |
| 101 | Neither result is silent. |
| 102 | |
| 103 | ## Host (EXERCISED host, `host/`) |
| 104 | |
| 105 | - Default build (`build/`), stock decks: four of four PASS with unchanged call counts |
| 106 | (`host-default.log`, `host-timing.log`, and `host-final.log` after the last edit to the branch). |
| 107 | - The `GB10=1` library with no `OMEGABLAS_DEVICE`: four of four PASS on the host path |
| 108 | (`gb10build-hostmode.log`). |
| 109 | - The `GB10=1` library with the device path on the chip-exact HMMA model |
| 110 | (`OMB_TEST_BACKEND=model`, no GPU opened): four of four PASS with the same device and core call |
| 111 | counts as h2 (`model-device.log`). Largest ratios 1.61 and 1.87, identical to the chip |
| 112 | (`model-thresh0.log`). Mutant 1 on the model: four of four FATAL (`model-mutant1.log`). |
| 113 | - Refusals: `OMEGABLAS_DEVICE=gb10` on the default build aborts with "built without the GB10 path" |
| 114 | (`unbuilt-gb10.err`), and `OMEGABLAS_DEVICE=cuda` aborts (`badenv.err`). |
| 115 | - `tests/netlib/fetch.sh`: a fresh download verified against the pinned sha256 (exit 0), and a |
| 116 | corrupted tarball in its place is refused (exit 1). |
| 117 | |
| 118 | ## Timing (predeclared 08:17Z before the host arm ran; N = 1 per arm; MEASURED) |
| 119 | |
| 120 | Metric: the per-driver wall time printed by run.sh, with identical decks. Predeclared expectation: |
| 121 | the device is slower, because netlib shapes (n <= 9) measure launch latency. Conditions differ: the |
| 122 | host arm ran under `nice -n 19 taskset -c 10-14`, the device arm unpinned. |
| 123 | |
| 124 | | Driver | Host | GB10 | GB10/host (Wolfram) | GB10 per device call | |
| 125 | |---|---|---|---|---| |
| 126 | | sblat2 | 0.0223 s | 0.989 s | 44.4x | 0.322 ms | |
| 127 | | sblat3 | 0.103 s | 2.802 s | 27.3x | 0.271 ms | |
| 128 | | c_sblat2 | 0.0442 s | 2.278 s | 51.6x | 0.371 ms | |
| 129 | | c_sblat3 | 0.216 s | 6.184 s | 28.7x | 0.299 ms | |
| 130 | |
| 131 | The device path is a correctness path for these sizes, not a speedup. Large-shape throughput was |
| 132 | NOT_RUN in this receipt. |
| 133 | |
| 134 | ## NOT_RUN |
| 135 | |
| 136 | - Large-k device numerics (k > 16, where the fixed netlib THRESH 16 no longer bounds a correct |
| 137 | result; docs/TOLERANCE.md). |
| 138 | - `omb_gemm_ex` f32 with a fused epilogue on the device: by design it stays on the host |
| 139 | (exercised as a host-route case above). |
| 140 | - Throughput at large shapes, and repeated timing runs. |
| 141 | - The python and DLPack binding against `build-gb10`, and `tests/smoke.py` on the device path |
| 142 | (its limits are not derived for the device; docs/TOLERANCE.md). |