Skip to content

refactor: standardize ModelPackage component names across multimodal tasks - #205

Merged
justinchuby merged 14 commits into
mainfrom
justinchu/standardize-components
Apr 25, 2026
Merged

justinchuby merged 14 commits into
mainfrom
justinchu/standardize-components

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Standardize to decoder/vision/audio/embedding. Rename processor config. Fix decoder filename.

Adopt consistent component keys for all multimodal tasks:
- decoder (was 'model' in Phi4MM)
- vision
- audio (was 'speech' in Phi4MM, 'audio_encoder' in SpeechLanguage)
- embedding

Rename processor config to image_processor.json (distinct from
future audio_processor.json). Fix decoder filename derivation
from actual package key.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Comprehensive sweep of tests, examples, and golden test configs
to complete the component name standardization:
- pkg["speech"] → pkg["audio"] in tests and examples
- sessions["audio_encoder"] → sessions["audio"] in examples
- Remove fallback patterns for old key names
- Update Gemma4 examples to use image_processor.json

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>

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

Standardizes ModelPackage component naming across multimodal tasks/integrations to use decoder/vision/audio/embedding, and updates ORT-GenAI config generation/tests to match (including the image processor config rename and decoder filename handling).

Changes:

  • Renamed multimodal package keys (model→decoder, speech→audio, audio_encoder→audio) across tasks and tests.
  • Updated ORT-GenAI config generation to use image_processor.json and to support an explicit decoder filename for multi-model packages.
  • Refreshed Gemma4 ORT-GenAI example configs/artifacts to reference image_processor.json and the audio section name.

Reviewed changes

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

Show a summary per file
File Description
tests/ort_genai_test.py Updates vision processor config filename to image_processor.json.
tests/build_graph_test.py Adjusts assertions to new package keys (decoder, audio).
src/mobius/tasks/_speech_language.py Renames audio_encoder package key to audio and updates graph naming.
src/mobius/tasks/_phi4mm_multimodal.py Renames Phi4MM package keys to decoder and audio.
src/mobius/integrations/ort_genai/genai_config_test.py Updates expected genai_config structure/filenames for audio + image_processor.json.
src/mobius/integrations/ort_genai/genai_config.py Adds decoder_filename support; renames vision config default filename; emits audio block.
src/mobius/integrations/ort_genai/auto_export_test.py Updates test expectations for audio/decoder keys and image_processor.json.
src/mobius/integrations/ort_genai/auto_export.py Writes image_processor.json; derives decoder filename for subfolder layout; detects audio key.
src/mobius/_builder.py Adds audio role mapping while keeping backward-compat aliases.
examples/gemma4/ort_genai/vlm/image_processor.json Adds new example image processor config.
examples/gemma4/ort_genai/vlm/genai_config.json Updates vision config_filename to image_processor.json.
examples/gemma4/ort_genai/any_to_any/genai_config.json Renames speech section to audio in the example config.

- speech.onnx → audio/model.onnx in example configs
- with_speech() → with_audio(), _speech → _audio internally
- Return key 'processor_config' → 'image_processor'

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby requested a review from apsonawane April 23, 2026 21:57
justinchuby and others added 5 commits April 23, 2026 21:59
Replace hand-edited example configs with actual generated output
from 'mobius build --runtime ort-genai'. Ensures examples match
what users will get, with correct nested filenames and all fields.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
- Fix bos_token_id extraction: fall back to text_config when parent
  HF config doesn't have it (Gemma4Config stores it on text_config)
- Add boa_token_id (beginning-of-audio) to genai config via
  with_audio() — lives on the parent Gemma4Config
- Add _write_audio_processor_config() for Gemma4 USM-style log-mel
  spectrogram parameters (matches ort-extensions Gemma4LogMel)
- Regenerate example configs with all token IDs present

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Extract boa_token_id from HF parent config in Gemma4Config.
from_transformers(), making it available to the genai config
generator through our standard config object rather than ad-hoc
HF config reads. Regenerate example configs with all token IDs.

Also add audio_processor.json generation for Gemma4 audio encoder.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
- TestGemma4Config: verify boa_token_id extraction from parent config
- TestGemma4RealModel: verify bos_token_id in genai config output
- TestGenaiConfigGeneratorMultimodal: verify boa_token_id in/out

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@github-actions

github-actions Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing a266139 → aba182f

