Skip to content

gemm_ex: general GEMM domain + fp8 fallback for refused shapes (draft) - #139

Closed
aien-spark wants to merge 18 commits into
mainfrom
gemm-general/gemm-ex
Closed

aien-spark wants to merge 18 commits into
mainfrom
gemm-general/gemm-ex

Conversation

@aien-spark

@aien-spark aien-spark commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Draft. omega_gpu_gemm_ex: one entry with the cblas RowMajor shape contract (any M,N,K, op N/T, ld, alpha/beta, strided batch, f32 via bf16x3, bf16/f16/e4m3/e5m2, tensor or block fp8 scales), plus fp8 GEMV / grouped-GEMM fallback for refused shapes. Migration-pending C behind CUDAPP_MIGRATION_PENDING_GEMM_EX; .om successor #144.

Head 7c1a708.

Done

  • Runtime API 0.6.0 (90c3f89): manifest, API.md 9.8/10, README limits; OmegaGpuFp8GemmInfo 80 -> 88 bytes. make test-runtime-api PASS (296 functions, 46 structs, 443 fields, 229 constants; 183 INTERNAL); semver check MINOR.
  • Host-overhead fix 0d2b14a (API unchanged): 128-bit inf/NaN scan, lazy buffers, single-k-part path without the double sum, and C3 writing C in place for the header's bit-for-bit case. Host tier PASS 224, sim PASS 252; negative control on the scan FAILs 3/224. Chip tier at 0d2b14a: PASS 901 checks (evidence/GEMM-GENERAL-AB-20261027/ab-2/chip/).
  • Test summary figure is now |got - ref| / bound.
  • Predeclared served-shape A/B (18 cells, interleaved, warm=False only, Wolfram stats), evidence/GEMM-GENERAL-AB-20261027/:
    • ab-1 (lib at 90c3f89): 18/18 REGRESSION, r 2.17-3.25. Gate FAIL.
    • ab-2 (lib at 0d2b14a, plan df0e1ca): 0/18 REGRESSION, 18/18 NO CHANGE, r 0.94-1.24. Gate (r <= 1.10 in every cell) FAIL in 5 small cells: e4m3 64x1024x2048 1.24, e4m3 64x2048x512 1.20, bf16 64x1024x2048 1.17, e4m3 16x12288x2048 1.10, e4m3 1x8192x2048 1.10. Recorded in API.md 9.8.
    • Correctness in both runs: 378/378 pairs bitwise equal to C3, mutant-1 control RED.
  • Guide check (omega-harness section 6): no guide affected.

NOT_RUN

  • The source of the remaining ~0.1-0.35 ms per call at small cells has not been attributed or removed.
  • Tuned device-resident paths are not compared (by design). No served end-to-end timing: no served caller.
  • Full make -k test passed on 34f1b31 (CUDA++ HOST TESTS PASS, 48 targets, EXIT 0). It has not run on the PR head; only the gemm_ex host/sim tiers and the runtime-API check ran there.

…ed batch, bf16/f16/f32-via-bf16x3/fp8 scales) + fp8 GEMV/grouped GEMM fallback for refused shapes

New C behind CUDAPP_MIGRATION_PENDING_GEMM_EX (default ON: only shapes the old code refused take the new path).
Host tiers: gemm_ex --host-only PASS 224 checks, mutants 1-5 red. Chip: gemm_ex PASS 901 checks (receipts in the PR body; evidence dir to follow).
…; regression gemm/fp8/fp8gemm/matmul; part0of4 = first run whose one FAIL was a test defect: mutant 5 on a one-k-block shape)
…neral field, omega_gpu_fp8_general_rows internal (make test-runtime-api PASS)
@aien-spark

Copy link
Copy Markdown
Collaborator Author

Full make test (before this commit) reached test-runtime-api and failed there: manifest size of OmegaGpuFp8GemmInfo 80 vs 88 (new u32 general appended; EXPERIMENTAL struct, size change) and omega_gpu_fp8_general_rows undeclared. Fixed in this push; make test-runtime-api now PASS. The targets after test-runtime-api in make test: NOT_RUN on this head (full make test needs a rerun).

…ounding

The flat 2^-22 per fp32 step was below the HMMA model's worst case (DnnGpu: K=1808 adversarial input, err 5.343e-5 vs bound 2.843e-5). Now (1+c)^S - 1 with c = (g+1) 2^-25 + 2^-23, times (1 + 2^-20); g = 16 HMMA, 32 QMMA.
Host: PASS 224, mutants 1-5 still red. Chip rerun under the new bound: NOT_RUN (GPU window).
…ME limits, successor #144

