Skip to content

Add experimental opset 29 lowering for native float MoE - #815

Closed
titaiwangms wants to merge 5 commits into
mainfrom
titaiwang/moe-opset29-lowering
Closed

titaiwangms wants to merge 5 commits into
mainfrom
titaiwang/moe-opset29-lowering

Conversation

@titaiwangms

@titaiwangms titaiwangms commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Superseded by #814. The complete implementation, including this PR's commits, is now part of the unified experimental opset 29 MoE family lowering proposal.

Closed without merging; implementation commit 8f247149466262c25aed8adff515beb38dae44d4, this branch and the review record are retained. The original stacked proposal below is historical.

Stack

Depends on #814; this PR targets titaiwang/qmoe-opset29-lowering, not main. It adds only the float MoE layer above the QMoE/experimental-gate foundation. Verified native stack 816: main -> #814 -> #815.

Draft: required integration-review model coverage is incomplete. The native two-layer stack is registered; neither PR was merged or placed in a merge queue, and #814 remains ready for review.

Summary

Add explicit mobius.functions.lower_moe(model) for the supported native com.microsoft::MoE CPU-reference ABI, using two standard GroupedMatMul-29 calls.

  • Preserve full-softmax-before-top-k routing, higher-expert-ID probability ties, optional selected-weight normalization, optional expert biases, and the five supported CPU activations.
  • Preserve FLOAT16 storage/rounding at each GEMM, bias and activation boundary, rather than borrowing QMoE's FLOAT-through-both-GEMMs behavior.
  • Reuse atomic replacement and the bounded opset-import audit with lower_qmoe; preserve names/metadata, no-target no-ops, nested scopes and function ownership.
  • Require the existing default-off experimental flag. No automatic registration/conversion, global opset upgrade, native export change, generic dispatch option, or checkpoint-loading change.
from mobius._flags import override_flags
from mobius.functions import lower_moe

with override_flags(experimental_opset29=True):
    lower_moe(model)  # in-place, also returns model

See the supported ABI and pinned references. BFLOAT16, FC3, legacy-transposed layouts, GEGLU/fusion=2, sparse mixer and post-activation clipping are explicitly rejected before mutation.

Validation

398 passed, 9 skipped:

python -m pytest src/mobius/functions/moe_test.py \
  src/mobius/functions/qmoe_test.py src/mobius/_flags_test.py -q -rs

MoE: 132 passed / 5 native-half capability skips. QMoE: 232 passed / 4 existing direct-opset29 capability skips. Flags: 34 passed. Repository-pinned Ruff 0.16.2 lint/format, Mypy, git diff --check, and feature-flag documentation generation passed.

Coverage includes independent numerical references, native FLOAT parity, observable intermediate half rounding, schema/checker/shape-inference/save-load checks, optional biases, routing boundaries, empty rank-2/3 inputs, atomic validation/audit rejections and import alignment, untyped native outputs, local functions/subgraphs, and composition with QMoE lowering in either order.

Runtime limitations

Schema/checker support is not runtime-kernel support. ORT 1.31.1 cannot directly execute opset29; numerical execution uses the existing test-only GroupedMatMul expansion, not a production fallback.

The tested ORT wheel also lacks a native FLOAT16 CPU MoE kernel: it automatically inserts FLOAT casts, so successful execution would not qualify native-half arithmetic. Its older FLOAT kernel has an input/output-alias bug on an internal cast buffer when routing normalization is disabled. The exact wheel source and corrected pinned reference are linked in the documentation. Native tests now gate on the actual kernel T dtype; no xfails, loosened tolerances or compensating production logic were added. All independent FLOAT16 reference tests remain active.

Not checked: real opset29 kernel execution, native-half parity against this wheel, CUDA/other EP parity, BFLOAT16 or unsupported ABIs, full-checkpoint generation, and performance/memory claims.

FLOAT16 verification specifies FLOAT accumulation with explicit half storage boundaries, not all platform-specific MLAS half-GEMM implementations. Near top-k boundaries, different Softmax implementations may round probabilities differently and select different experts. The higher-ID rule applies to equal probabilities produced by the graph.

Review synthesis

Four completed static reviews raised no Critical or Major findings. Review snapshot: 8e49f1ce; follow-up 8f247149 only clarifies documentation and adds a FLOAT-arithmetic comment, with no execution changes. Its Ruff lint/format and diff checks passed.

