interplane.Get Omega
Read in your language

omega-dnn

aien-dev/omega-dnn

Brought by drakestapleton

branch main Branches Tags History

omega-dnn / evidence / STACK7-GPU-20261026 / GPU.md

301 lines · 21819 bytes Raw Blame History Source

OmegaDnn GB10 GPU rows: Omega-emitted DNN kernels vs PyTorch CUDA / cuDNN

Lane OmegaDnn.GpuDnn. Machine: DGX Spark, NVIDIA GB10 (sm_121), driver 580.173.02. Omega source: aien-dev/omega-mv e5b32567a (worktree /tmp/OmegaDnn/gpu/omega-mv), physics at the physics.lock pin 048e5f5e8 (worktree /tmp/OmegaDnn/gpu/physics). Baseline: /home/drakestapleton/.venv (read-only): torch 2.14.0+cu130, CUDA 13.0, cuDNN 92400 (9.24.0), numpy 2.5.3.

Status of the kernels under test: INTERIM. Every Omega GPU kernel below is emitted as SASS by C code in omega-mv (src/omega_gpu_*_api.c IR builders and src/omega_blackwell_codegen_*.c). That is C codegen, not .om. It is the code the engine runs today, measured as it stands.

Evidence label for any chip row here: QUALIFIED-on-GB10 candidate (one machine, one driver). It is not QUALIFIED in general.

1. Inventory

OpOmega kernel emitter (omega-mv e5b32567a)Host APITest program (Makefile target)Measured here
RMSNorm f32IR built in src/omega_gpu_elementwise_api.c, lowered by src/omega_blackwell_codegen.comega_gpu_rmsnorm_f32 (src/omega_gpu_elementwise_api.h)tests/gpu_elementwise_test.c → build/gpu_elementwise_testyes
RoPE f32 (rotate-half)same fileomega_gpu_rope_f32sameyes
SwiGLU f32same fileomega_gpu_swiglu_f32sameyes
GQA attention, f32 KV (decode, 1 query)IR built in src/omega_gpu_attention_api.comega_gpu_gqa_attention_f32 (src/omega_gpu_attention_api.h)tests/gpu_attention_test.c → build/gpu_attention_testyes (hd 64, 128)
GQA attention, f32 KV, causal prefill rowssame fileomega_gpu_gqa_attention_rows_f32sameyes (hd 128)
Paged decode attention, bf16 KVsame fileomega_gpu_paged_attention_bf16 (+ _batch_, resident pool omega_gpu_attention_pool_alloc)sameyes (resident pool, hd 128)
Fused decode attention hd128 (qk-norm + RoPE + KV write + attend, 32q/4kv)src/omega_blackwell_codegen_attn.comega_gpu_decode_attn (src/omega_gpu_decode_attn_api.h)tests/gpu_decode_attn_test.c → build/gpu_decode_attn_testinventory only
Fused decode attention hd256 (24q/4kv, partial RoPE)src/omega_blackwell_codegen_attn256.comega_gpu_decode_attn256tests/gpu_decode_attn256_test.c → build/gpu_decode_attn256_testinventory only
Prefill attention hd128 (tensor cores)src/omega_blackwell_codegen_pattn.c, _pf.c, _tc.comega_gpu_prefill_attntests/gpu_prefill_attn_test.c → build/gpu_prefill_attn_testinventory only
Prefill attention hd256src/omega_blackwell_codegen_pattn256.c, _attn256.c, _tc.comega_gpu_prefill_attn256tests/gpu_prefill_attn256_test.c → build/gpu_prefill_attn256_testinventory only
Gated DeltaNet decode stepsrc/omega_blackwell_codegen_gdn.comega_gpu_gdn_step (src/omega_gpu_gdn_api.h)tests/gpu_gdn_test.c, tests/gpu_gdn_multi_test.cinventory only
MoE router (one launch)src/omega_blackwell_codegen_router.comega_gpu_router_api.htests/gpu_router_test.c → build/gpu_router_testinventory only
MoE expert window matmul / FP8 GEMVsrc/omega_blackwell_codegen_moe.c, _moe2.comega_gpu_moe_api.h, omega_gpu_fp8_api.htests/gpu_moe_window_test.c, tests/gpu_fp8_api_test.cinventory only

"Inventory only" means NOT_RUN in this pass. The fused engine kernels take engine state (a KV cache object, norms, GDN layer weights), so a like-for-like torch baseline needs a separate harness. They are not measured here, and nothing below makes a claim about them.

2. Protocol (frozen before the first timed run)

Arms:

Cases (dtype f32 unless noted):