Model Metric Baseline Current Delta
bert (feature-extraction) model_size_bytes 359 KB 359 KB +0.0% ⚪
bert (feature-extraction) num_nodes 60 60 +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 107 107 +0.0% ⚪
gpt2 model_size_bytes 388 KB 388 KB +0.0% ⚪
gpt2 num_nodes 53 53 +0.0% ⚪
llama model_size_bytes 425 KB 425 KB +0.0% ⚪
llama num_nodes 61 61 +0.0% ⚪
llama (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
llama (static-cache) num_nodes 58 58 +0.0% ⚪
mamba (ssm-text-generation) model_size_bytes 296 KB 296 KB +0.0% ⚪
mamba (ssm-text-generation) num_nodes 98 98 +0.0% ⚪
phi3 model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 num_nodes 59 59 +0.0% ⚪
phi3 (static-cache) model_size_bytes 421 KB 421 KB +0.0% ⚪
phi3 (static-cache) num_nodes 56 56 +0.0% ⚪
qwen2 model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 num_nodes 61 61 +0.0% ⚪
qwen2 (static-cache) model_size_bytes 425 KB 425 KB +0.0% ⚪
qwen2 (static-cache) num_nodes 58 58 +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 275 275 +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 129 129 +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 408 408 +0.0% ⚪
t5 (seq2seq) model_size_bytes 836 KB 836 KB +0.0% ⚪
t5 (seq2seq) num_nodes 166 166 +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.

@codecov

codecov Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 87.74194% with 19 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mobius/integrations/ort_genai/auto_export.py 58.69% 14 Missing and 5 partials ⚠️

📢 Thoughts on this report? Let us know!

- Introspect audio graph inputs (was hardcoded, now matches decoder/vision/embedding)
- Extract _TOKENIZER_FILES constant, _GEMMA4_MODEL_TYPES set, _introspect_inputs() helper
- Remove duplicate any_to_any example config directory
- Consolidate test helpers

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@github-actions

github-actions Bot commented Apr 23, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing a266139 → aba182f

Model Sub-model Changes Status
bert (feature-extraction) model 0 ⚪
falcon model 0 ⚪
gemma2 model 0 ⚪
gemma4 (gemma4) decoder 0 ⚪
gemma4 (gemma4) embedding 0 ⚪
gemma4 (gemma4) vision 204 🔴
gemma4 (gemma4) vision_encoder 204 🔴
gemma4_text model 0 ⚪
gpt2 model 0 ⚪
llama model 0 ⚪
llama (static-cache) model 0 ⚪
mamba (ssm-text-generation) model 0 ⚪
phi3 model 0 ⚪
phi3 (static-cache) model 0 ⚪
qwen model 0 ⚪
qwen (static-cache) model 0 ⚪
qwen2 model 0 ⚪
qwen2 (static-cache) model 0 ⚪
qwen2_moe model 0 ⚪
qwen2_moe (static-cache) model 0 ⚪
qwen3 model 0 ⚪
qwen3 (static-cache) model 0 ⚪
qwen3_5_moe (hybrid-text-generation) model 0 ⚪
qwen3_5_text (hybrid-text-generation) model 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) decoder 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) embedding 0 ⚪
qwen3_5_vl (hybrid-qwen-vl) vision 242 🔴
qwen3_5_vl (hybrid-qwen-vl) vision_encoder 242 🔴
qwen3_moe model 0 ⚪
qwen3_moe (static-cache) model 0 ⚪
qwen3_next (hybrid-text-generation) model 0 ⚪
t5 (seq2seq) decoder 0 ⚪
t5 (seq2seq) encoder 0 ⚪
whisper (speech-to-text) decoder 0 ⚪
whisper (speech-to-text) encoder 0 ⚪
gemma4 (gemma4) / vision — 204 change(s)

Op summary: 202 → 0 nodes

--- base
+++ head
@@ -1,202 +0,0 @@
-Constant
-CastLike
-Constant
-CastLike
-Mul
-Sub
-Transpose
-MatMul
-Constant
-Gather
-Constant
-Equal
-Constant
-Clip
-Constant
-Gather
-Constant
-Gather
-Constant
-Gather
-Constant
-Gather
-Gather
-Gather
-Add
-CastLike
-Not
-Unsqueeze
-Where
-Add
-CastLike
-CastLike
-Where
-Unsqueeze
-RMSNormalization
-Clip
-Transpose
-MatMul
-Clip
-Clip
-Transpose
-MatMul
-Clip
-Clip
-Transpose
-MatMul
-Clip
-Reshape
-Reshape
-Reshape
-RMSNormalization
-RMSNormalization
-Mul
-Constant
-ReduceMean
-Constant
-CastLike
-Add
-Sqrt
-Div
-Constant
-Gather
-Constant
-Clip
-Constant
-Gather
-Constant
-Clip
-Gather
-Gather
-Gather
-Gather
-Unsqueeze
-Unsqueeze
-Unsqueeze
-Unsqueeze
-Slice
-Slice
-Slice
-Slice
-Slice
-Slice
-Neg
-Concat
-Mul
-Mul
-Add
-Slice
-Slice
-Neg
-Concat
-Mul
-Mul
-Add
-Concat
-Slice
-Slice
-Neg
-Concat
-Mul
-Mul
-Add
-Slice
-Slice
-Neg
-Concat
-Mul
-Mul
-Add
-Concat
-Transpose
-Transpose
-Transpose
-Transpose
-MatMul
-Add
-Softmax
-MatMul
-Transpose
-Reshape
-Clip
-Transpose
-MatMul
-Clip
-RMSNormalization
-Add
-RMSNormalization
-Clip
-Transpose
-MatMul
-Clip
-Gelu
-Clip
-Transpose
-MatMul
-Clip
-Mul
-Clip
-Transpose
-MatMul
-Clip
-RMSNormalization
-Add
-Unsqueeze
-Constant
-CastLike
-Where
-Constant
-Constant
-Gather
-Constant
-Gather
-Equal
-Equal
-And
-Not
-Cast
-CastLike
-Unsqueeze
-Mul
-Constant
-Max
-Constant
-Max
-Constant
-ReduceMax
-Constant
-Add
-Constant
-ReduceMax
-Constant
-Add
-Constant
-Div
-Div
-Mul
-Constant
-Squeeze
-Div
-Div
-Mul
-Add
-Constant
-CastLike
-OneHot
-Transpose
-MatMul
-Constant
-CastLike
-Mul
-Mul
-Constant
-ReduceMean
-Constant
-CastLike
-Add
-Sqrt
-Div
-Transpose
-MatMul
-Constant
-Reshape