Role Actual runtime model Coverage
Code gpt-6.1-sol Completed; no findings
Critical gpt-6.1-sol Completed; one non-blocking question
Deep claude-sonnet-5.5 Completed; no findings, two non-blocking questions
Readability claude-sonnet-5.5 Completed; Minor clarity suggestions only
Integration mai-code-2 Blocked / partial, not credited

Required integration-role coverage is blocked: its authored model is mai-code-2.x1, but runtime metadata selected mai-code-2. This attempt is excluded from required coverage/model-family diversity; no unauthorized override or replacement role was used.

Critical/Major findings ledger: empty; none were raised. Minority report: no Critical/Major finding was rejected or deferred. Readability's section structure, ABI/verification terminology and FLOAT-constant clarification were addressed; optional naming/slot-constant and narrative-placement suggestions were left unchanged to avoid unrelated churn.

Attributed non-blocking questions

Raised by Question Disposition / remaining evidence
Critical Can an unexpected error during detached generation retain uses on original IR values? IR ownership cleanup after emission begins was not established. Tested validation/audit rejection atomicity does not prove cleanup for arbitrary generation exceptions.
Deep Do one-ULP probability near-ties select the same expert across native CPU and standard Softmax implementations? Not established; explicitly documented as a potential routing difference, not a bitwise-parity promise.
Deep Does every platform-specific MLAS half-GEMM accumulate in FLOAT? Not established, especially for ARM half kernels; documentation limits the reference model to FLOAT accumulation with explicit half storage boundaries.
Readability Should type and shape metadata mismatches have separate diagnostics? Retain the shared diagnostic naming both requirements; no behavior change needed.
Readability Should the QMoE guide also identify the audit as shared with lower_moe? The MoE guide links to the existing audit table; no reverse cross-reference was added. This remains an optional documentation improvement.

Threat-model scope (Critical): caller-owned IR topology, attributes, shapes/types and imports control eligibility and rewriting. Reviewed risks were graph tampering and resource exhaustion; no identity, authorization, network or persistence boundary was introduced. Unsupported ABI/schema cases fail closed before replacement. Unexpected generation-failure cleanup and actual memory peaks remain unverified.

Review exclusions: reviewers ran no code and did not independently repeat the reported tests. Integration's remaining producer/consumer, packaging/defaults and transitive audit trace is incomplete. No reviewer qualified direct GroupedMatMul-29 execution, native HALF, other EPs, full checkpoints, load/performance or repository-wide integration. The draft is not a full-team approval.

titaiwangms and others added 5 commits November 11, 2026 00:44
Lower the supported raw INT4 CPU-reference QMoE ABI to blocked DequantizeLinear and GroupedMatMul, preserving native exports and the opset 24 default. Audit and align compatible model/function imports before mutation and reject unsupported contracts atomically.

Protect both compatibility downgrade entrypoints from relabeling newer graphs. Cover numerical/native CPU parity, real MoELayer producers, schema checks, output metadata, and persistence. Document unsupported runtime and quantization variants.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
Honor literal zeros when reshaping the routed result back to its original input shape. The default Reshape behavior copied dimensions from the flattened result, failing for [2,0,H] and returning the wrong shape for [0,0,H].

Add FLOAT/FLOAT16 save/load execution regressions for empty rank-2 and rank-3 inputs. The QMoE test module passes 230 tests, with four existing skips for unavailable opset-29 runtime support.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
Add the default-off experimental_opset29 feature flag and its MOBIUS_EXPERIMENTAL_OPSET29 environment setting. Reject requested QMoE conversion before mutation unless explicitly enabled, while leaving no-QMoE models, native exports and the opset 24 default unchanged.

Document that opting in permits explicit lowering but does not imply runtime kernel support. Cover default/env flag behavior, atomic rejection and no-op paths; flag and QMoE suites pass 266 tests with four existing direct-runtime skips.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
Lower the qualified CPU-reference com.microsoft::MoE ABI into two GroupedMatMul calls. Preserve full-softmax routing, higher-ID probability ties, optional expert biases, activation semantics and staged FLOAT16 rounding. Require the existing experimental flag and leave native/default exports and generic dispatch unchanged.

Share atomic replacement and the bounded import audit with QMoE without changing its semantics. Cover independent numerical references, native FLOAT parity, metadata and empty shapes, scope/import atomicity and pass composition. The combined MoE, QMoE and flag suites pass 398 tests with nine explicit runtime capability skips; document why ORT 1.31.1 FLOAT fallback is not native-half qualification.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
Separate lowered graph structure from native runtime evidence, distinguish supported ABI from verified native execution, and disclose near-tie Softmax and platform-specific half-GEMM limitations raised during review. Clarify that lowering arithmetic and constants use FLOAT; no execution behavior changes.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwangms <[email protected]>
@titaiwangms
titaiwangms added this pull request to stack #816 November 11, 2026 20:18
@github-actions

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing cea2ac16 → 8f247149

Model Sub-model Changes Status

No architecture changes detected. ✅


Legend: ⚪ No change · 🔵 Minor (attrs/inits) · 🟡 Moderate (nodes added/removed) · 🔴 Major (interface changed)

@titaiwangms
titaiwangms marked this pull request as ready for review November 11, 2026 20:52
@titaiwangms
titaiwangms requested review from a team and a balanced review from Copilot November 11, 2026 20:52

Copilot AI 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.

🔵 Needs a closer look

CPU-reference arithmetic needs independent domain review because pinned native sources were inaccessible, while native FLOAT16 parity, direct GroupedMatMul-29 execution, and export integration lack numerical verification.

No open issues 🎉

What changed in this PR

Builds on #814’s experimental opset-29 foundation with an explicit lower_moe(model) API for supported native float MoE calls. It targets CPU-reference semantics without changing ordinary exports or automatically enabling conversion.

Changes:

  • Lowers supported FLOAT/FLOAT16 MoE calls to two GroupedMatMul-29 calls, preserving routing behavior and intermediate half-precision rounding.
  • Shares emission, replacement, and import-audit machinery with QMoE lowering.
  • Adds numerical, validation, metadata, and composition tests, plus documentation distinguishing schema support from runtime support.
File Description
src/​mobius/​functions/​qmoe.py Reuses shared lowering machinery while retaining QMoE-specific arithmetic.
src/​mobius/​functions/​qmoe_test.py Reuses the extracted test-only GroupedMatMul expansion.
src/​mobius/​functions/​moe.py Implements native float MoE validation and explicit lowering.
src/​mobius/​functions/​moe_test.py Adds numerical parity, rounding, validation, and preservation coverage.
src/​mobius/​functions/​_opset29.py Shares the compatibility audit with caller-specific diagnostics.
src/​mobius/​functions/​_lowering.py Centralizes emission, validation sequencing, replacement, and metadata preservation.
src/​mobius/​functions/​_lowering_test_utils.py Provides shared test-only expansion for numerical execution.
src/​mobius/​functions/​__init__.py Exposes lower_moe through the public functions API.
src/​mobius/​_flags.py Documents that the existing experimental flag also permits MoE lowering.
docs/​moe-lowering.md Documents the supported ABI, arithmetic, usage, and runtime limitations.
docs/​index.md Adds the MoE lowering guide to the documentation navigation.

Review effort: Balanced

@titaiwangms
titaiwangms removed this pull request from stack #816 November 11, 2026 21:10
@titaiwangms
titaiwangms changed the base branch from titaiwang/qmoe-opset29-lowering to main November 11, 2026 21:10
titaiwangms added a commit that referenced this pull request Nov 14, 2026
## Summary

Add **experimental, default-off opset-29 function fallbacks** for native
`com.microsoft::MoE` and raw INT4 `com.microsoft::QMoE`.

Use the existing **function factory → registry → EP-controlled public
`InlinePass`** mechanism. `moe(config)` and `qmoe(config)` return real,
configuration-specialized `ir.Function` bodies. No separate lowering
pass,
replacement emitter, `_opset29.py` auditor, or additional framework
remains.

```python
from mobius import build_from_module
from mobius._flags import override_flags

with override_flags(experimental_opset29=True):
    package = build_from_module(module, config, execution_provider="onnx-standard")
```

`MOBIUS_EXPERIMENTAL_OPSET29=1` also enables the flag before import.

| Build path | Behavior |
|---|---|
| Flag off | Existing opset-24/default behavior, except the QNN
capability correction below |
| Flag on, native-capable EP | Existing opset-24 native calls; no
fallback ABI restrictions |
| Flag on, fallback EP | New graph/functions constructed at 29;
supported native calls registered and inlined |
| Existing opset-24 graph requesting the new fallback | Explicit rebuild
error, not import relabeling/version conversion |

