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

[MOE-INDEX-1] Native indexed/grouped MoE work scheduler for Q36 decode, batch and prefill

Open · #159 · open 2026-10-28 11:16 UTC

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

drakestapleton wrote on 2026-10-28 11:16 UTC

Goal

Exploit routed expert reuse with a bounded, GPU-resident indexed work plan for the live 35B rather than a second MoE executor. Reduce CPU sorting, redundant weight reads, empty/imbalanced CTA work and scatter overhead where measured. Preserve exact router/top-k/shared expert semantics and accumulation order.

Grounding and existing work

CUDApp main b759afc3f5e46f152ffb06b39882ffa28cacaf96 and omega-mv main 6999fa9e6dae4847c155ef4eacaece74f491d3ca inspected 2026-10-28. Reinspect heads, active branches and complete source/receipts before editing.

  • src/omega_gpu_q36_graph.c single-token path already uses router → 9-group FP8 GEMV (8 routed + shared) → SwiGLU → down → combine. Batch K_GROUP already builds sorted expert segment tables on GPU. Prefill pf_group() currently counts/sorts n×8 routed expert selections on the host, and pf_record_experts() dispatches grouped GEMM plus dedicated shared expert.
  • src/omega_gpu_fp8gemm_api.c and src/omega_gpu_tcgemm_api.c already have indexed row maps/segment/tile tables; reuse these contracts, never replace working grouped kernels blindly.
  • Merged PR #137 showed a 15.74% kernel-only gate/up+down improvement for 9 groups (6×9 → 5×9 CTAs, 164698 → 138776 ns); the ~1.037 ms/40-layer projection was modeled, not live server TPS. Retain as incumbent, don't claim it again. Router split PR #136 lost and was not merged.
  • Existing #18 owns gate/up+SwiGLU fusion; #78 owns compressed expert weight decoding; Omega #604 owns qualified cached-scratch baseline. This issue owns indexed expert work planning/execution only, no duplicate fusion or model loader.

Delivery slices

  1. Pin live Qwen3.6-35B-A3B (40 layers, 256 routed + 1 shared, 8 routed picks per token) model/source/checkpoint, effective batch, server settings and exact baseline. Distinguish single-token decode, batched decode and multi-token prefill; validate which existing GPU GROUP path already eliminates host sorting.
  2. Version bounded queue/segment descriptor in native .om: (expert_id, source_row, token_id, route_slot, weight_slot, segment_offset, count, destination, contribution_order), with deterministic stable ordering and explicit shared-expert slot. Capacity, duplicate picks, no-pick, all-same, all-distinct, uneven occupancy and ragged tails require refusal or correct behavior.
  3. Start with tracing/planning-only A/B and independent oracle; advance the existing GPU GROUP and prefill host pf_group toward shared GPU-resident stable indexing only when cheaper end to end. Reuse canonical command-list, memory/cache/driver and one launch policy. Keep per-expert CTA assignment adaptive to valid group sizes/SM waves, not simply maximal occupancy.
  4. Compare incumbent grouped GEMV/GEMM to indexed gather→expert compute→scatter→combine. Account for sort/plan upload, gather, temporary buffers, weight residency, launch/barrier count, cache traffic and CPU time. Evaluate single-token versus batch/prefill separately; no unsupported inter-CTA spin/barrier.
  5. Under #16 numerical contracts / #17 benchmark, validate all routed IDs/weights, expert and shared results, logits/tokens, finite and adversarial cases. Sequence optional #18 fusion after indexed baseline without double-counting savings.

Acceptance / negative gates

  • CPU and on-device plans are independently checked; duplicate-route/shared-expert/overflow/zero-work/row-alias/ragged mutants caught.
  • Predeclared paired A/B for B=1, small and larger supported batches, prefill; full graph and model-level TPOT/TTFT/p95/throughput and bytes recorded, including unfavorable outcomes.
  • At least one bounded GB10 path is CHIP_EXERCISED; no production activation without complete real 35B validation, correct numerics and a robust end-to-end win.
  • No assumption a kernel-only A1 gain implies model throughput improvement; model/default unchanged if no qualified win.