Removed nodes:

  • - Constant
  • - CastLike
  • - Constant
  • - CastLike
  • - Mul
  • - Sub
  • - Transpose
  • - MatMul
  • - Constant
  • - Gather
  • - Constant
  • - Equal
  • - Constant
  • - Clip
  • - Constant
  • - Gather
  • - Constant
  • - Gather
  • - Constant
  • - Gather
  • - Constant
  • - Gather
  • - Gather
  • - Gather
  • - Add
  • - CastLike
  • - Not
  • - Unsqueeze
  • - Where
  • - Add
  • - CastLike
  • - CastLike
  • - Where
  • - Unsqueeze
  • - RMSNormalization
  • - Clip
  • - Transpose
  • - MatMul
  • - Clip
  • - Clip
  • - Transpose
  • - MatMul
  • - Clip
  • - Clip
  • - Transpose
  • - MatMul
  • - Clip
  • - Reshape
  • - Reshape
  • - Reshape
  • - RMSNormalization
  • - RMSNormalization
  • - Mul
  • - Constant
  • - ReduceMean
  • - Constant
  • - CastLike
  • - Add
  • - Sqrt
  • - Div
  • - Constant
  • - Gather
  • - Constant
  • - Clip
  • - Constant
  • - Gather
  • - Constant
  • - Clip
  • - Gather
  • - Gather
  • - Gather
  • - Gather
  • - Unsqueeze
  • - Unsqueeze
  • - Unsqueeze
  • - Unsqueeze
  • - Slice
  • - Slice
  • - Slice
  • - Slice
  • - Slice
  • - Slice
  • - Neg
  • - Concat
  • - Mul
  • - Mul
  • - Add
  • - Slice
  • - Slice
  • - Neg
  • - Concat
  • - Mul
  • - Mul
  • - Add
  • - Concat
  • - Slice
  • - Slice
  • - Neg
  • - Concat
  • - Mul
  • - Mul
  • - Add
  • - Slice
  • - Slice
  • - Neg
  • - Concat
  • - Mul
  • - Mul
  • - Add
  • - Concat
  • - Transpose
  • - Transpose
  • - Transpose
  • - Transpose
  • - MatMul
  • - Add
  • - Softmax
  • - MatMul
  • - Transpose
  • - Reshape
  • - Clip
  • - Transpose
  • - MatMul
  • - Clip
  • - RMSNormalization
  • - Add
  • - RMSNormalization
  • - Clip
  • - Transpose
  • - MatMul
  • - Clip
  • - Gelu
  • - Clip
  • - Transpose
  • - MatMul
  • - Clip
  • - Mul
  • - Clip
  • - Transpose
  • - MatMul
  • - Clip
  • - RMSNormalization
  • - Add
  • - Unsqueeze
  • - Constant
  • - CastLike
  • - Where
  • - Constant
  • - Constant
  • - Gather
  • - Constant
  • - Gather
  • - Equal
  • - Equal
  • - And
  • - Not
  • - Cast
  • - CastLike
  • - Unsqueeze
  • - Mul
  • - Constant
  • - Max
  • - Constant
  • - Max
  • - Constant
  • - ReduceMax
  • - Constant
  • - Add
  • - Constant
  • - ReduceMax
  • - Constant
  • - Add
  • - Constant
  • - Div
  • - Div
  • - Mul
  • - Constant
  • - Squeeze
  • - Div
  • - Div
  • - Mul
  • - Add
  • - Constant
  • - CastLike
  • - OneHot
  • - Transpose
  • - MatMul
  • - Constant
  • - CastLike
  • - Mul
  • - Mul
  • - Constant
  • - ReduceMean
  • - Constant
  • - CastLike
  • - Add
  • - Sqrt
  • - Div
  • - Transpose
  • - MatMul
  • - Constant
  • - Reshape

Interface changes:

  • input count 2 → 0; output count 1 → 0

Initializer changes:

  • initializer count 57 → 0
gemma4 (gemma4) / vision_encoder — 204 change(s)

Op summary: 0 → 202 nodes

--- base
+++ head
@@ -0,0 +1,202 @@
+Constant
+CastLike
+Constant
+CastLike
+Mul
+Sub
+Transpose
+MatMul
+Constant
+Gather
+Constant
+Equal
+Constant
+Clip
+Constant
+Gather
+Constant
+Gather
+Constant
+Gather
+Constant
+Gather
+Gather
+Gather
+Add
+CastLike
+Not
+Unsqueeze
+Where
+Add
+CastLike
+CastLike
+Where
+Unsqueeze
+RMSNormalization
+Clip
+Transpose
+MatMul
+Clip
+Clip
+Transpose
+MatMul
+Clip
+Clip
+Transpose
+MatMul
+Clip
+Reshape
+Reshape
+Reshape
+RMSNormalization
+RMSNormalization
+Mul
+Constant
+ReduceMean
+Constant
+CastLike
+Add
+Sqrt
+Div
+Constant
+Gather
+Constant
+Clip
+Constant
+Gather
+Constant
+Clip
+Gather
+Gather
+Gather
+Gather
+Unsqueeze
+Unsqueeze
+Unsqueeze
+Unsqueeze
+Slice
+Slice
+Slice
+Slice
+Slice
+Slice
+Neg
+Concat
+Mul
+Mul
+Add
+Slice
+Slice
+Neg
+Concat
+Mul
+Mul
+Add
+Concat
+Slice
+Slice
+Neg
+Concat
+Mul
+Mul
+Add
+Slice
+Slice
+Neg
+Concat
+Mul
+Mul
+Add
+Concat
+Transpose
+Transpose
+Transpose
+Transpose
+MatMul
+Add
+Softmax
+MatMul
+Transpose
+Reshape
+Clip
+Transpose
+MatMul
+Clip
+RMSNormalization
+Add
+RMSNormalization
+Clip
+Transpose
+MatMul
+Clip
+Gelu
+Clip
+Transpose
+MatMul
+Clip
+Mul
+Clip
+Transpose
+MatMul
+Clip
+RMSNormalization
+Add
+Unsqueeze
+Constant
+CastLike
+Where
+Constant
+Constant
+Gather
+Constant
+Gather
+Equal
+Equal
+And
+Not
+Cast
+CastLike
+Unsqueeze
+Mul
+Constant
+Max
+Constant
+Max
+Constant
+ReduceMax
+Constant
+Add
+Constant
+ReduceMax
+Constant
+Add
+Constant
+Div
+Div
+Mul
+Constant
+Squeeze
+Div
+Div
+Mul
+Add
+Constant
+CastLike
+OneHot
+Transpose
+MatMul
+Constant
+CastLike
+Mul
+Mul
+Constant
+ReduceMean
+Constant
+CastLike
+Add
+Sqrt
+Div
+Transpose
+MatMul
+Constant
+Reshape

Added nodes:

  • + Constant
  • + CastLike
  • + Constant
  • + CastLike
  • + Mul
  • + Sub
  • + Transpose
  • + MatMul
  • + Constant
  • + Gather
  • + Constant
  • + Equal
  • + Constant
  • + Clip
  • + Constant
  • + Gather
  • + Constant
  • + Gather
  • + Constant
  • + Gather
  • + Constant
  • + Gather
  • + Gather
  • + Gather
  • + Add
  • + CastLike
  • + Not
  • + Unsqueeze
  • + Where
  • + Add
  • + CastLike
  • + CastLike
  • + Where
  • + Unsqueeze
  • + RMSNormalization
  • + Clip
  • + Transpose
  • + MatMul
  • + Clip
  • + Clip
  • + Transpose
  • + MatMul
  • + Clip
  • + Clip
  • + Transpose
  • + MatMul
  • + Clip
  • + Reshape
  • + Reshape
  • + Reshape
  • + RMSNormalization
  • + RMSNormalization
  • + Mul
  • + Constant
  • + ReduceMean
  • + Constant
  • + CastLike
  • + Add
  • + Sqrt
  • + Div
  • + Constant
  • + Gather
  • + Constant
  • + Clip
  • + Constant
  • + Gather
  • + Constant
  • + Clip
  • + Gather
  • + Gather
  • + Gather
  • + Gather
  • + Unsqueeze
  • + Unsqueeze
  • + Unsqueeze
  • + Unsqueeze
  • + Slice
  • + Slice
  • + Slice
  • + Slice
  • + Slice
  • + Slice
  • + Neg
  • + Concat
  • + Mul
  • + Mul
  • + Add
  • + Slice
  • + Slice
  • + Neg
  • + Concat
  • + Mul
  • + Mul
  • + Add
  • + Concat
  • + Slice
  • + Slice
  • + Neg
  • + Concat
  • + Mul
  • + Mul
  • + Add
  • + Slice
  • + Slice
  • + Neg
  • + Concat
  • + Mul
  • + Mul
  • + Add
  • + Concat
  • + Transpose
  • + Transpose
  • + Transpose
  • + Transpose
  • + MatMul
  • + Add
  • + Softmax
  • + MatMul
  • + Transpose
  • + Reshape
  • + Clip
  • + Transpose
  • + MatMul
  • + Clip
  • + RMSNormalization
  • + Add
  • + RMSNormalization
  • + Clip
  • + Transpose
  • + MatMul
  • + Clip
  • + Gelu
  • + Clip
  • + Transpose
  • + MatMul
  • + Clip
  • + Mul
  • + Clip
  • + Transpose
  • + MatMul
  • + Clip
  • + RMSNormalization
  • + Add
  • + Unsqueeze
  • + Constant
  • + CastLike
  • + Where
  • + Constant
  • + Constant
  • + Gather
  • + Constant
  • + Gather
  • + Equal
  • + Equal
  • + And
  • + Not
  • + Cast
  • + CastLike
  • + Unsqueeze
  • + Mul
  • + Constant
  • + Max
  • + Constant
  • + Max
  • + Constant
  • + ReduceMax
  • + Constant
  • + Add
  • + Constant
  • + ReduceMax
  • + Constant
  • + Add
  • + Constant
  • + Div
  • + Div
  • + Mul
  • + Constant
  • + Squeeze
  • + Div
  • + Div
  • + Mul
  • + Add
  • + Constant
  • + CastLike
  • + OneHot
  • + Transpose
  • + MatMul
  • + Constant
  • + CastLike
  • + Mul
  • + Mul
  • + Constant
  • + ReduceMean
  • + Constant
  • + CastLike
  • + Add
  • + Sqrt
  • + Div
  • + Transpose
  • + MatMul
  • + Constant
  • + Reshape

Interface changes:

  • input count 0 → 2; output count 0 → 1

Initializer changes:

  • initializer count 0 → 57
qwen3_5_vl (hybrid-qwen-vl) / vision — 242 change(s)

Op summary: 240 → 0 nodes

--- base
+++ head
@@ -1,240 +0,0 @@
-Reshape
-Conv
-Reshape
-Slice
-Squeeze
-Slice
-Squeeze
-Slice
-Squeeze
-Mul
-Mul
-ReduceMax
-Scan
-Shape
-Constant
-Gather
-Constant
-Squeeze
-Constant
-Range
-Unsqueeze
-Unsqueeze
-Less
-Reshape
-Shape
-Slice
-Constant
-Concat
-Reshape
-Compress
-Add
-Slice
-Squeeze
-Slice
-Squeeze
-Slice
-Squeeze
-Mul
-Mul
-ReduceMax
-Scan
-Shape
-Constant
-Gather
-Constant
-Squeeze
-Constant
-Range
-Unsqueeze
-Unsqueeze
-Less
-Reshape
-Shape
-Slice
-Constant
-Concat
-Reshape
-Compress
-Gather
-Gather
-Squeeze
-Squeeze
-Gather
-Gather
-Gather
-Gather
-Concat
-Concat
-Slice
-Squeeze
-ReduceMax
-Scan
-Shape
-Constant
-Gather
-Constant
-Squeeze
-Constant
-Range
-Unsqueeze
-Unsqueeze
-Less
-Reshape
-Shape
-Slice
-Constant
-Concat
-Reshape
-Compress
-Constant
-CumSum
-Constant
-Constant
-Pad
-LayerNormalization
-Transpose
-MatMul
-Add
-Split
-Reshape
-Reshape
-Unsqueeze
-Unsqueeze
-Split
-Split
-Mul
-Mul
-Sub
-Mul
-Mul
-Add
-Concat
-Mul
-Mul
-Sub
-Mul
-Mul
-Add
-Concat
-Reshape
-Reshape
-Shape
-Squeeze
-Constant
-Constant
-Range
-Unsqueeze
-Unsqueeze
-GreaterOrEqual
-Cast
-ReduceSum
-Constant
-Sub
-Unsqueeze
-Unsqueeze
-Equal
-CastLike
-CastLike
-Where
-Unsqueeze
-Unsqueeze
-Unsqueeze
-Unsqueeze
-Attention
-Squeeze
-Transpose
-MatMul
-Add
-Add
-LayerNormalization
-Transpose
-MatMul
-Add
-Gelu
-Transpose
-MatMul
-Add
-Add
-Reshape
-LayerNormalization
-Transpose
-MatMul
-Add
-Gelu
-Transpose
-MatMul
-Add
-LayerNormalization
-Transpose
-MatMul
-Add
-Split
-Reshape
-Reshape
-Unsqueeze
-Unsqueeze
-Split
-Split
-Mul
-Mul
-Sub
-Mul
-Mul
-Add
-Concat
-Mul
-Mul
-Sub
-Mul
-Mul
-Add
-Concat
-Reshape
-Reshape
-Shape
-Squeeze
-Constant
-Constant
-Range
-Unsqueeze
-Unsqueeze
-GreaterOrEqual
-Cast
-ReduceSum
-Constant
-Sub
-Unsqueeze
-Unsqueeze
-Equal
-CastLike
-CastLike
-Where
-Unsqueeze
-Unsqueeze
-Unsqueeze
-Unsqueeze
-Attention
-Squeeze
-Transpose
-MatMul
-Add
-Add
-LayerNormalization
-Transpose
-MatMul
-Add
-Gelu
-Transpose
-MatMul
-Add
-Add
-LayerNormalization
-Reshape
-Transpose
-MatMul
-Add
-Gelu
-Transpose
-MatMul
-Add