The global `OPSET_VERSION` remains 24. Generic dense `MoELayer`
implementations,
arbitrary routing gates, and Qwen4 routing algebra are unchanged.
**Gemma4's model source is restored, not extended:** `gemma4.py` is
byte-identical to PR base `858ead` and the reviewed main snapshot
`e475e4871b0430f58654bc25b13fd17806b2f9c5`. Non-native EPs retain its
dense
Einsum path at both opset 24 and 29. Existing native/quantized branch
implementations are unchanged. This PR does not add direct GroupedMatMul
Gemma dispatch.

**QNN is an intentional flag-off exception:** correcting its profile to
`supports_fused_moe=False` changes capability-based model dispatch even
when
`experimental_opset29=False`. Qwen4 selects its existing
`_standard_dispatch`;
eligible unquantized Gemma4 configurations that previously selected
native MoE
select the existing dense path instead. QNN still builds at opset 24
with the
flag off, without registering these MoE/QMoE fallback bodies. This fixes
an
incorrect kernel capability, not a new model dispatch implementation,
and
does not qualify QNN device execution of opset 29 or quantized Gemma4.

## Supported semantics

- **MoE:** row-major expert weights, FLOAT/FLOAT16, optional biases,
ReLU/tanh-GELU/SiLU/identity/interleaved SwiGLU, full-expert FLOAT
softmax
before TopK, higher-expert-ID probability ties, selected normalization,
positive-route masking, CPU-reference HALF rounding, FLOAT weighted
reduction.
- **Raw INT4 QMoE:** low-nibble-first UINT8 weights, blocked scales,
  optional packed asymmetric zero points (**omission means 8**),
  `weights_prepacked=0`, interleaved SwiGLU, logit-first CPU routing,
  input-14 router weights, `<=1e-8` route suppression, and FLOAT
  dequantization/GEMMs before any final HALF cast.
- Rank-2/rank-3 hidden inputs, dynamic/empty tokens, original packed
  initializer names, optional input positions, and compatible output
  annotations/docs/metadata are preserved.

CPU source supplies the **semantic reference**, not a CPU-only execution
restriction or an all-provider equivalence claim. Unsupported ABIs fail
explicitly. BFLOAT16, FP4/MXFP4, prepacked weights, arbitrary gates,
CUDA-specific routing, and fused-kernel performance are not qualified.

Registration validates every target, containing-root imports, ownership,
and collisions before body construction/mutation. Binary32-canonical
specialization identities survive save/load/re-registration.
Caller-owned
functions remain unmodified. Public inliner preconditions remain
authoritative;
distinct alias-return boundaries prevent clobbering input/upstream
metadata.

## Copilot review 5880527221: four confirmed issues repaired

| Issue | Repair and regression evidence |
|---|---|
| QNN incorrectly inherits fused MoE capability | Set
`supports_fused_moe=False`. Test flag-off 24 / flag-on 29 construction
and actual optimizer registration/public inlining of raw INT4 QMoE. **No
QNN runtime qualification is implied.** |
| Empty-key-only core-opset lookups reject valid aliases | Use one
read-only resolver for model roots, containing functions,
source/destination specializations, and ordinary factories. Accept sole
`ai.onnx` and matching dual aliases; reject conflicts atomically without
normalizing imports. Preserve flag-first validation and public inliner
mismatch checks. |
| Added Gemma branch changes tied TopK selection | Remove the added
integration instead of reversing model tensors. Original lower-ID dense
TopK remains; add flag-off/on, preinitialized/scale-only top-1 numerical
cases. |
| Folding live expert scale into W2 overflows early | Restore original
contribution-side scaling and dense dispatch. Add the same matrix with
W2=`2e38`, live scale=`2`, and intermediate approximately `0.1`; require
finite output approximately `4e37`. |

Lead independently executed the **old e217b50 graphs**, not merely
structural
assertions: tied inputs changed `0.43863517` to `-3.72839904` with the
flag;
the overflow example changed finite `3.99999972e37` to infinity. Both
were
reproduced for preinitialized weights and scale-only updates.
The repaired graph's numerical regressions pass against independent
references.
No tolerance weakening, weight reversal, or compensating routing
transform.