Manifest: header src/omega_gpu_gemm_ex.h with OmegaGemmExArgs (200 B), OmegaGemmExInfo (24 B), omega_gpu_gemm_ex,
omega_gpu_gemm_ex_fp8_block_rows and 21 constants, all EXPERIMENTAL; abi 0.6.0, OMEGA_RUNTIME_API_VERSION_MINOR 6.
INTERNAL: omega_gpu_gemm_ex_set_backend, omega_gpu_gemm_ex_test_set_mutant (TEST ONLY), 183 names.
API.md: 0.6.0 change list (OmegaGpuFp8GemmInfo 80 -> 88 bytes, OmegaGpuFp8Info.general at 156), section 9.8 with the
host-orchestration, bf16x3, fp8-output and migration-pending limits. README cuBLAS row and section 10 limits text.
mk/gemm-ex.mk: the .om successor is #144.
…ffers, one-part path without the double sum, C3 writes C in place for the bit-for-bit case

ab-1 measured gemm_ex at 2.17-3.25x the C3 call it wraps. Host-only profile with a no-op core: bf16 2048x16384x2048
151.7 -> 4.4 ms of host work per call, bf16 1x8192x2048 24.6 -> 1.2 ms. Same entry, signature and results.
Test summary figure is now |got - ref| / bound. Host PASS 224, sim PASS 252; scan negative control (scan never reports)
FAILs 3 of 224.
…5), plan gate FAIL in 5 small cells; chip tier PASS 901 at 0d2b14a; overhead recorded in API.md 9.8
…y 0x1p+0, err above the old flat bound, inside the step_c() bound)

Host: PASS 225 checks. Chip tier also runs it; chip rerun on this head NOT_RUN at commit time.
@aien-spark

Copy link
Copy Markdown
Collaborator Author

Status update: CI check failed in job (). Additionally, the PR stated acceptance criteria note in 5 small cells with small-cell overhead remaining unattributed, and full unverified on the PR head. Leaving draft per acceptance and CI gate rules.

@drakestapleton drakestapleton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classification: needs-changes (draft).

  • build check failed on fc591d6 (actions run 40477773654, job 122100130750).
  • The PR's own performance gate (r <= 1.10 in every cell) fails in 5 cells: e4m3 64x1024x2048 1.24, e4m3 64x2048x512 1.20, bf16 64x1024x2048 1.17, e4m3 16x12288x2048 1.10, e4m3 1x8192x2048 1.10.
  • Full make test is NOT_RUN on this head (per the 2026-10-27 comment).

To become merge-ready: green build, gate passing or formally re-scoped in API.md 9.8, and a full make test log on the final head. #140 is waiting on this.

@drakestapleton drakestapleton left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Classification: needs-changes.

  • A build check fails on fc591d6 (actions run 40477773654, job 122100130750).
  • The PR's own A/B gate (r <= 1.10 in every cell) fails in 5 small cells (e4m3 64x1024x2048 1.24, e4m3 64x2048x512 1.20, bf16 64x1024x2048 1.17, e4m3 16x12288x2048 1.10, e4m3 1x8192x2048 1.10). Small-cell overhead remains unattributed.
  • Full make test is NOT_RUN on this head (per the 2026-10-27 comment).
  • Still draft.
  • To become merge-ready: green build, gate passing or formally re-scoped in API.md 9.8, a full make test log on the head, then mark ready. #140 waits on this PR.

— Grokbot

Signed-off-by: aien-spark <[email protected]>

# Conflicts:
#	README.md
#	docs/runtime/API.md
#	docs/runtime/omega_runtime_api.manifest
#	src/omega_gpu_fp8_api.c
#	src/omega_gpu_gemm.c
#	src/omega_runtime_api.h
…drift baseline records omega's bw_warp_sim_tc.h blob

The fp8 general fallback (omega_gpu_fp8_api.c) now calls omega_gpu_gemm_ex_fp8_block_rows, so
test_omega_gpu_native_runtime links src/omega_gpu_gemm_ex.c, src/omega_gpu_gemm.c and the qmma codegen.
tests/bw_warp_sim_tc.h: main holds omega 9920aab1's blob 59e4ad3 byte for byte; this branch adds the
CUDA++-only fp16 HMMA operand path on top, so the baseline row records 59e4ad3 (precedent d2c83a1).
A later Omega edit of that file still turns the drift gate red.

Signed-off-by: aien-spark <[email protected]>
aien-spark added a commit that referenced this pull request Oct 31, 2026
…cite bounded model checks; rerun ggml-omega ops against #139 117d8d7
@aien-spark

Copy link
Copy Markdown
Collaborator Author

Superseded by #214: same tree as this head (117d8d7, git diff empty), one commit on main e7cc7d6 so the build-pic/ objects from 446f84c stay out of main history. Left open for Main to close.

aien-spark added a commit that referenced this pull request Oct 31, 2026
gemm_ex: general GEMM domain + fp8 fallback for refused shapes (replaces #139)
@aien-spark

Copy link
Copy Markdown
Collaborator Author

Superseded by #214 (merged as 7a2c384): same tree as this head 117d8d7, one clean commit without the build-pic objects; the commit message lists all 18 commits of this PR with authors. Closing.

@aien-spark aien-spark closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants