interplane.Get Omega
Read in your language

CUDApp

CUDA++: AIEN’s GPU machine-code toolchain, runtime and driver client for NVIDIA GPUs without the CUDA toolkit. Hardware coverage and driver replacement limits are explicit.

Brought by drakestapleton

Experiment: fuse FP8 gate/up and SwiGLU in the routed MoE decode path

Closed · #18 · open 2026-10-22 17:08 UTC · closed 2026-11-06 23:58 UTC (reason not_planned)

Imported from GitHub aien-dev/CUDApp#18, by drakestapleton

Labels: retired

drakestapleton wrote on 2026-10-22 17:08 UTC

Governing correction: qualify fusion on the live 35B baseline

Drake's correction, 2026-10-24. The serving target is Qwen3.6-35B-A3B: 40 layers, 256 routed experts, and vocabulary 248,320. Pin the actual serving source, binary/archive, checkpoint, row count, sampling mode and runtime flags before deriving bytes or launch counts.

Serving-speed order: (1) measure and qualify cached scratch on the live 35B path, (2) measure fusion against that qualified baseline, (3) implement and qualify the 8-bit output head. Omega #704/#705 are a parallel planning-tool lane and do not block these direct measurements.

Use the qualified cached-scratch receipt from Omega#604's baseline arm, then re-derive the selected producer/consumer chain's shape, intermediate bytes, layout, numerical contract and actual launch count. Existing 35B fusion must be part of the incumbent, not claimed again as a new gain. Final implementation and owned tests use the seeded .om successor.

The 30B/48-layer source calculation below, including intermediate width 768, 98,304 bytes/layer, 4.5 MiB/token and 436-to-388 launches, is historical only. None of those quantitative results may be used for the live 35B server. Older file paths are inspection evidence; trace the actual Q36 successor and its consumers before implementation.


Problem

The decode graph records grouped gate/up, SwiGLU, down and combination as distinct work. Fusion may remove launch boundaries and intermediate writes. Start with a narrow fusion before considering a persistent whole-MoE executor.

Implementation

Inspect src/omega_gpu_decode_graph., omega_gpu_fp8_api., omega_blackwell_codegen_moe, and omega_blackwell_codegen_dec.. Prototype the gate/up plus SwiGLU boundary on supported model shapes, preserving current FP8 conversion, scales and arithmetic boundaries. Keep the existing path selectable.

Acceptance

  • Declare supported shapes, batch range, routing assumptions and numerical contract.
  • Compare full outputs, routing and downstream logits/tokens; test boundary values and scale/layout mutants.
  • Measure launch count, intermediate bytes, registers, shared memory, occupancy constraints and end-to-end TPOT using the common benchmark.
  • Repeat B=1 and other supported small batches; retain regressions and define the selection policy from measurements.
  • Enable by default only after correctness and repeated model-level improvement pass; otherwise retain as an opt-in experiment or record a no-go decision.
  • Document a separately gated next step toward down/reduction fusion. Do not introduce inter-CTA spinning without a residency/progress argument.

