interplane.Get Omega
Read in your language

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

branch main Branches Tags History

omega-mv / docs / numeric / FB1_CUT4_ELEMENTWISE.md

65 lines · 5382 bytes Raw Blame History Source

FB-1 cut 4: native rmsnorm, rope, swiglu (own codegen, no CUDA)

Written 2026-10-04. Program: ~/handoffs/2026-10-04-fb1-cuts-2-6-plan.md section 4. Code: src/omega_gpu_elementwise_api.{h,c}, tests/gpu_elementwise_test.c, tools/run_gpu_elementwise_chip.sh; four additive IR ops in src/omega_blackwell_codegen.{h,c}.

DOCS READ (gate record docs-read omega, 2026-10-04)

Kernels (one per op; shape read from the four argument words c[0x0][0x398..0x3a4])

opCTAgridmath on the chiporacle (tensor.rs, sovereign-core 5fdab70)tolerance
ex2 probe128ceil(n/128)MUFU.EX2exp2 in f641e-6 rel
xchg probe128n/128STS, BAR.SYNC, LDS partner worda[i ^ 127]exact
rmsnorm128 (4 warps) per rowrowsf32 FFMA strided sum of squares, SHFL.DOWN 16..1 tree, lane partials to shared, BAR.SYNC, 4 LDS, MUFU.RSQ + one Newton step, (x*scale)*wf64 sum, (1/sqrt(mean+eps)) as f32, x*scale*weight1e-5 rel + 1e-6 abs
ropehead_dim/2 per headheadsFMUL, FMUL, FADD/FSUB on (q0,q1) with host cos/sinsame f32 ops, same order (rotate_half, cos/sin cast from f64)exact (bitwise)
swiglu128ceil(n/128)t=g*-log2e; e=EX2(t); d=e+1; r=RCP(d); (g*r)*upf64 g/(1+exp(-g))*up1e-5 rel + 1e-6 abs

Rope note: the trait is in-place on q and k; the API takes a vector of heads and writes out (which may alias the input). The host builds the per-head cos|sin table once per call.

Launch envelope: at most 64 CTAs per launch (matmul sweep 2026-10-03 lost tiles at 128, investigation I42, cause UNKNOWN); the API splits rows / heads / elements on the host.

Mutants (the same parity check must fail against them, in the same chip run)

EX2: 2^(x+1). XCHG: reads its own word. RMSNORM: warp tree drops the last SHFL step. ROPE: out0 = q0*cos + q1*sin. SWIGLU: exp(+g).

Register-allocation rule the loops rely on

The IR allocator is a linear scan over textual intervals and knows nothing about back-edges. loop_end() extends every value defined before a loop and read inside it to the back-branch; check_loop_invariant() refuses a kernel that reads, after a loop, a value first defined inside it without redefining it first. Both are in omega_gpu_elementwise_api.c.

Status

Shader-cache invalidate: every launch emits INVALIDATE_SHADER_CACHES (instruction, data, constant) right after the channel setup words, shared constants OMEGA_BW_MTHD_INVALIDATE_SHADER_CACHES / OMEGA_BW_INVALIDATE_SHADER_CACHES_ALL in omega_blackwell_submit.h used by the matmul launcher too (cut 1b finding: stale SM instruction cache after code-address reuse; local driver clcec0.h is a stub, bits from NVIDIA open-gpu-doc, chip-proven FB1-CUT1B-4345406). Test case icache_reuse_rotation cycles 10 distinct kernels twice as a guard (red seen by cut 1b on matmul, not re-observed here: one chip run rule).

Host: make test-gpu-elementwise (fixtures, refusals, codegen, register budget, nvdisasm listing of all five kernels) PASS at this head. Chip: see the PR title tags and the receipt folder ~/workspace/evidence-out/FB1-CUT4-<sha>/ (receipt.json, device.txt, run.log, SHA256SUMS).

Limits (what this does not prove)