CaseShapePredeclared baseline (decides the ratio)Reference-only baselines
rmsnorm_1x2048rows 1, dim 2048, eps 1e-5torch_rms_norm (F.rms_norm)none
rmsnorm_64x2048rows 64, dim 2048torch_rms_normnone
rope_32x12832 heads x hd 128, rotate-half, pos 1234, theta 1e6torch_ops (mul/sub/cat)none
swiglu_5632n 5632torch_silu_mul (F.silu(g)*u)none
swiglu_131072n 131072torch_silu_mulnone
gqa_f32_32q8kv_hd128_ctx20481 query, 32 q / 8 kv heads, hd 128, ctx 2048sdpa_efficient_f32sdpa_{cudnn,flash,math}_f32 (cudnn/flash expected to refuse f32), sdpa_{cudnn,flash}_bf16_REFONLY
gqa_f32_32q4kv_hd64_ctx20481 query, 32 q / 4 kv, hd 64, ctx 2048sdpa_efficient_f32same
gqa_rows_f32_32q8kv_hd128_m256256 causal rows, base 0, 32 q / 8 kv, hd 128sdpa_efficient_f32 (is_causal)same
paged_bf16_32q8kv_hd128_ctx2048_bs16bf16 KV pool, block 16, 128 scattered blocks, 1 seq, 32 q / 8 kv, hd 128, q f32sdpa_cudnn_bf16_pregathered (cuDNN, KV already contiguous, q rounded to bf16)gather+sdpa_cudnn_bf16, the flash/efficient/math variants, sdpa_efficient_f32q_f32kv_pregathered

Metrics, per timed call:

Design:

Statistics (Wolfram):

Correctness:

Negative control:

No re-run selection. A re-run happens only for a documented machine fault, and both runs are then reported. Machine load is recorded, since the Spark load1 was ~18-20 when this was written.

Protocol sha256, recorded before the first timed run (gpu-bench/protocol.sha256):

check.py later gained only the --perturb-q flag, which is the input-side control declared above. The driver later gained only the post-hoc --spin-us flag (section 6). Both new hashes are appended to the same file.

3. Runs: commands, dates, lock holds, compute-apps check

UTC endCommand (cwd /tmp/OmegaDnn/gpu/omega-mv)rclock held (s)compute-apps after
01:23:48./build/gpu_elementwise_test --out …/elementwise.json00.357empty
01:24:05./build/gpu_elementwise_test --timing --out …00.677empty
01:24:06./build/gpu_attention_test --out …00.994empty
01:24:14./build/gpu_attention_test --timing --out …00.809empty
01:24:15./build/gpu_attention_test --hd 128 --out …01.153empty
01:24:21bench/omega_dnn_bench runs/corr/omega01.167empty
01:24:31taskset -c 8-9 ~/.venv/bin/python bench/torch_arm.py runs/corr/omega runs/corr/torch04.649empty
01:24:46bench/omega_dnn_bench runs/mutant/omega --mutant00.749empty
01:25:23python bench/run_paired.py runs/paired 5 1: 12 arm processes, holds 0.66-3.53 s each (rounds.jsonl)0≤3.531 per processempty after every process
01:26:43-45bench/omega_dnn_bench_spin runs/spin/rN --spin-us 5000 (post-hoc, ×3)01.086 / 0.555 / 0.554empty

The longest single lock hold was 4.65 s, far under the 20 min cap. BOARD has 24 OmegaDnn.GpuDnn lines, a START and an END for each row; the campaign row has one pair.

Output excerpts:

gpu_elementwise_test --out:  PASS swiglu_131073 n=131073 rc=OK violations=0 … | mutant rc=OK violations=131059 CAUGHT
                             PASS: 35 checks, 0 failed
gpu_elementwise_test --timing: PASS timing rmsnorm_1x2048 … ok_calls=100/100 violations=0 median_ms=0.105 … chip_us_mean=101.6
                             PASS timing swiglu_5632 … median_ms=0.109 … chip_us_mean=101.7 ;  PASS: 4 checks, 0 failed
gpu_attention_test --out:    mutant Q_ROW: caught 8 of 8 ; mutant OUT_ROW: caught 8 of 8 ; PASS: 219 checks, 0 failed
gpu_attention_test --timing: PASS timing gqa_f32_tinyllama_32q4kv_ctx2048 … median_ms=0.652 p90_ms=1.167 … chip_us_mean=567.0
gpu_attention_test --hd 128: hd128 dominant token 299 (warp 1 of chunk 2): rc OK, 0 bad, worst 0 ; PASS: 225 checks, 0 failed
torch_arm (f32 cases):       sdpa_cudnn_f32 / sdpa_flash_f32: "RuntimeError: No available kernel. Aborting execution."

