Skip to content

Fix Qwen3.5 standalone ORT GenAI model types - #631

Merged
titaiwangms merged 8 commits into
mainfrom
fix/qwen35-text-ort-model-type
Aug 26, 2026
Merged

titaiwangms merged 8 commits into
mainfrom
fix/qwen35-text-ort-model-type

Conversation

@titaiwangms

@titaiwangms titaiwangms commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • normalize standalone Qwen3.5/Qwen3.6 text packages to ORT GenAI's released generic decoder runtime
  • preserve distinct qwen3_5 and qwen3_5_moe runtime types for dense and MoE multimodal packages
  • recover the correct VLM parent type when config-mode exports expose only an unwrapped text subconfig
  • add regression coverage across decoder-only, HF-parent multimodal, and config-mode multimodal paths

Motivation

Mobius previously mapped every Qwen3.5/Qwen3.6 variant to qwen3_5. For a standalone Qwen3.6 text export, that selects ORT GenAI's multimodal runtime and requires vision and embedding sessions that do not exist in a single-component package.

Standalone graphs use the generic decoder contract already supported by released ORT GenAI. Full multimodal packages still require architecture-specific runtime types: qwen3_5 for dense models and qwen3_5_moe for MoE models.

This blocks the standalone text-generation recipe being prepared in microsoft/olive-recipes#588.

Validation

  • python -m pytest src/mobius/integrations/ort_genai/auto_export_test.py src/mobius/integrations/ort_genai/genai_config_test.py (252 passed)
  • targeted decoder-only, HF-parent multimodal, and config-mode multimodal tests (14 passed)
  • ruff check and ruff format --check on affected files
  • git diff --check

Preserve the dedicated Qwen3.5 text and MoE text model types when generating decoder-only ORT GenAI configs, while retaining multimodal parent types for VLM packages.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 72aa2acc-7ef6-4fe4-b760-921d80d29dd7
@titaiwangms
titaiwangms requested review from a team and a lite review from Copilot August 25, 2026 21:12
@github-actions

github-actions Bot commented Aug 25, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 133ab10 → b05096b

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 429 429 +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.

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.

Pull request overview

This PR adjusts ORT GenAI model-type handling for Qwen3.5/Qwen3.6 so standalone decoder-only exports retain the dedicated qwen3_5_text / qwen3_5_moe_text runtime types, while multimodal exports continue to use qwen3_5 / qwen3_5_moe to select the VLM pipeline.

Changes:

  • Preserve Qwen3.5 standalone text model types through model-type resolution and genai_config emission (avoid collapsing to decoder).
  • Keep multimodal Qwen3.5/Qwen3.6 exports mapped to the VLM runtime types (qwen3_5, qwen3_5_moe).
  • Add/extend regression tests for type resolution, decoder-only selection, and emitted genai_config contents.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/mobius/integrations/ort_genai/genai_config.py Treat qwen3_5_text / qwen3_5_moe_text as specialized decoder types so genai_config.json preserves them for standalone packages.
src/mobius/integrations/ort_genai/auto_export.py Update model-type mapping/selection docs and aliases to distinguish standalone text vs multimodal Qwen3.5/Qwen3.6 types.
src/mobius/integrations/ort_genai/auto_export_test.py Add regression tests ensuring text vs multimodal model types remain distinct and that standalone text packages emit LLM-only configs.

💡 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 25, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 133ab10 → b05096b

Model Sub-model Changes Status

No architecture changes detected. ✅


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

Normalize standalone Qwen3.5 text packages to the released generic decoder runtime and recover dense or MoE VLM parent types for config-mode multimodal exports.

Co-authored-by: Copilot <[email protected]>

Copilot-Session: 72aa2acc-7ef6-4fe4-b760-921d80d29dd7
@titaiwangms
titaiwangms enabled auto-merge (squash) August 25, 2026 23:03
titaiwangms and others added 5 commits August 25, 2026 16:32
Align specialized decoder model classes with their registered config classes, document unsupported golden coverage, and support both Transformers linear-attention cache layouts in parity tests. Mark Kimi-K3's selective MXFP4 checkpoint as a strict graph-only xfail for L2 validation.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwang <[email protected]>
Integrate the latest main-branch metadata changes without rewriting the existing PR history.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwang <[email protected]>
Move the accumulated main-branch model contract and cache compatibility fixes to a dedicated pull request so #631 remains scoped to Qwen3.5 runtime types.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: titaiwang <[email protected]>
@titaiwangms
titaiwangms merged commit c8803af into main Aug 26, 2026
19 of 25 checks passed
@titaiwangms
titaiwangms deleted the fix/qwen35-text-ort-model-type branch August 26, 2026 01:06
justinchuby added a commit that referenced this pull request Aug 26, 2026
## Summary