The original proposed Gemma FLOAT scale-folding repair is superseded by
this
restoration; it is not retained or claimed as a fix.

## Copilot review 5900254968: documentation and coverage follow-up

| Issue | Repair |
|---|---|
| QNN flag-off dispatch exception was undocumented | Both lowering
guides and this description now explicitly distinguish the QNN profile
correction from the default-off opset-29 feature. Existing Qwen4/Gemma
branches are selected differently on QNN even with the flag off; no new
model implementation is added. |
| Multi-layer post-build quantized-weight binding was untested | Add two
consecutive shared raw-INT4 `MoELayer`s through `build_from_module(...,
task="feature-extraction", execution_provider="onnx-standard")`, with
every parameter initially unbound. Apply original packed checkpoint
names only to the returned package, assert every binding is consumed,
and compare a test-only expanded copy against independent NumPy
dequantization/routing over two batches and three tokens. Production
imports remain 29. |
| Flag-off test used a native-capable profile | Use QNN, assert its
capability is false, and check unchanged native inputs/attributes plus
absence of fallback functions. A gate-only in-memory mutation produces
two expected failures, demonstrating that the corrected regression
detects removal of the flag guard. |

This follow-up changes only two existing test files and the two lowering
guides; no production dispatch, optimizer, or lowering implementation
changes.
The released-schema environment skips the new standard-pipeline case
because
its final public validator needs the official GroupedMatMul-29 schema. A
QNN-only diagnostic is not treated as acceptance for the requested
`onnx-standard` path; that path is validated with the exact schema pin.

### November 14 focused validation

Command: `python -m pytest src/mobius/functions/moe_registration_test.py
src/mobius/functions/qmoe_test.py -m opset29 -q -rs`.

| Check | Result |
|---|---|
| Released ONNX 1.19, current IR/ONNXScript | **394 passed, 7 skipped**;
includes the schema-gated new export case |
| Exact pinned ONNX source, current IR/ONNXScript, integrated root
checkout | **397 passed, 4 skipped**; the real standard-export
multi-layer case executes and passes |
| Flag-guard-only mutation | **2 expected failures** with the corrected
fallback-profile test; mutation restored |
| Ruff lint/format and complete four-file diff check | Passed |

The four pinned skips are existing direct opset-29 runtime probes,
unsupported
by ORT 1.31.1. The multi-layer fixture found no production metadata or
binding
bug: it verifies existing behavior that previously lacked end-to-end
coverage.
Lead reviewed the complete four-file follow-up; this is not a new
unified
review of the cumulative 46-file PR.

## Justin's eleven review comments

Implementation: `d9c4acc4848e4dfbeb66d5071dd0fa9e9f1b1062`.
Comment-only readability follow-up:
`982a05412c3361ed58aa8426827bf28e2a1fd511`.
Cold-collection dependency fix:
`e217b5093b4dbd9584cc0c25f89f16cadc544c11`.

| Request | Change |
|---|---|
| Select CI tests by marker | Register `opset29`; both phases use
`pytest src/mobius tests/ep_optimization_test.py -m opset29`. At that
revision, all 832 previous cases retained and 40 added. Collection
dependencies `httpx`/`gguf`/`jsonschema` are explicit. |
| Remove redundant docs section | Remove QMoE's Runtime/validation
section and repair the inbound MoE link. |
| Bound inlining | At most initial function count + 1 rounds, with
leaf-retirement progress checks and explicit failure. Preserve public
validation and the existing unused-leaf clean exit. |
| Avoid installed-schema dependence | Remove the redundant GroupedMatMul
availability gate. Public construction, registration, and inlining work
on actual ONNX 1.19; checking/export auditing remains schema-dependent.
|
| Use SwiGLU | Standard SwiGLU-28 in both bodies, retaining clipping,
alpha/beta, and HALF boundaries. |
| Use Swish | Standard Swish-24 for MoE SiLU. |
| Expand variable names | Spell out QMoE internals without changing the
native 15-input positional ABI. |
| TODO for unpack | Add TODO; no current standard raw nibble-unpack op.
BitCast requires equal widths; DequantizePacked's GGUF formats do not
match raw QMoE. |
| Is zero-point construction redundant? | Retain explicit default 8:
omitted ONNX DQ zeros instead mean 0. Numerical tests compare omission
with explicit 8 and distinguish explicit 3. |
| Simplify routing/pattern matching | Remove the redundant routing
Where. Retain safe zero-total normalization and the final contribution
Where, which suppresses inactive expert NaNs. No fusion/performance
promise. |
| Use Slice | Negative-step expert reversal and stride-2 gate/up slicing
replace index lists in both bodies. Comments explain endpoints and
interleaving. |

