Skip to content

Decouple export from downstream runtime capability gates - #688

Merged
justinchuby merged 3 commits into
mainfrom
justinchuby-remove-downstream-export-gates
Aug 28, 2026
Merged

justinchuby merged 3 commits into
mainfrom
justinchuby-remove-downstream-export-gates

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Summary

  • remove GGUF, ORT GenAI, and onnx-genai export admission checks tied to downstream runtime versions, registries, processors, speculative/MTP APIs, topology, and heterogeneous cache orchestration
  • preserve graph-derived component/config/package contracts and emit machine-readable runtime_validation_status plus clear warnings without over-claiming exact validation
  • keep intrinsic graph/config/tensor, source-identity, unsupported storage-transform, and unexpected-error failures intact
  • separate GGUF graph exportability from real-artifact runtime evidence in the generated capability census and documentation

Validation

  • python -m pytest tests/build_graph_test.py tests/cli_test.py src/ -q -k "not phi4mm and not apply_weights_unknown" --tb=short -n auto
  • lintrunner --output oneline --all-files
  • python scripts/generate_gguf_support_docs.py --check
  • git diff --check
  • targeted export, GGUF package, Qwen4, Parakeet, draft/MTP, API, and CLI suites
  • two independent medium-effort code reviews, with findings addressed

Notes

This is compatible with a future partial-export manifest but does not depend on that work. Runtime evidence remains exact-artifact evidence rather than an export gate.

Emit graph- and package-derived metadata even when the tested downstream runtime lacks the required registry, topology, processor, speculative, or heterogeneous-state support. Record those limitations as advisory runtime validation status and warnings while retaining intrinsic semantic and source-integrity failures.\n\nSeparate GGUF exportability from real-artifact runtime evidence in the capability census and cover old/unknown runtime versions, unsupported registries, MTP/draft packages, and unexpected failures.\n\nCo-authored-by: Copilot App <[email protected]>

Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby requested review from a team and a lite review from Copilot August 28, 2026 15:24

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.

Copilot reviewed 18 out of 18 changed files in this pull request and generated no comments.


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 49c6c71 → 599d148

Model Sub-model Changes Status
qwen model 0 ⚪
qwen (static-cache) model 0 ⚪

No architecture changes detected. ✅


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

@github-actions

github-actions Bot commented Aug 28, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 49c6c71 → 599d148

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 68 68 +0.0% ⚪
falcon model_size_bytes 364 KB 364 KB +0.0% ⚪
falcon num_nodes 66 66 +0.0% ⚪
gemma2 model_size_bytes 428 KB 428 KB +0.0% ⚪
gemma2 num_nodes 105 105 +0.0% ⚪
gpt2 model_size_bytes 324 KB 324 KB +0.0% ⚪
gpt2 num_nodes 54 54 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 60 60 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 56 56 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 94 94 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 58 58 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 54 54 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 60 60 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) model_size_bytes 506 KB 506 KB +0.0% ⚪
qwen3_5_moe (hybrid-text-generation) num_nodes 265 265 +0.0% ⚪
qwen3_5_text (hybrid-text-generation) model_size_bytes 458 KB 458 KB +0.0% ⚪
qwen3_5_text (hybrid-text-generation) num_nodes 127 127 +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) model_size_bytes 977 KB 977 KB +0.0% ⚪
qwen3_5_vl (hybrid-qwen-vl) num_nodes 450 450 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 176 176 +0.0% ⚪
whisper (speech-to-text) model_size_bytes 1008 KB 1008 KB +0.0% ⚪
whisper (speech-to-text) num_nodes 128 128 +0.0% ⚪

No performance regressions.

Validate GGUF source identity independently of runtime evidence, preserve unknown execution providers as unvalidated metadata, and emit exact component contracts for unknown valid onnx-genai topologies while retaining malformed-package failures.\n\nCo-authored-by: Copilot App <[email protected]>