4. Correctness (first output of each arm vs float64 numpy reference, gpu-runs/corr/check.jsonl)

rel = max abs / max |ref| (normwise). Columns: Omega max abs, Omega rel, Omega violations, then the same three for the baseline.

CaseOmega max absOmega relOmega viol.Baseline (arm)Baseline max absBaseline relBaseline viol.
rmsnorm_1x20481.73e-76.86e-80torch_rms_norm1.73e-76.86e-80
rmsnorm_64x20483.95e-71.51e-70torch_rms_norm4.44e-71.70e-70
rope_32x1289.85e-87.25e-80torch_ops9.85e-87.25e-80
swiglu_56325.54e-79.73e-80torch_silu_mul6.15e-71.08e-70
swiglu_1310727.63e-71.34e-70torch_silu_mul6.73e-71.18e-70
gqa_f32_32q8kv_hd128_ctx20481.08e-71.40e-60sdpa_efficient_f324.44e-85.75e-70
gqa_f32_32q4kv_hd64_ctx20486.39e-81.61e-60sdpa_efficient_f322.54e-86.40e-70
gqa_rows_f32_32q8kv_hd128_m2561.44e-71.44e-70sdpa_efficient_f322.08e-72.09e-70
paged_bf16_32q8kv_hd128_ctx2048_bs161.67e-82.11e-70sdpa_cudnn_bf16_pregathered2.16e-42.73e-31816 (not gated)

Notes:

5. Negative controls (gpu-runs/mutant/)

6. Performance (paired, 5 measured rounds × 50 calls = 250 samples per arm per case, gpu-runs/paired/)