Removed nodes:

  • - Reshape
  • - Conv
  • - Reshape
  • - Slice
  • - Squeeze
  • - Slice
  • - Squeeze
  • - Slice
  • - Squeeze
  • - Mul
  • - Mul
  • - ReduceMax
  • - Scan
  • - Shape
  • - Constant
  • - Gather
  • - Constant
  • - Squeeze
  • - Constant
  • - Range
  • - Unsqueeze
  • - Unsqueeze
  • - Less
  • - Reshape
  • - Shape
  • - Slice
  • - Constant
  • - Concat
  • - Reshape
  • - Compress
  • - Add
  • - Slice
  • - Squeeze
  • - Slice
  • - Squeeze
  • - Slice
  • - Squeeze
  • - Mul
  • - Mul
  • - ReduceMax
  • - Scan
  • - Shape
  • - Constant
  • - Gather
  • - Constant
  • - Squeeze
  • - Constant
  • - Range
  • - Unsqueeze
  • - Unsqueeze
  • - Less
  • - Reshape
  • - Shape
  • - Slice
  • - Constant
  • - Concat
  • - Reshape
  • - Compress
  • - Gather
  • - Gather
  • - Squeeze
  • - Squeeze
  • - Gather
  • - Gather
  • - Gather
  • - Gather
  • - Concat
  • - Concat
  • - Slice
  • - Squeeze
  • - ReduceMax
  • - Scan
  • - Shape
  • - Constant
  • - Gather
  • - Constant
  • - Squeeze
  • - Constant
  • - Range
  • - Unsqueeze
  • - Unsqueeze
  • - Less
  • - Reshape
  • - Shape
  • - Slice
  • - Constant
  • - Concat
  • - Reshape
  • - Compress
  • - Constant
  • - CumSum
  • - Constant
  • - Constant
  • - Pad
  • - LayerNormalization
  • - Transpose
  • - MatMul
  • - Add
  • - Split
  • - Reshape
  • - Reshape
  • - Unsqueeze
  • - Unsqueeze
  • - Split
  • - Split
  • - Mul
  • - Mul
  • - Sub
  • - Mul
  • - Mul
  • - Add
  • - Concat
  • - Mul
  • - Mul
  • - Sub
  • - Mul
  • - Mul
  • - Add
  • - Concat
  • - Reshape
  • - Reshape
  • - Shape
  • - Squeeze
  • - Constant
  • - Constant
  • - Range
  • - Unsqueeze
  • - Unsqueeze
  • - GreaterOrEqual
  • - Cast
  • - ReduceSum
  • - Constant
  • - Sub
  • - Unsqueeze
  • - Unsqueeze
  • - Equal
  • - CastLike
  • - CastLike
  • - Where
  • - Unsqueeze
  • - Unsqueeze
  • - Unsqueeze
  • - Unsqueeze
  • - Attention
  • - Squeeze
  • - Transpose
  • - MatMul
  • - Add
  • - Add
  • - LayerNormalization
  • - Transpose
  • - MatMul
  • - Add
  • - Gelu
  • - Transpose
  • - MatMul
  • - Add
  • - Add
  • - Reshape
  • - LayerNormalization
  • - Transpose
  • - MatMul
  • - Add
  • - Gelu
  • - Transpose
  • - MatMul
  • - Add
  • - LayerNormalization
  • - Transpose
  • - MatMul
  • - Add
  • - Split
  • - Reshape
  • - Reshape
  • - Unsqueeze
  • - Unsqueeze
  • - Split
  • - Split
  • - Mul
  • - Mul
  • - Sub
  • - Mul
  • - Mul
  • - Add
  • - Concat
  • - Mul
  • - Mul
  • - Sub
  • - Mul
  • - Mul
  • - Add
  • - Concat
  • - Reshape
  • - Reshape
  • - Shape
  • - Squeeze
  • - Constant
  • - Constant
  • - Range
  • - Unsqueeze
  • - Unsqueeze
  • - GreaterOrEqual
  • - Cast
  • - ReduceSum
  • - Constant
  • - Sub
  • - Unsqueeze
  • - Unsqueeze
  • - Equal
  • - CastLike
  • - CastLike
  • - Where
  • - Unsqueeze
  • - Unsqueeze
  • - Unsqueeze
  • - Unsqueeze
  • - Attention
  • - Squeeze
  • - Transpose
  • - MatMul
  • - Add
  • - Add
  • - LayerNormalization
  • - Transpose
  • - MatMul
  • - Add
  • - Gelu
  • - Transpose
  • - MatMul
  • - Add
  • - Add
  • - LayerNormalization
  • - Reshape
  • - Transpose
  • - MatMul
  • - Add
  • - Gelu
  • - Transpose
  • - MatMul
  • - Add

Interface changes:

  • input count 2 → 0; output count 1 → 0

Initializer changes:

  • initializer count 55 → 0
qwen3_5_vl (hybrid-qwen-vl) / vision_encoder — 242 change(s)

Op summary: 0 → 240 nodes

--- base
+++ head
@@ -0,0 +1,240 @@
+Reshape
+Conv
+Reshape
+Slice
+Squeeze
+Slice
+Squeeze
+Slice
+Squeeze
+Mul
+Mul
+ReduceMax
+Scan
+Shape
+Constant
+Gather
+Constant
+Squeeze
+Constant
+Range
+Unsqueeze
+Unsqueeze
+Less
+Reshape
+Shape
+Slice
+Constant
+Concat
+Reshape
+Compress
+Add
+Slice
+Squeeze
+Slice
+Squeeze
+Slice
+Squeeze
+Mul
+Mul
+ReduceMax
+Scan
+Shape
+Constant
+Gather
+Constant
+Squeeze
+Constant
+Range
+Unsqueeze
+Unsqueeze
+Less
+Reshape
+Shape
+Slice
+Constant
+Concat
+Reshape
+Compress
+Gather
+Gather
+Squeeze
+Squeeze
+Gather
+Gather
+Gather
+Gather
+Concat
+Concat
+Slice
+Squeeze
+ReduceMax
+Scan
+Shape
+Constant
+Gather
+Constant
+Squeeze
+Constant
+Range
+Unsqueeze
+Unsqueeze
+Less
+Reshape
+Shape
+Slice
+Constant
+Concat
+Reshape
+Compress
+Constant
+CumSum
+Constant
+Constant
+Pad
+LayerNormalization
+Transpose
+MatMul
+Add
+Split
+Reshape
+Reshape
+Unsqueeze
+Unsqueeze
+Split
+Split
+Mul
+Mul
+Sub
+Mul
+Mul
+Add
+Concat
+Mul
+Mul
+Sub
+Mul
+Mul
+Add
+Concat
+Reshape
+Reshape
+Shape
+Squeeze
+Constant
+Constant
+Range
+Unsqueeze
+Unsqueeze
+GreaterOrEqual
+Cast
+ReduceSum
+Constant
+Sub
+Unsqueeze
+Unsqueeze
+Equal
+CastLike
+CastLike
+Where
+Unsqueeze
+Unsqueeze
+Unsqueeze
+Unsqueeze
+Attention
+Squeeze
+Transpose
+MatMul
+Add
+Add
+LayerNormalization
+Transpose
+MatMul
+Add
+Gelu
+Transpose
+MatMul
+Add
+Add
+Reshape
+LayerNormalization
+Transpose
+MatMul
+Add
+Gelu
+Transpose
+MatMul
+Add
+LayerNormalization
+Transpose
+MatMul
+Add
+Split
+Reshape
+Reshape
+Unsqueeze
+Unsqueeze
+Split
+Split
+Mul
+Mul
+Sub
+Mul
+Mul
+Add
+Concat
+Mul
+Mul
+Sub
+Mul
+Mul
+Add
+Concat
+Reshape
+Reshape
+Shape
+Squeeze
+Constant
+Constant
+Range
+Unsqueeze
+Unsqueeze
+GreaterOrEqual
+Cast
+ReduceSum
+Constant
+Sub
+Unsqueeze
+Unsqueeze
+Equal
+CastLike
+CastLike
+Where
+Unsqueeze
+Unsqueeze
+Unsqueeze
+Unsqueeze
+Attention
+Squeeze
+Transpose
+MatMul
+Add
+Add
+LayerNormalization
+Transpose
+MatMul
+Add
+Gelu
+Transpose
+MatMul
+Add
+Add
+LayerNormalization
+Reshape
+Transpose
+MatMul
+Add
+Gelu
+Transpose
+MatMul
+Add