Signed-off-by: Justin Chu <[email protected]>
Require exact encoder-decoder topology for codec and speech workflow dispatch so valid supersets export advisory component contracts while malformed components continue to fail.\n\nCo-authored-by: Copilot App <[email protected]>

Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby merged commit 50bb373 into main Aug 28, 2026
16 of 25 checks passed
@justinchuby
justinchuby deleted the justinchuby-remove-downstream-export-gates branch August 28, 2026 15:56
justinchuby added a commit that referenced this pull request Aug 28, 2026
Persist the #688 graph-versus-runtime distinction in every standalone sidecar ONNX component while retaining non-gating export and the public runtime warning.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 28, 2026
## Summary

- Add role-explicit standalone GGUF sidecar export for `gemma3na`,
`gemma3nv`, `gemma4a`, `gemma4ua`, `gemma4uv`, `idefics3`, `internvl`,
`llama4`, and `pixtral`.
- Add reusable pixel-unshuffle, Idefics3, InternVL, Llama4, and Pixtral
projector components plus a dedicated Llama4 vision tower.
- Recover revision-neutral graph config and exact tensor mappings from
each sidecar while pinning immutable revisions only in the evidence
registry.
- Preserve active Gemma4 audio by default and support encoder-free
Gemma4 unified vision/audio sidecars without collapsing their roles.
- Integrate the #688 graph-versus-runtime policy: exact component export
remains non-gating, while every saved standalone graph records
`mobius.runtime_support=standalone-sidecar-only; paired multimodal
runtime unvalidated` and the dispatcher emits a warning.

## Route contracts

| Projector | ModelPackage role | Text target | Processor-native feature
contract |
|---|---|---|---|
| `gemma3nv` | `vision_encoder` | `gemma3n` | 768x768 image, 256 feature
rows |
| `gemma3na` | `audio_encoder` | `gemma3n` | 128-bin input features, 188
feature rows |
| `gemma4a` | `audio_encoder` | `gemma4` | Clipped Conformer audio
features |
| `gemma4uv` | `vision_encoder` | `gemma4` | 48x48 merged patches, one
row per valid patch |
| `gemma4ua` | `audio_encoder` | `gemma4` | Raw 640-sample frames, one
row per valid frame |
| `idefics3` | `vision_encoder` | `llama` | Dynamic tile count, 512x512
tiles, 64 rows per tile |
| `internvl` | `vision_encoder` | `qwen2` | Dynamic tile count, 448x448
tiles, 256 rows per tile, CLS-last GGUF ordering |
| `llama4` | `vision_encoder` | `llama4` | Dynamic tile count, 336x336
tiles, 144 rows per tile; adjacent-pair split-axis 2D RoPE |
| `pixtral` | `vision_encoder` | `llama` | Dynamic patch-aligned image;
`(H/16)*(W/16)+(H/16)-1` rows |

For Idefics3, InternVL, and Llama4, the symbolic `num_tiles` input is
processed tile-wise by the encoder/projector and reshaped from `[tiles,
rows_per_tile, hidden]` to rank-2 `[tiles * rows_per_tile, hidden]`.
ONNX row-major reshape preserves processor tile order and raster order
inside each tile; no synthetic tile separators are inserted because the
processor owns refined-crop/overview ordering.

Gemma3n's combined sidecar requires both presence flags and validates
all 825 co-resident vision/audio tensors against both role graphs.
Cross-pairing, aliasing, unknown tensors, unsupported packed projector
qtypes, and unrepresentable dynamic ABI paths fail closed.

## Runtime policy

Mobius emits the exact ONNX component whenever the graph is
representable. Downstream paired runtime execution remains explicitly
deferred and advisory; it does not gate standalone graph export. Every
standalone vision graph declares `when_present=image`. Only F32/F16/BF16
sidecar tensor storage is accepted.

## Evidence and validation