- promote `bailingmoe`, original `deepseek`, and `dots1` from deferred
to exact GGUF config/tensor-map/graph support while keeping runtime
support deferred
- preserve authoritative routing contracts: Bailing full-softmax top-k;
DeepSeek unnormalized softmax top-k; Dots1 metadata-selected
softmax/sigmoid, selection-only correction bias, pinned `2^-14`
normalization floor, and route scaling
- validate exact dense-prefix/routed/shared-expert schedules, including
all-dense DeepSeek/Dots1 files with absent or zero inactive expert
metadata
- enforce full-head RoPE for all three, full MHA for Dots1, complete
supported YaRN metadata, pinned beta/attention defaults, and fail-closed
rejection of unsupported scaling
- close tensor families and shapes, packed fused-QKV splits, bias
alternatives, shared experts, output ownership, auxiliary quantization
sidecars, and out-of-range tensors
- preserve llama.cpp Q/K inverse permutation for Bailing/DeepSeek while
retaining Dots1's Qwen2 checkpoint row order across F32 and Q4 packed
weights/scales/zero-points
- preserve existing PhiMoE output-head, GLM-MoE-DSA CPU/grouped-routing,
LFM2MoE correction-bias, dense/multimodal/specialized/runtime/package,
inference-metadata, and Qwen3.5 ORT GenAI contracts

## Exact base and head

- base: `c8803afb8251136e850010aba2cc4b8bf9854082` (includes #636, #638,
and #631)
- head: `6df92b6c80e250fe45d1a6378426fb55220cc045`
- the isolated 12-commit MoE series was replayed conflict-free onto this
exact live-main SHA and force-updated with a lease against old remote
head `a66de72595afdfdb9d94da9fad0b361ffd1803cf`

## Evidence

- focused registry/config/tensor/processor/closure/builder/docs/model
suite: `1899 passed, 1 skipped`
- shared MoE/build regression suite: `204 passed, 8 skipped, 1374
deselected`
- broad serial non-integration: `8120 passed, 57 skipped, 12 deselected,
1 subtest passed`, explicit `PYTEST_EXIT=0`
- promoted packed fused-QKV value/runtime coverage includes F32 and Q4_0
weights, scales, zero-points, biases, graph construction, and ORT
execution
- initialized all-files lint: clean
- generated GGUF documentation closure: clean
- final GPT-5.6 Sol medium architecture review: approved, no findings
- final GPT-5.6 Sol medium regression review: approved, no findings

An intermittent libc++ `recursive_mutex` teardown diagnostic was
previously reproduced after an assertion-clean parallel run. It did not
reproduce in the serial GGUF builder probe or final serial broad suites;
clean serial process exits are the publication evidence.

## Runtime waiver

Runtime remains `DEFERRED` for all three promotions. No practical
immutable small real-weight GGUF artifact was available to establish
full CLI/ORT GenAI generation parity without downloading
production-scale checkpoints. Graph execution, synthetic numerical
routing parity, packed tensor value checks, and ORT execution are
covered; runtime metadata does not claim support from architecture-name
matching.

## Residual deferred MoE

Different whole-model contracts remain separate batches:

- `ernie4_5-moe`, `hunyuan-moe`, `minimax-m2`, `mellum`: unmatched
per-layer schedules or Q/K norm/RoPE ordering
- `arctic`, `dbrx`, `grok`, `smallthinker`: incompatible residual
topology, norm order/type, fused/clamped attention, scaling/softcaps,
router input, expert activation, or per-layer RoPE
- `afmoe`, `laguna`, `granite_swa`, conditional `granite`/`minicpm`:
unmatched gates, SWA/cache contracts, architecture scales, or value
transforms
- `grovemoe`: grouped dual-bank routing is unsupported
- `gpt-oss`: value-changing MXFP4 packed expert conversion is
unsupported
- `minimax-m3`: second sparse-index cache ABI is unsupported
- `bailingmoe3`, `deepseek4`, Kimi/DeltaNet/Mamba hybrids: heterogeneous
recurrent/compressed state ABI
- DeepSeek NextN/MTP families: executable MTP/cache ABI is owned by the
separate deferred MTP batch
- multimodal MoE backbones remain excluded from this text-only cohort

---------

Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot App <[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.

3 participants