Statistics came from Wolfram. Inputs are in gpu-runs/paired/wolfram/<case>.wl. Per case the query was {st[o], st[t], N[Median[Flatten[o]]/Median[Flatten[t]]], N[Median[MapThread[Median[#1]/Median[#2]&,{o,t}]]], st[ow], st[tw], N[Median[Flatten[ow]]/Median[Flatten[tw]]] (, st[x], N[Median[Flatten[o]]/Median[Flatten[x]]])} with st[x_]:=N[{Median[Flatten[x]],Quantile[Flatten[x],1/4],Quantile[Flatten[x],3/4]}/1000]. Units are µs.

All rows are dtype f32 except paged, which has bf16 KV and an f32 q.

Primary: device time. Omega submit→marker (spin 0, the library default) vs torch cudaEvent.

OpShapeOmega median µsOmega IQR [Q1, Q3]Baseline (predeclared)Baseline median µsBaseline IQRRatio Omega/baselineMedian per-round ratioVerdict
RMSNorm1×2048104.289[103.712, 104.801]F.rms_norm10.432[10.176, 10.656]9.99710.03SLOWER 10.0×
RMSNorm64×2048107.617[106.849, 108.593]F.rms_norm10.368[10.176, 10.624]10.38010.45SLOWER 10.4×
RoPE32×128104.577[103.745, 105.729]torch ops35.456[35.168, 36.320]2.9492.94SLOWER 2.9×
SwiGLU5632104.257[103.809, 105.073]silu·mul12.400[12.064, 12.896]8.4088.43SLOWER 8.4×
SwiGLU131072107.417[106.929, 108.417]silu·mul12.224[12.000, 12.768]8.7878.77SLOWER 8.8×
GQA decode32q/8kv hd128 ctx2048422.412[417.475, 498.821]SDPA mem-efficient f32236.160[235.104, 237.312]1.7891.80SLOWER 1.8×
GQA decode32q/4kv hd64 ctx2048418.019[413.699, 514.212]SDPA mem-efficient f32171.648[170.848, 172.384]2.4352.44SLOWER 2.4×
GQA causal prefill256 rows, 32q/8kv hd1281481.469[1379.740, 1598.078]SDPA mem-efficient f3291.040[90.496, 91.808]16.2716.13SLOWER 16.3×
Paged decodebf16 KV bs16 ctx2048, 32q/8kv hd128104.729[104.033, 105.537]cuDNN SDPA bf16 (pre-gathered)29.920[29.408, 30.720]3.5003.49SLOWER 3.5×

Reference-only rows (they do not decide the verdict):

CaseOmega median µsOther armThat arm's median µs [IQR]Omega/that
GQA hd128 ctx2048422.412cuDNN SDPA bf16 (q, KV rounded to bf16)93.968 [89.952, 99.456]4.495
GQA hd64 ctx2048418.019cuDNN SDPA bf1636.704 [36.160, 37.312]11.39
GQA rows m2561481.469cuDNN SDPA bf1652.064 [51.296, 52.896]28.45
Paged ctx2048104.729gather (index_select) + cuDNN SDPA bf16208.672 [201.152, 220.864]0.502

The one case where Omega is faster is the reference-only paged comparison. When the torch arm must gather the scattered pool blocks itself, Omega's resident-pool paged kernel takes half the device time of gather + cuDNN. Against cuDNN on KV that is already contiguous, Omega is 3.5× slower.

Secondary: host-to-host wall (µs median [IQR]; ratio of medians from the same Wolfram calls):

CaseOmega wallTorch wall (H2D + op + D2H)Ratio
rmsnorm_1x2048106.801 [106.193, 107.409]18.920 [18.336, 19.712]5.645
rmsnorm_64x2048210.106 [208.370, 211.970]37.776 [37.296, 38.192]5.562
rope_32x128108.697 [107.857, 109.921]44.481 [43.856, 45.856]2.444
swiglu_5632109.649 [109.105, 110.609]31.192 [29.824, 32.465]3.515
swiglu_131072226.778 [222.386, 230.002]56.464 [56.017, 57.168]4.016
gqa hd128 ctx20481211.235 [1136.458, 1305.500]554.773 [546.005, 572.277]2.183
gqa hd64 ctx2048550.573 [538.804, 651.798]267.043 [265.971, 268.322]2.062
gqa rows m2562531.270 [2421.349, 2676.775]293.419 [288.435, 298.995]8.627
paged ctx2048173.554 [171.746, 175.425]42.113 [41.088, 43.792]4.121

Diagnosis of the ~104 µs floor. The small Omega ops sit at about 104 µs whatever their size. This matches the library's documented marker sleep-poll (omega_gpu_session.h: "50 us, which Linux timer slack rounds to about 102 us per launch on GB10, omega#328"). The frozen protocol measured the default.

POST-HOC, reference-only, not paired, not part of the verdict: 3 Omega processes with omega_gpu_session_set_spin_us(5000) (gpu-runs/spin/, 150 samples per case). Correctness was identical: 0 violations, and timed outputs equal to the first. Ratio vs the paired-campaign baseline medians:

CaseOmega spin-5000 median µs [IQR]Omega/baseline
rmsnorm_1x204816.688 [16.624, 16.816]1.600
rmsnorm_64x204821.784 [20.833, 23.184]2.101
rope_32x1286.528 [6.432, 6.688]0.184
swiglu_56326.376 [6.160, 6.672]0.514
swiglu_13107217.160 [15.745, 17.888]1.404
gqa hd128 ctx2048404.452 [387.300, 467.956]1.713
gqa hd64 ctx2048355.339 [348.755, 379.940]2.070
gqa rows m2561095.650 [1047.642, 1193.067]12.03
paged ctx204855.465 [54.801, 56.208]1.854

Wolfram query (wolfram/spin_posthoc.wl): st[x_]:=N[{Median[x],Quantile[x,1/4],Quantile[x,3/4]}/1000]; {…{"case", st[spin samples], N[Median[spin]/Median[baseline]]}…}

Caveats:

7. Verdict

Evidence level: QUALIFIED-on-GB10 candidate (single machine, driver 580.173.02, 2026-10-27, under load1 19-37). It is not QUALIFIED in general. Every kernel is INTERIM C codegen emitting SASS, not .om.

8. NOT_RUN

Reproduce: from /tmp/OmegaDnn/gpu/omega-mv, nice -n 19 taskset -c 8-9 make -j2 PHYSICS_DIR=/tmp/OmegaDnn/gpu/physics build/gpu_elementwise_test build/gpu_attention_test. Then compile the driver (P=/tmp/OmegaDnn/gpu/physics, N=$P/third_party/nvidia-open-580.173.02) and run the rows in section 3: nice -n 19 taskset -c 8-9 cc -std=gnu11 -Wall -Wextra -Werror -D_GNU_SOURCE -O2 -Isrc -I$P/m16 -I$P/nvrm -I$N/src/common/sdk/nvidia/inc -I$N/kernel-open/common/inc -I$N/kernel-open/nvidia-uvm -I$N/src/nvidia/arch/nvalloc/unix/include -ffp-contract=off -o omega_dnn_bench ~/handoffs/OmegaDnn/gpu-bench/omega_dnn_bench.c build/libomega_gpu.a -lpthread -lm