Operator versions were compared with the official ONNX catalog at
`94d0e6056931a8c1dad84104c2e567e0011d04f2` and the pinned schema
revision
below; the relevant versions agree.

### Earlier review and public IR repairs

Retain binary32 identity roundtrips, alias-output metadata isolation,
direct
MoE activation validation, direct QMoE configuration/block validation,
and
snapshotted-opset dispatch. Gemma HALF rounding and remaining live
scales
are protected by retaining its original dense implementation, not by
adding
new native-call integration. Earlier code-quality suggestions remain
addressed.

Use public `Function.clone`, `Graph.append`, `Function.outputs`,
`Shape.copy`,
graph traversal, `InlinePass.requires`/execution,
`ir.convenience.extract`,
`ir.convenience.replace_nodes_and_values`, and `ir.save`/`ir.load`.
No new private graph-state mutation, explicit protobuf operation,
production
activation expansion, or production opset relabeling was added.

## Dependencies and runtime limits

**Construction/registration does not require the installed opset-29
schemas.**
Normal export validation, ONNX checking, and schema inference still
audit
real schemas; removing the registration gate does not bypass them.

The experimental schema environment builds official ONNX revision
`82721c0908fa965dd84e674c006147791313f3e1` (reporting 1.24), with
IR 1.1.0 / onnxscript 0.7.2. ONNX 1.19 is the released-schema
compatibility
environment. Default dependency minimums remain unchanged.

IR 1.0.0 cannot parse the pinned source build's newer `FLOAT6E2M3` enum,
also reproduced on the unchanged earlier parent with ordinary opset-29
MatMulNBits construction. Minimum API availability does not imply the
minimum packages can parse every experimental schema. The actual
ONNX 1.19 + minimum IR 1.0.0 / onnxscript 0.7.1 combination is tested
below.

ORT 1.31.1 does **not** execute these opset-29 graphs directly. Generic
MoE/QMoE numerical tests expand GroupedMatMul and SwiGLU on a
**test-only
copy** for older kernels, using Swish-24 plus Mul for SwiGLU. Production
retains standard operators and original imports. Restored dense Gemma
regressions use ReferenceEvaluator at their original 24/29 imports.
Native HALF MoE tests have explicit capability skips on the FLOAT-only
CPU
registration; independent rounded-HALF coverage stays active.

## Prior full-cohort validation at 1a45c28

Broad command: `python -m pytest src/mobius
tests/ep_optimization_test.py -m opset29 -q -rs`.

| Check | Result |
|---|---|
| Final repair, actual ONNX 1.19 + IR 1.1.0 / onnxscript 0.7.2 | **893
passed, 23 skipped, 9995 deselected** |
| Same repair, actual ONNX 1.19 + minimum IR 1.0.0 / onnxscript 0.7.1 |
**893 passed, 23 skipped, 9995 deselected** |
| Same repair, exact pinned ONNX schema source + IR 1.1.0 / onnxscript
0.7.2 | **905 passed, 11 skipped, 9995 deselected** |
| Marker coverage | **916 selected:** 865 unchanged IDs, 7 explicitly
renamed Gemma cases for restored dispatch, 44 new cases; no prior
parameter case missing |
| Existing targeted Gemma MoE/expert/preprocessing/precision suite |
**68 passed** |
| Fail-before regressions, developer | Gemma **5 failed / 9 passed**;
QNN/aliases **21 failed / 14 passed** |
| Independent old-head numerical reproduction, lead | Both actual
wrong-expert and finite-to-infinity failures reproduced |
| Ruff lint/format on all five changed Python files; diff check | Passed
|
| Mypy on the three changed production sources versus exact e217b50
baseline | **65 pre-existing Gemma errors, zero added/removed
diagnostics**, exact message/column/unchanged-line comparison; resolver
and provider clean |

The 11 pinned skips are five unavailable native MoE HALF kernels, four
unsupported direct opset-29 runtime cases, and two optional OpenVINO
cases.
Released-schema runs additionally skip schema-dependent checks, not the
new dense Gemma export test. Local results are not overall hosted-CI
success.