Added nodes:

  • + Reshape
  • + Conv
  • + Reshape
  • + Slice
  • + Squeeze
  • + Slice
  • + Squeeze
  • + Slice
  • + Squeeze
  • + Mul
  • + Mul
  • + ReduceMax
  • + Scan
  • + Shape
  • + Constant
  • + Gather
  • + Constant
  • + Squeeze
  • + Constant
  • + Range
  • + Unsqueeze
  • + Unsqueeze
  • + Less
  • + Reshape
  • + Shape
  • + Slice
  • + Constant
  • + Concat
  • + Reshape
  • + Compress
  • + Add
  • + Slice
  • + Squeeze
  • + Slice
  • + Squeeze
  • + Slice
  • + Squeeze
  • + Mul
  • + Mul
  • + ReduceMax
  • + Scan
  • + Shape
  • + Constant
  • + Gather
  • + Constant
  • + Squeeze
  • + Constant
  • + Range
  • + Unsqueeze
  • + Unsqueeze
  • + Less
  • + Reshape
  • + Shape
  • + Slice
  • + Constant
  • + Concat
  • + Reshape
  • + Compress
  • + Gather
  • + Gather
  • + Squeeze
  • + Squeeze
  • + Gather
  • + Gather
  • + Gather
  • + Gather
  • + Concat
  • + Concat
  • + Slice
  • + Squeeze
  • + ReduceMax
  • + Scan
  • + Shape
  • + Constant
  • + Gather
  • + Constant
  • + Squeeze
  • + Constant
  • + Range
  • + Unsqueeze
  • + Unsqueeze
  • + Less
  • + Reshape
  • + Shape
  • + Slice
  • + Constant
  • + Concat
  • + Reshape
  • + Compress
  • + Constant
  • + CumSum
  • + Constant
  • + Constant
  • + Pad
  • + LayerNormalization
  • + Transpose
  • + MatMul
  • + Add
  • + Split
  • + Reshape
  • + Reshape
  • + Unsqueeze
  • + Unsqueeze
  • + Split
  • + Split
  • + Mul
  • + Mul
  • + Sub
  • + Mul
  • + Mul
  • + Add
  • + Concat
  • + Mul
  • + Mul
  • + Sub
  • + Mul
  • + Mul
  • + Add
  • + Concat
  • + Reshape
  • + Reshape
  • + Shape
  • + Squeeze
  • + Constant
  • + Constant
  • + Range
  • + Unsqueeze
  • + Unsqueeze
  • + GreaterOrEqual
  • + Cast
  • + ReduceSum
  • + Constant
  • + Sub
  • + Unsqueeze
  • + Unsqueeze
  • + Equal
  • + CastLike
  • + CastLike
  • + Where
  • + Unsqueeze
  • + Unsqueeze
  • + Unsqueeze
  • + Unsqueeze
  • + Attention
  • + Squeeze
  • + Transpose
  • + MatMul
  • + Add
  • + Add
  • + LayerNormalization
  • + Transpose
  • + MatMul
  • + Add
  • + Gelu
  • + Transpose
  • + MatMul
  • + Add
  • + Add
  • + Reshape
  • + LayerNormalization
  • + Transpose
  • + MatMul
  • + Add
  • + Gelu
  • + Transpose
  • + MatMul
  • + Add
  • + LayerNormalization
  • + Transpose
  • + MatMul
  • + Add
  • + Split
  • + Reshape
  • + Reshape
  • + Unsqueeze
  • + Unsqueeze
  • + Split
  • + Split
  • + Mul
  • + Mul
  • + Sub
  • + Mul
  • + Mul
  • + Add
  • + Concat
  • + Mul
  • + Mul
  • + Sub
  • + Mul
  • + Mul
  • + Add
  • + Concat
  • + Reshape
  • + Reshape
  • + Shape
  • + Squeeze
  • + Constant
  • + Constant
  • + Range
  • + Unsqueeze
  • + Unsqueeze
  • + GreaterOrEqual
  • + Cast
  • + ReduceSum
  • + Constant
  • + Sub
  • + Unsqueeze
  • + Unsqueeze
  • + Equal
  • + CastLike
  • + CastLike
  • + Where
  • + Unsqueeze
  • + Unsqueeze
  • + Unsqueeze
  • + Unsqueeze
  • + Attention
  • + Squeeze
  • + Transpose
  • + MatMul
  • + Add
  • + Add
  • + LayerNormalization
  • + Transpose
  • + MatMul
  • + Add
  • + Gelu
  • + Transpose
  • + MatMul
  • + Add
  • + Add
  • + LayerNormalization
  • + Reshape
  • + Transpose
  • + MatMul
  • + Add
  • + Gelu
  • + Transpose
  • + MatMul
  • + Add