Delivery rules. New first-party production code/tests are native seeded .om; C sources can serve as migration/differential oracles until qualified cutover under #79. Preserve immutable receipts, one writer per shared file, no second GPU session/driver/IR/compiler. No silent CUDA/PTX/cuBLAS dependency. Keep the live 35B, driver and hardware scheduling unchanged; chip tests require an authorized GB10 window. Label HOST_TESTED/SIMULATED/CHIP_EXERCISED/WHOLE_MODEL_QUALIFIED separately; NOT_RUN/BLOCKED cannot become PASS. Record exact source/seed/compiler/target/binary/model hashes, commands/exits, positive and mutation results, baseline/variant raw timings.

Use #156 quant metadata to preserve expert weight layout, #157 components only when verified, #158 cache for prewarmed shape variants and #57 selector for bounded B=1/batch/prefill dispatch. #18 fusion and #78 packed experts remain independent, separately measured optimizations. Absolute original 35B model-level baseline is governed by Omega #604.

did:key:z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd wrote on 2026-11-18 17:13 UTC

Recovered GitHub comment by @aien-spark on 2026-10-28T12:17:43Z. Original comment 6468764757

IMPLEMENTED / HOST_EXERCISED only: draft #165, signed SSH commit966213fe14e37f39c94e4b57f140b19dd78af210 on native/moe-index-159 (no GitHub Verified claim). Source baseline b759afc3f5e46f152ffb06b39882ffa28cacaf96; compiler2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f; bridge c77a5922f91d53d4a0bbd4e7b1c4703f7098263abc843be2918db1ece7496782 unchanged.

Native stable nine-field work/segment plan, explicit shared expert, exact existing u32 maps/Seg32/GROUP buffer conversion, bounded full-range prefill window scheduler and actual canonical selector/cache admission wrapper implemented. Existing batch GROUP is reused, not redone; #18 fusion separate; no double-count of #137.

tests/moe/run.sh successful: native ABI differential against unchanged incumbent pf_group + independent rank/GROUP-format oracle; duplicate/all-same/all-distinct/uneven/ragged/no-pick/shared-only, invalid/alias/capacity/extent overflow and order/shared/map/segment mutations; actual pl_pin and cache metadata lifecycle with missing/stale/wrong-family refusals and exact generation0 compatibility. Full command/exits, corrected fixture failures, exact source/binary/dependency hashes: tests/moe/host-evidence.json. Crumb verify:23 current. Actual Omega MCP tools used lookup/compile/explain_error/run.

Graph/prefill integration patch is additive and handed to the shared-file owner, not activated here. GPU plan comparisons are HOST format checks, NOT on-device execution; metadata acquire/retire is NOT a submission. No GPU/model/server/driver changes or merge. Saved model config SHA570ef7ea45a7e1d3de2b1d3c70c4ac3562d0e768acdc195778cb4f4d95025845 matches #604 receipt; live runtime identity remains PENDING.

NOT_RUN: final private trusted-registry/graph consumer cutover, physical numerical/negative controls, independent repaired machine-code verification and B=1/batch/prefill paired whole-model quality/latency qualification. Requires current hardware authorization; no permission inferred from an existing reservation. Model/default unchanged; no performance or full-acceptance claim. Keeping #159 open and draft unlabelled.

did:key:z6MkhL6jkVBvyZTg9eMGkJWKQKjnKA1wbA7ym3PkTXt4M6Jd wrote on 2026-11-18 17:21 UTC

Recovered GitHub comment. Original comment 6511428643

FlintOwner 2026-10-29, IMPLEMENTED / EXERCISED host only: https://github.com/aien-dev/aien-sovereign-core-mv/pull/806, head 402025cdb5f2a4d7e8a7f88242273aa910ad1f05, stacked on Core #805. Frozen checkpoint RecursiveSI/flint@2a247be0c0aec895ccb0ac7ca92229ec6df37288. FLINT_FORWARD=1 gate PASS (92), including prior89 checks, all49 chained layers/five intermediate tensors each/final norm/all-vocabulary logits, and wrong-token + skipped-final-norm mutants. Native BF16-storage/f64-compute vs reference f32, fixed integration budget documented; no teacher forcing, no sampled generation or task quality claim. Current host forward reuses existing bounded op helpers and tokenwise expert execution. It does NOT implement or claim the native #165 indexed/grouped GPU scheduler. Grouped consumer wiring and physical performance receipts remain NOT_RUN, not hidden by the host parity result.

Sign in to comment