- Semantically rebased onto
`main@50bb373` (#688), retaining its
advisory runtime policy and regenerated census/docs.
- Immutable sparse-header preflight covered every promoted route;
artifacts and processors are pinned in the generated evidence census and
remain within the 16 GiB budget.
- 226 focused projector, mapping, pairing, census, documentation, and
independent numerical parity tests passed.
- One- and three-tile executable tests for Idefics3, InternVL, and
Llama4 prove symbolic input shape, cardinality, batch-major tile/raster
ordering, image-presence metadata, and parity with independently
executed single tiles.
- 9,038 broad non-integration tests passed, with 64 skipped and one
subtest passed.
- Llama4 full-tower independent parity uses `head_dim=8`, which
distinguishes adjacent complex-pair rotation from the incorrect
split-half layout.
- Targeted mypy passed for all new/shared projector sources.
- `lintrunner -a` passed.
- Independent medium-effort final review found no remaining issues.
- The inline image-presence review thread was answered and resolved.
- Temporary GGUF headers, sparse files, extracted sources, and scratch
payloads were removed before publication.

---------

Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>
justinchuby added a commit that referenced this pull request Aug 28, 2026
Implement exact standalone vision, audio, and speaker encoder graphs for glm4v, glma, qwen2.5o, qwen2a, qwen3a, qwen3vl_merger, and qwen3tts_spkenc.

Add route-specific tensor mappings, closure and qtype guards, immutable evidence, processor ABI contracts, independent numerical parity, and executable coverage. Preserve the advisory-only downstream runtime policy established by #688.

Co-authored-by: Copilot App <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
justinchuby added a commit that referenced this pull request Aug 28, 2026
## Summary

- add exact standalone GGUF projector routes for `glm4v`, `glma`,
`qwen2.5o`, `qwen2a`, `qwen3a`, `qwen3vl_merger`, and `qwen3tts_spkenc`
- enforce metadata, tensor closure, shape, modality pairing, and
F32/F16/BF16-only qtype contracts; quarantine `qwen3tts_gen`
- cover Qwen3-VL 2x2 merge cardinality, DeepStack width packing,
four-section decoder MRoPE, and route-selected transformer activation
semantics
- preserve #688's advisory-only downstream-runtime policy and
semantically retain #689's core-VLM builders, roles, evidence,
component-presence metadata, census, docs, and tests

## Rebased commit stack

- `171cec98` — small remaining shared standalone-dispatch/export delta
after #689 absorbed the reusable projector foundation
- `168414fe` — exactly the seven Qwen/GLM routes, mappings, components,
evidence, docs, and tests
- `1de782cf` — strict pre-closure metadata validation and Qwen3 audio
padding/length hardening
- `4b03d27e` — processor-native Qwen3 mask ABI, consumer-scoped SiLU
semantics, and single-preflight fix

Shared surfaces remain additive with #689: `_MMPROJ_BUILDERS` retains
both `core_vlm_projector` and `qwen_glm_projector`; generic
vision/audio/speaker tasks retain core component-presence metadata and
Qwen multi-output audio support.

## Review hardening

- `qwen3a` accepts the pinned `Qwen3ASRProcessor` output directly as
`input_features_mask: int32`, casts internally only for length
arithmetic, compacts padding-derived rows, and publishes
`audio_feature_lengths`
- all seven routes validate consumed metadata types, positive/finite
ranges, boolean presence flags, exact projector enums, and
route-specific geometry before tensor closure or graph construction
- `clip.use_silu` is validated and fingerprint-relevant only for
`glm4v`, `glma`, and `qwen3vl_merger`; Qwen3-VL transformer FFNs follow
it while final and DeepStack mergers remain tanh-GELU
- public standalone dispatch performs the expensive Qwen/GLM preflight
once; direct route-wrapper calls still validate when no prevalidated
model is injected
- the outstanding duplicate-preflight review thread was answered and
resolved

## Validation

- combined focused projector/task suite: 440 passed
- broad non-integration suite: 9,230 passed, 64 skipped, 1 subtest
passed
- lintrunner clean
- generated GGUF docs clean
- changed production modules pass mypy with import traversal isolated
- independent medium-effort review and follow-up review: no findings

Immutable selected evidence totals 5,980,273,312 bytes, below the 16 GiB
cap.

---------

Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Copilot-Session: e45c53d8-129d-461b-86fc-8ed79d816efe
titaiwangms pushed a commit that referenced this pull request Sep 17, 2026
## Summary

- Add typed weight records, component-owned bundles, and the
Olive/GPTQ/AWQ codec registry.
- Load existing quantized checkpoint weights using independent component
layouts and per-projection HuggingFace source-name overrides and
exclusions; do not quantize floating-point checkpoint weights.
- Preserve Gemma4, Qwen3.5/QMoE, and T5 architecture-specific weight
adaptations, tied tables, and component sidecar routing, and validate
quantized parameter binding.
- Preserve default attention head dimensions and KV-head counts when
HuggingFace configuration overrides only a subset of layers.
- Keep Gemma4 per-layer inputs in `[batch, sequence, layers,
projection]` form between embedding and decoder components for OpenVINO;
other execution providers retain the flattened layout.
- Restore the seq2seq, vision-language, and speech independent-component
quantization matrix coverage lost during the earlier graph-test file
split.

## Loading correctness fixes

- Recognize canonical weights only as complete, shape-matching groups so
raw GPTQ/AWQ scales remain available to their codec; validate zero
points using each projection's effective symmetry.
- Normalize quantized embedding tables for two-dimensional
GatherBlockQuantized storage rather than treating them as linear
projections.
- Honor Qwen3.5-MoE's model-declared float exclusions and Whisper's
declared output head during both graph construction and loading.
- Preserve the distinction between an absent component mapping (legacy
global rules) and an explicitly empty mapping (float components).
- Defer Gemma4 component packing until projection overrides are
resolved. Restore T5 HuggingFace source aliases and separate
decoder-stack rules from the independently owned top-level LM head.

## Consolidation

Replaces #666, #669, and #670 and consolidates the related development
from `test/per-component-quantization-stack` into this single PR.

The branch starts directly from `main` at
`a471d3416e9c52d5508d28730962e18c8a1053d0`. The design (#664) and
canonical component manifests (#665) are already merged and are not
separate dependencies of this PR.

This includes all seven previously uncommitted Gemma4/config/EP files
from the old development worktree, not just the three original PR heads.
The committed old feature stack was also compared with main plus this
PR: production feature areas were retained, and its missing graph-layout
matrix tests were restored in the current split test modules.

## Review and CI follow-up

Addressed all eight inline review threads, including
duplicate/already-resolved reports, in `190eb8a5`:

- Literal module rules now respect path boundaries; the compatibility
normalizer rejects a missing task clearly. Redundant Protocol statements
and alias parentheses are removed.
- Fixed the Gemma3 split-tied loading regression, including its
previously floating-point scaled embedding. A shared scaled quantized
embedding preserves Gemma4 behavior, and actual embedding execution plus
unsupported-tie guards are covered.
- Corrected the LLaVA fixture's missing `vision_model` namespace without
relaxing target validation.
- Updated the stale GGUF integration expectation to the export contract
already established by #688; tokenizer-identity rejection and full
logit/generation comparisons remain intact.

The original full L4/L5 jobs hit their explicit one-hour limits after
recording failures. Those failed case IDs also occur on the exact base
`a471d341`, but cancellation lost exception details, so they are not
claimed to be infrastructure-only or fixed. No model selection,
tolerance, or timeout was weakened. Isolated GPT-2 diagnostics at the
original head each executed and passed exactly one selected case: L4
https://github.com/onnxruntime/mobius/actions/runs/34308638240 and L5
https://github.com/onnxruntime/mobius/actions/runs/34308638242 . These
single-case successes do not certify the all-model golden jobs.

Fresh full CI for the published follow-up:
https://github.com/onnxruntime/mobius/actions/runs/34309655380 .

## Validation

- **874 passed, 16 skipped, 4 deselected** in the focused
loading/config/model/CLI/graph suite, including the repaired CI
selectors and scaled quantized embedding execution.
- **1 passed** for the real pinned `smollm2-135m-instruct-f16` GGUF CLI
export/reload, full-logit, and generation integration case.
- Ruff lint and formatting passed for the changed Python files.
Independent review of this follow-up found no significant issues.
- Runs used the repository-required onnx-ir API through isolated
dependencies; the shared environment was not modified.
- The original seven-file pending patch remains consolidated in this PR.
Local evidence does not claim that the all-model golden jobs or physical
NPU execution are green.

---------

Signed-off-by: Xiaoyu Zhang <[email protected]>
Signed-off-by: xiaoyu-work <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[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