Interface changes:

  • input count 0 → 2; output count 0 → 1

Initializer changes:

  • initializer count 0 → 55

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

justinchuby and others added 2 commits April 23, 2026 22:42
…coder

Future-proof component naming to distinguish encoders from future
decoders (e.g. audio_decoder for TTS models).

Package keys: vision → vision_encoder, audio → audio_encoder.
On-disk layout: vision/ → vision_encoder/, audio/ → audio_encoder/.
genai_config JSON sections remain 'vision' and 'audio' (ORT GenAI
runtime convention).

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
The any_to_any example serves a different documentation purpose than
vlm/ — it demonstrates the full multimodal pipeline (vision + audio +
text) vs vision-language only. Keep both even if the generated config
is identical today.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>

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

Copilot reviewed 36 out of 37 changed files in this pull request and generated 9 comments.

Comment thread src/mobius/tasks/_speech_language.py Resolved
Comment thread examples/qwen25_vl_ort_genai.py Resolved
Comment thread examples/gemma4/ort_genai/README.md Resolved
Comment thread examples/phi4mm_multimodal.py Resolved
Comment thread examples/phi4mm_ort_genai.py Resolved
Comment thread examples/gemma4/ort_genai/README.md Resolved
Comment thread tests/phi4mm_integration_test.py Resolved
Comment thread tests/e2e_golden_test.py Resolved
justinchuby and others added 3 commits April 23, 2026 23:27
…or naming

- pkg['model'] → pkg['decoder'] in phi4mm examples and tests
- Update SpeechLanguageTask docstring to use audio_encoder
- Update Gemma4 README to nested layout (vision_encoder/, audio_encoder/)
- processor_config.json → image_processor.json in Qwen VL example
- Derive decoder filename from key, not is_vlm (fixes audio-only packages)

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
The ORT GenAI runtime expects the audio model section to be named
'speech' in genai_config.json. Keep ModelPackage key as
'audio_encoder' (internal) but write 'speech' to the JSON output.

Also merge from main.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
@justinchuby
justinchuby force-pushed the justinchu/standardize-components branch from b75480a to aba182f Compare April 25, 2026 02:59
@justinchuby
justinchuby merged commit 65d0ea4 into main Apr 25, 2026
17 of 21 checks passed
@justinchuby
justinchuby deleted the justinchu/standardize-components branch April 25, 2026 03:04
justinchuby added a commit that referenced this pull request Apr 27, 2026
## Summary

Fix integration test failures in `tests/integration_test.py` and add
CUDA device support via `MOBIUS_TEST_DEVICE` env var.

## Changes

### Key Fixes
- **ModelPackage key rename** (PR #205 follow-up): Update `"vision"` →
`"vision_encoder"` in 5 test assertions and 2 print statements
- **ViT weight name mapping** (`vit.py`): Fix DINOv2 (`fc1`/`fc2`,
`norm1`/`norm2`), BeiT (`pooler.layernorm`), and SAM (`lin1`/`lin2`)
weight mappings

### Test Skips (with reasons)
- **HF transformers incompatibilities**: phi3.5-mini (DynamicCache
removed), qwen35_deltanet (Qwen3_5DynamicCache import)
- **Missing packages**: phi-tiny-moe (flash_attn), QwenImageVAE
(diffusers via importorskip)
- **Unavailable models**: wav2vec2-base, hubert-base (404 no
safetensors)
- **Unsupported features**: DINOv2/BeiT (layer_scale), SAM (4D
SkipLayerNorm), bloom (weight tying), qwen3_next (CausalConvWithState
custom op), gemma4 bf16 (mixed types)
- **Too slow**: qwen-moe-2.7b (>300s timeout)
- **Encoder issues**: roberta-base (position offset; dedicated test
exists), albert-base (embedding_size≠hidden_size)

### CUDA Device Support
- Added `_get_test_device()` helper reading `MOBIUS_TEST_DEVICE` env var
- Updated `TestForwardNumerical`, `TestGreedyGeneration`,
`TestEncoderOnlyForward`, and `TestVisionForward` to pass device to
`OnnxModelSession`

## Testing
- `build_graph_test.py`: 1182 passed, 40 skipped ✅
- `src/` unit tests: 1397 passed ✅  
- Lint: clean ✅
- Integration fast tests: 58 passed, 22 skipped (previously 14 failed)

---------

Signed-off-by: Justin Chu <[email protected]>
Signed-off-by: Justin Chu <[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