## Hosted CI diagnosis

At e217b50, the dedicated experimental job **passed both stages**:
released ONNX **848 passed / 24 skipped**, pinned schemas
**861 passed / 11 skipped**. The previously pending pinned stage
completed.

The three failures in run `43282577546` (Integration fast, L4, L5)
occurred
**before tests**, while installing ORT GPU from external Azure feed/blob
endpoints: read timeouts/connection resets, not model assertions.
Those installation commands are unchanged versus exact PR base `858ead`.
On that exact base, Integration fast **passed** and L4/L5 were
**cancelled**;
these are **not claimed to be matching base failures**.
No unrelated workflow retry/tolerance/skip change is included.
The completed run `43300507986` at `1a45c280` passed the experimental
stages
(**893 passed / 23 skipped** released; **905 passed / 11 skipped**
pinned),
the Linux/Windows test matrix, Lint, L1, L3, and fast CPU OGA.
L4/L5 were **cancelled**, not passed. The next repair push starts fresh
CI;
its status must be checked separately.

## Review, dissent, and exclusions

Historical static review of d9c4acc: Code and Critical used actual
`gpt-6.1-sol`; Deep and Readability used actual `claude-sonnet-5.5`,
verified
from runtime events. This bounded follow-up received direct lead review
and
developer/lead execution evidence; **no fresh full-team approval is
claimed**.

| ID | Severity | Raised by | Finding | Disposition |
|---|---|---|---|---|
| C1 | Major | Copilot | QNN native capability | **Confirmed; fixed** |
| C2 | Major | Copilot | Core import aliases | **Confirmed; fixed** |
| C3 | Major | Copilot | Gemma tie ordering | **Confirmed; fixed by
removing added integration** |
| C4 | Major | Copilot | Gemma remaining-scale overflow | **Confirmed;
fixed by removing added integration** |
| F1, historical | Major | Deep | Uncalled selected functions allegedly
reach the no-progress error | **Rejected; reviewer withdrew.** Existing
no-annotation early return handles them; reproduced on IR 1.0.0 and
1.1.0. |

**Minority/correction record:** F1 was disproved by its concrete trace
and
existing branch, then withdrawn. Deep also corrected reversed-diff
claims
about the unpack TODO and explicit-zero comment. No disagreement remains
on F1. C3/C4's bugs were accepted; the minimal restoration replaces the
suggested tensor-reversal workaround.

**Attributed questions:** Readability's active-mask placement question
remains
non-blocking; its placement keeps routing-threshold semantics together.
Deep withdrew the raw-unpack question after confirming the TODO and
absence
of a standard raw-unpack operator.

**Coverage gap:** Historical Integration review remains blocked by the
authored/runtime mismatch (`mai-code-2.x1` versus `mai-code-2`); its
coverage
is not credited or replaced. Historical Deep/Readability excluded
numeric
test bodies; runtime evidence comes from lead/developer. Critical's
threat
model was N/A; this follow-up adds no privileged execution boundary.

Earlier non-blocking limits remain: bypassing Gemma weight preprocessing
is
not newly qualified; QMoE accepts a bounded power-of-two block subset;
direct configs require Python integers; uninlined optional arguments in
other consumers are not qualified.

**Residual risk:** no direct opset-29 kernels, QNN device execution,
CUDA/other-provider parity, performance/load measurements, GPU/L5
full-model
generation, arbitrary gates, BFLOAT16/FP4/prepacked qualification,
exhaustive
HALF proof, or whole-repository integration clearance. Whole-repository
Mypy is not clean. Task-created caches/intermediate models are removed
after validation; small evidence reports are retained.
The full cumulative 46-file diff has not received a unified latest-head
internal review; previous snapshot and bounded follow-up reviews are not
claimed as equivalent coverage.

## Scope and history

This consolidates the earlier MoE/QMoE work into #814; #815 remains
closed
unmerged. Earlier thread resolutions remain scoped to their cited
evidence,
including containing-root import authority and public IR alias handling.
No private-domain workaround was added.

See [float MoE](docs/moe-lowering.md) and
[INT4 QMoE](docs/qmoe-lowering.md) for qualified ABIs and runtime
exclusions.

---------

Signed-off-by: titaiwangms <[email protected]>
Co-authored-by: Copilot <[email protected]>
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