Research: MonoMoE (https://arxiv.org/abs/2609.04244), measured on H200; its quantization and persistent synchronization cannot be transplanted as a GB10 result.

Evidence and closure

Review baseline: 232332422bfdc31c8918085b50f13c1e18ab702e; re-inspect the current tree and reuse existing work before editing. Coordinate with #5 and #6 and the serving/chip-window owner; host work can proceed independently of hardware scheduling. This issue does not authorize interrupting the live motor or switching kernel drivers.

Publish exact source/pin SHAs, build and binary hashes, commands, exit codes, hardware/driver identity, raw logs and relevant negative controls under evidence/. Separate host, simulator and GB10 results. Hardware acceptance needs a real coordinated GB10 run on the final integrated artifact. Keep CUDA userspace dependencies out of the deployed runtime. Do not close on a branch push, simulator-only hardware result or PR merge alone. Experimental issues may close with a reproducible negative result and explicit decision; do not claim an optimization shipped unless its integration gates pass.

Historical 30B example only: movement arithmetic (2026-10-24)

This issue remains the implementation owner for the routed decode gate/up-SwiGLU cut; Omega #603 owns the general arithmetic-fusion experiment. The inspected CUDApp source is 22e9d9bad9b9238996b05b68dfd73e4036ed354f; re-pin the selected consumer before implementation.

The graph records grouped gate/up, SwiGLU, down, then combination. Its supported shape has top-k 8 and intermediate width 768. The gate/up result is gu[8][1536] in f32:

  • One materialized gu is 49,152 bytes.
  • Eliminating its store and following read removes 98,304 logical payload bytes per layer, or 4,718,592 bytes (4.5 MiB) over 48 layers.
  • One kernel per layer disappears: the nominal 48-layer sequence falls from 436 to 388 launches, assuming no replacement launches.
  • Gate/up weights alone remain 8*1536*2048 = 25,165,824 bytes per layer, before scales, repeated accesses and cache effects. This is not a claim of a comparable fraction of weight traffic removed.

Charge new register/shared-memory demand, spills, any repeated activation/weight reads, and preparation/layout costs against the eliminated boundary. Do not multiply a historical synchronous-launch latency by 48: the command-list path already batches submission, and its remaining per-kernel dependency/dispatch cost needs its own measurement.

Existing work matters: QKV and gate/up concatenation and combine-plus-next-normalization already exist in the graph. Native prefill QMMA already references resident FP8 weights and offers a SwiGLU epilogue; preserve that reuse rather than adding a duplicate optimization.

Additional completion evidence

  • A machine-readable per-edge ledger proves the gu store/read removal and records all new reads, writes, registers, shared bytes, dependencies and actual launch count. Treat the byte arithmetic above as logical payload accounting, not measured DRAM traffic.
  • Verify paired gate/up ownership within the chosen warp/CTA geometry, scale boundaries and existing special-function/rounding behavior. Include signed-zero, overflow/subnormal, tail/route and downstream logit/token cases supported by the numerical contract.
  • Publish unfused, specialization-only and fused whole-token comparisons for the selected source/model/shape, including an occupancy/pressure counterexample and a reproducible no-go outcome if it loses.

For adjacent normalization-quantization candidates coordinated through #603, Core's inspected prefill path explicitly retains f64 RMSNorm on the host. Algebraic reassociation or an f64-to-f32 change is not an exact fusion. Preserve the declared numerical behavior or qualify a separately named numerical candidate with route/tie and model-quality checks.

Implement and qualify the owned successor and its project-owned tests in seeded .om, migrate consumers, and remove superseded first-party C/Rust implementations and dependencies from the active tree under omega-mv#599 and aien-architecture#300. A retained comparison algorithm must also be qualified .om; historical source/evidence remains in Git history. New findings here are source-derived hypotheses, with GB10 performance NOT_RUN.

Active-branch reconciliation

On 2026-10-24, Omega PR #696 remains open at cdc613f9cfa81daf0a47c9aa95182f40c177c44c; its seeded compiler includes AArch64 f32/f64 and native device/mapping operations. The selected graph/FP8/prefill/platform implementations inspected here are unchanged on that branch. CUDApp PR #67 is merged and current main contains handwritten .om device/policy/vector-kernel work; its evidence does not establish the complete 27B/FP8 successor. Reconcile with these existing owners and current branch heads before implementation; this source audit does not label all unmerged work absent.

Reuse the coalesced-store branch as a candidate baseline

Open Omega PR #515, inspected at c3afa9871ba008ea28d2096c9549d122bd57f3fd, already combines warp-leader output stores through shared slots into a contiguous warp store. Its generated store path preserves arithmetic and has explicit partial-round/barrier behavior. Reconcile this work with the current canonical CUDApp owner and qualify the selected baseline before attributing additional gains to gate/up-SwiGLU fusion. Do not reimplement coalescing or conflate its PR-reported historical timing with a newly measured fusion result.


2026-10-28 indexed MoE relationship (distinct owner)

CUDApp #159 now owns GPU-indexed/grouped MoE work planning and segmented gather/scatter, building on the existing Q36 batch GPU GROUP, prefill host pf_group and grouped GEMV/GEMM maps; this issue continues to own gate/up + SwiGLU fusion and optional subsequent down/reduction fusion only. Freeze and qualify the live 35B scratch baseline Omega #604, existing 9-group wave winner PR #137, and unfused/indexed incumbents separately. Coordinate layout/rounding/route order contracts and compare combinations without attributing already-shipped speedups twice. Model-level default/driver/live service stays unchanged absent full validation under #16/#17 and canonical consumer #5/#106.

drakestapleton wrote on 2026-10-24 17:49 UTC

Movement audit addendum — pin 22e9d9b, 2026-10-24

Current graph still records gate/up, SwiGLU and down separately: decode graph L341–347. The intermediate is FP32 gu[top_k][2*inter] (layout L121–128); SwiGLU explicitly reads gate and up, computes its transcendental sequence, scales, and writes act (generator L280–298). Reuse this issue, not a second fusion project.

Counted opportunity. With selected experts E, intermediate width I and FP32 size 4, eliminating the gate/up global intermediate removes write(2EI*4)+read(2EI*4)=16EI logical bytes plus one launch and its dependency boundary. Current E=8, I=768 gives 98,304 B = 96 KiB per layer. act remains 4EI bytes until a separately qualified down fusion; do not count it as removed. For L layers the intermediate delta is 98,304L bytes. This does not remove gate/up weight reads, approximately 2EIH FP8 bytes plus block scales, or its approximately 4EIH dot-product FLOPs.

Why not promise a bandwidth speedup. At the user's nominal 273 GB/s, 98,304 B corresponds to only 0.360 microseconds of ideal memory-service time per layer. Actual improvement may be launch/boundary latency and input reuse, or may be negative. Registers, shared memory, occupancy and instruction scheduling can dominate. The current shape policy already rejects deep/shared-staged input for grouped experts after an earlier reported regression (policy L217–245). Historical grouped gate/up medians were 154,449 ns for rows=1 and 160,881 ns for rows=2, not evidence that wider rows always win (rows1 receipt, rows2 receipt). These are older configurations, not current candidate timings.

Narrow experiment and acceptance. Pair gate row j and up row I+j in one warp/CTA epilogue without an inter-CTA wait. Preserve FP8 decode, block scales, per-row reduction order, FP32 rounding boundaries, existing MUFU EX2/RCP sequence, and SCALE_2P64 placement. Preserve expert/table mapping and aliases; keep act separate until every reader retires. Compare full intermediate reference outputs and downstream logits/tokens, including ties, extremes, cancellation, zero scales, and wrong gate/up-offset and scale-placement mutants. Compare against the actual grouped variant-1/variant-2 choices, not only an artificially split baseline. Report code identity, registers, declared registers, shared bytes, spills, launch/barrier counts, logical versus measured traffic, clean paired full-token p50/p95, and zero or negative results through #17. Default remains unchanged unless the predeclared correctness and full-token benefit gates pass. Implement final active work in qualified seeded .om under the existing migration and #5/#16/#19/#54 owners; no new driver/runtime.

Status: static source opportunity; experiment and hardware gain NOT_RUN.

drakestapleton wrote on 2026-11-06 23:58 UTC

35B retired (Drake 2026-11-06): Omega LLM only. Fuses FP8 gate/up and SwiGLU in the routed MoE decode path of Qwen3.6-35B-A3B (its governing correction qualifies it on the live 35B). The fusion idea itself (gate/up + SwiGLU in one epilogue) applies to the Omega LLM's dense MLP and is recorded for the lead in the Omega LLM retarget list (M1 — Serve on :18091). — issuecov/I4 (Hermes worker subagent of lead issuecov, claude-opus-5-5, anthropic)

Sign in to comment