Skip to content

Add Qwen3.6-35B-A3B (Qwen3.5-MoE-VL) support with Olive INT4 example - #313

Merged
justinchuby merged 5 commits into
mainfrom
qwen3_6-35b-a3b-vlm-support
May 27, 2026
Merged

justinchuby merged 5 commits into
mainfrom
qwen3_6-35b-a3b-vlm-support

Conversation

@justinchuby

Copy link
Copy Markdown
Member

Qwen3.6-35B-A3B is the vision-language variant of Qwen3.5-MoE. The HF
config reports model_type=qwen3_5_moe with both text_config and
vision_config; mobius dispatches it to a new qwen3_5_moe_vl
registry entry that composes the existing Qwen35MoETextModel
backbone with the Qwen3-VL ViT + InputMixer (same pipeline as the
dense Qwen3.5-VL Qwen35VL3ModelCausalLMModel).

Changes

  • Model: Qwen35MoEVLDecoderModel + Qwen35MoEVL3ModelCausalLMModel
    in src/mobius/models/qwen35.py. Extended Qwen35MoETextModel.forward
    to accept inputs_embeds for VL decoding. preprocess_weights
    unpacks HF's fused experts.{gate_up,down}_proj tensors into
    per-expert names (HF stores [E, 2*inter, H] / [E, H, inter]).
  • Dispatch: _builder.py overrides model_type to
    qwen3_5_moe_vl when the composite config has a vision_config;
    text-only Qwen3.5-MoE still resolves to qwen3_5_moe.
  • Registry: new qwen3_5_moe_vl entry with task hybrid-qwen-vl.
  • L1: tiny config + checker skip entry — build_graph_test.py passes.
  • L4/L5: golden case + HF reference outputs for
    Qwen/Qwen3.6-35B-A3B (top-1 token=760 ""The"", 24-token generation
    captured).
  • Example: examples/qwen3_6_35b_a3b_ort_genai.py runs ORT GenAI
    inference and supports --quantize {Q4_K_M,NF4} via Olive.

Test status

  • ✅ L1 build_graph_test for qwen3_5_moe_vl
  • ✅ L2 arch_validation
  • ✅ Real-weight build (131GB f32 decoder at /tmp/qwen3_6-onnx)
  • ✅ HF golden generation
  • ⏳ L4/L5 against built ONNX (in progress)
  • ⏳ Olive Q4_K_M quantization (running)

Follow-ups

  • bf16 + cuda EP builds + L4/L5 verification on quantized output
  • Upload to HuggingFace

Qwen3.6-35B-A3B is the vision-language variant of Qwen3.5-MoE. The HF
config reports model_type=qwen3_5_moe with text_config + vision_config;
mobius dispatches it to a new qwen3_5_moe_vl entry that composes the
existing Qwen35MoETextModel backbone with the Qwen3-VL ViT + InputMixer
(same pipeline as the dense Qwen3.5-VL).

Changes:
- New Qwen35MoEVLDecoderModel and Qwen35MoEVL3ModelCausalLMModel in
  src/mobius/models/qwen35.py, mirroring Qwen35VL3ModelCausalLMModel but
  swapping the text backbone for the MoE variant. Extended
  Qwen35MoETextModel.forward to accept inputs_embeds for VL decoding.
  preprocess_weights unpacks HF's fused experts.{gate_up,down}_proj
  [E, ...] tensors into per-expert names.
- Registry entry qwen3_5_moe_vl -> Qwen35MoEVL3ModelCausalLMModel; the
  builder overrides model_type to qwen3_5_moe_vl when the composite
  config has a vision_config.
- L1 tiny config + checker skip entry.
- L4/L5 golden case + reference outputs (HF-generated).
- examples/qwen3_6_35b_a3b_ort_genai.py: ORT GenAI inference example
  with --quantize {Q4_K_M,NF4} flag that runs Olive on the decoder.

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

github-actions Bot commented May 20, 2026 •

Copy link
Copy Markdown

Performance Comparison

Comparing 5d592c6 → 5baaa24

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 413 413 +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 May 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 37.73585% with 66 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/mobius/models/qwen35.py 41.26% 37 Missing ⚠️
src/mobius/_testing/ort_inference.py 34.14% 23 Missing and 4 partials ⚠️
src/mobius/_builder.py 0.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@github-actions

github-actions Bot commented May 20, 2026 •

Copy link
Copy Markdown

🏗️ Architecture Diff

Comparing 5d592c6 → 5baaa24

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_encoder 0 ⚪
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 238 🟡
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_encoder 0 ⚪
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 ⚪
qwen3_5_moe (hybrid-text-generation) / model — 238 change(s)

Op summary: 275 → 275 nodes

--- base
+++ head
@@ -91,54 +91,54 @@
 MatMul
 Constant
 Equal
-Cast
-Mul
-ReduceSum
-Mul
-Transpose
-MatMul
-Sigmoid
-Mul
-Transpose
-MatMul
-Mul
-Transpose
-MatMul
-Constant
-Equal
-Cast
-Mul
-ReduceSum
-Mul
-Add
-Transpose
-MatMul
-Sigmoid
-Mul
-Transpose
-MatMul
-Mul
-Transpose
-MatMul
-Constant
-Equal
-Cast
-Mul
-ReduceSum
-Mul
-Add
-Transpose
-MatMul
-Sigmoid
-Mul
-Transpose
-MatMul
-Mul
-Transpose
-MatMul
-Constant
-Equal
-Cast
+CastLike
+Mul
+ReduceSum
+Mul
+Transpose
+MatMul
+Sigmoid
+Mul
+Transpose
+MatMul
+Mul
+Transpose
+MatMul
+Constant
+Equal
+CastLike
+Mul
+ReduceSum
+Mul
+Add
+Transpose
+MatMul
+Sigmoid
+Mul
+Transpose
+MatMul
+Mul
+Transpose
+MatMul
+Constant
+Equal
+CastLike
+Mul
+ReduceSum
+Mul
+Add
+Transpose
+MatMul
+Sigmoid
+Mul
+Transpose
+MatMul
+Mul
+Transpose
+MatMul
+Constant
+Equal
+CastLike
 Mul
 ReduceSum
 Mul
@@ -202,74 +202,74 @@
 MatMul
 Constant
 Equal
-Cast
-Mul
-ReduceSum
-Mul
-Transpose
-MatMul
-Sigmoid
-Mul
-Transpose
-MatMul
-Mul
-Transpose
-MatMul
-Constant
-Equal
-Cast
-Mul
-ReduceSum
-Mul
-Add
-Transpose
-MatMul
-Sigmoid
-Mul
-Transpose
-MatMul
-Mul
-Transpose
-MatMul
-Constant
-Equal
-Cast
-Mul
-ReduceSum
-Mul
-Add
-Transpose
-MatMul
-Sigmoid
-Mul
-Transpose
-MatMul
-Mul
-Transpose
-MatMul
-Constant
-Equal
-Cast
-Mul
-ReduceSum
-Mul
-Add
-Transpose
-MatMul
-Sigmoid
-Mul
-Transpose
-MatMul
-Mul
-Transpose
-MatMul
-Transpose
-MatMul
-Sigmoid
-Mul
-Add
-Add
-Add
-RMSNormalization
-Transpose
-MatMul
+CastLike
+Mul
+ReduceSum
+Mul
+Transpose
+MatMul
+Sigmoid
+Mul
+Transpose
+MatMul
+Mul
+Transpose
+MatMul
+Constant
+Equal
+CastLike
+Mul
+ReduceSum
+Mul
+Add
+Transpose
+MatMul
+Sigmoid
+Mul
+Transpose
+MatMul
+Mul
+Transpose
+MatMul
+Constant
+Equal
+CastLike
+Mul
+ReduceSum
+Mul
+Add
+Transpose
+MatMul
+Sigmoid
+Mul
+Transpose
+MatMul
+Mul
+Transpose
+MatMul
+Constant
+Equal
+CastLike
+Mul
+ReduceSum
+Mul
+Add
+Transpose
+MatMul
+Sigmoid
+Mul
+Transpose
+MatMul
+Mul
+Transpose
+MatMul
+Transpose
+MatMul
+Sigmoid
+Mul
+Add
+Add
+Add
+RMSNormalization
+Transpose
+MatMul

Added nodes:

  • + CastLike
  • + Mul
  • + ReduceSum
  • + Mul
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Transpose
  • + MatMul
  • + Mul
  • + Transpose
  • + MatMul
  • + Constant
  • + Equal
  • + CastLike
  • + Mul
  • + ReduceSum
  • + Mul
  • + Add
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Transpose
  • + MatMul
  • + Mul
  • + Transpose
  • + MatMul
  • + Constant
  • + Equal
  • + CastLike
  • + Mul
  • + ReduceSum
  • + Mul
  • + Add
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Transpose
  • + MatMul
  • + Mul
  • + Transpose
  • + MatMul
  • + Constant
  • + Equal
  • + CastLike
  • + CastLike
  • + Mul
  • + ReduceSum
  • + Mul
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Transpose
  • + MatMul
  • + Mul
  • + Transpose
  • + MatMul
  • + Constant
  • + Equal
  • + CastLike
  • + Mul
  • + ReduceSum
  • + Mul
  • + Add
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Transpose
  • + MatMul
  • + Mul
  • + Transpose
  • + MatMul
  • + Constant
  • + Equal
  • + CastLike
  • + Mul
  • + ReduceSum
  • + Mul
  • + Add
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Transpose
  • + MatMul
  • + Mul
  • + Transpose
  • + MatMul
  • + Constant
  • + Equal
  • + CastLike
  • + Mul
  • + ReduceSum
  • + Mul
  • + Add
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Transpose
  • + MatMul
  • + Mul
  • + Transpose
  • + MatMul
  • + Transpose
  • + MatMul
  • + Sigmoid
  • + Mul
  • + Add
  • + Add
  • + Add
  • + RMSNormalization
  • + Transpose
  • + MatMul

Removed nodes:

  • - Cast
  • - Mul
  • - ReduceSum
  • - Mul
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Transpose
  • - MatMul
  • - Mul
  • - Transpose
  • - MatMul
  • - Constant
  • - Equal
  • - Cast
  • - Mul
  • - ReduceSum
  • - Mul
  • - Add
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Transpose
  • - MatMul
  • - Mul
  • - Transpose
  • - MatMul
  • - Constant
  • - Equal
  • - Cast
  • - Mul
  • - ReduceSum
  • - Mul
  • - Add
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Transpose
  • - MatMul
  • - Mul
  • - Transpose
  • - MatMul
  • - Constant
  • - Equal
  • - Cast
  • - Cast
  • - Mul
  • - ReduceSum
  • - Mul
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Transpose
  • - MatMul
  • - Mul
  • - Transpose
  • - MatMul
  • - Constant
  • - Equal
  • - Cast
  • - Mul
  • - ReduceSum
  • - Mul
  • - Add
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Transpose
  • - MatMul
  • - Mul
  • - Transpose
  • - MatMul
  • - Constant
  • - Equal
  • - Cast
  • - Mul
  • - ReduceSum
  • - Mul
  • - Add
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Transpose
  • - MatMul
  • - Mul
  • - Transpose
  • - MatMul
  • - Constant
  • - Equal
  • - Cast
  • - Mul
  • - ReduceSum
  • - Mul
  • - Add
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Transpose
  • - MatMul
  • - Mul
  • - Transpose
  • - MatMul
  • - Transpose
  • - MatMul
  • - Sigmoid
  • - Mul
  • - Add
  • - Add
  • - Add
  • - RMSNormalization
  • - Transpose
  • - MatMul

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

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

Adds support for the Qwen3.6-35B-A3B (Qwen3.5-MoE-VL) vision-language family to mobius by introducing a dedicated registry entry that builds a 3-model split (decoder/vision_encoder/embedding) and by adding golden test artifacts plus an ORT GenAI + Olive INT4 example script.

Changes:

  • Added qwen3_5_moe_vl registry dispatch (via _builder.py model_type override for composite configs with vision_config) and wired it to a new MoE-VL 3-model module implementation.
  • Extended the Qwen3.5-MoE text backbone to support inputs_embeds for VL decoding and implemented MoE-VL weight routing/unpacking for the 3-model split.
  • Added L1 tiny config coverage and L4/L5 golden case + generation outputs, plus a standalone example for ORT GenAI inference and optional Olive INT4 quantization.

Reviewed changes

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

Show a summary per file
File Description
tests/build_graph_test.py Adds qwen3_5_moe_vl to the build-graph test model set.
tests/_test_configs.py Introduces a tiny qwen3_5_moe_vl config for fast graph construction tests.
testdata/golden/vision-language/qwen3_6-35b-a3b.json Adds golden top-k logits + input_ids for Qwen3.6-35B-A3B.
testdata/golden/vision-language/qwen3_6-35b-a3b_generation.json Adds golden generation tokens/text for Qwen3.6-35B-A3B.
testdata/cases/vision-language/qwen3_6-35b-a3b.yaml Adds an L4+L5 test case definition (CI-skipped due to size).
src/mobius/models/qwen35.py Adds MoE-VL decoder + 3-model split module; extends MoE text model to accept inputs_embeds; adds MoE fused-expert unpacking for the 3-model path.
src/mobius/models/init.py Exports the new Qwen35MoEVL3ModelCausalLMModel.
src/mobius/_registry.py Registers qwen3_5_moe_vl and maps it to the hybrid VL task and a default model id.
src/mobius/_builder.py Overrides model_type to qwen3_5_moe_vl when model_type=qwen3_5_moe and vision_config is present on the composite config.
examples/qwen3_6_35b_a3b_ort_genai.py Adds ORT GenAI/ORT-session inference example with optional Olive INT4 quantization workflow.

Comment thread src/mobius/models/qwen35.py Outdated
Comment on lines +636 to +637
if "lm_head.weight" not in renamed and "model.embed_tokens.weight" in renamed:
renamed["lm_head.weight"] = renamed["model.embed_tokens.weight"]

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — confirmed unreachable. Qwen35MoEVLDecoderModel is constructed only as a sub-module of Qwen35MoEVL3ModelCausalLMModel (line ~667) and never registered standalone, so this preprocess_weights was dead code, hiding both bugs you flagged (the un-stripped key check, and the missing fused MoE expert unpack). Dropped the whole method in 5baaa24 with a comment explaining the routing lives on the wrapper.

Comment on lines +23 to +29
Requirements::

pip install mobius-ai[ort-genai]
# For INT4 quantization (Olive from source recommended):
pip install -e /path/to/Olive cupy-cuda12x

Usage::

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, ort-genai extras didn't include Pillow but the example scripts import PIL.Image for --image. Fixed in 5baaa24 by adding Pillow to the ort-genai extras (matches what testing extras already do).

Comment thread src/mobius/models/qwen35.py Outdated
Comment on lines +619 to +635
def preprocess_weights(
self, state_dict: dict[str, torch.Tensor]
) -> dict[str, torch.Tensor]:
"""Route language_model weights for standalone decoder build."""
renamed: dict[str, torch.Tensor] = {}
for key, value in state_dict.items():
if key.startswith(("mtp_", "mtp.")):
continue
stripped = key
if stripped.startswith("model."):
stripped = stripped[len("model.") :]
if stripped.startswith("visual."):
continue
if stripped.startswith("language_model."):
stripped = stripped[len("language_model.") :]
renamed[stripped] = value
if self.config.tie_word_embeddings:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch — confirmed unreachable. Qwen35MoEVLDecoderModel is constructed only as a sub-module of Qwen35MoEVL3ModelCausalLMModel (line ~667) and never registered standalone, so this preprocess_weights was dead code, hiding both bugs you flagged (the un-stripped key check, and the missing fused MoE expert unpack). Dropped the whole method in 5baaa24 with a comment explaining the routing lives on the wrapper.

OnnxKQuantQuantization renames the decoder's logits output to
logits_Q4. Aliasing it back in _run_session keeps the generation
loop unchanged across quantized and unquantized models.

Verified end-to-end on Qwen3.6-35B-A3B Q4_K_M (21GB decoder): output
matches the HF bf16 golden token-for-token for the first 12 tokens.

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

Copy link
Copy Markdown
Member Author

Verification update

✅ Olive Q4_K_M quantization — decoder shrank from 128 GB (f32) to 21 GB; quantization ran in 17 minutes (CPU, k-quant block_size=32).

✅ L5 smoke test — assembled /tmp/qwen3_6-onnx-Q4_K_M/ with quantized decoder + f32 embedding/vision_encoder + tokenizer, ran the example script with the cat-chonk image:

Prompt: Describe this image in one short sentence.
Output: The user wants a short sentence describing the image.\n\n1

Identical token-for-token to the first 12 tokens of the HF bf16 golden reference (testdata/golden/vision-language/qwen3_6-35b-a3b_generation.json).

🔧 Fix included: Olive's OnnxKQuantQuantization renames logits → logits_Q4 in the decoder output. _run_session now aliases it back so the same generation loop works for both quantized and unquantized models (commit bfb3bfc).

Still TODO (out of this PR's scope)

  • CUDA EP build (--ep cuda)
  • bf16 build variant
  • Upload to HuggingFace Hub

justinchuby and others added 2 commits May 20, 2026 23:38
Qwen35MoEBlock.forward used op.Cast(match, to=1) (FLOAT) for the
expert-selection mask, which causes a type mismatch when the model
is built in bf16 or f16: routing_weights is bf16/f16 but match_float
becomes f32, breaking the subsequent Mul.

Switch to op.CastLike(match, routing_weights) so the mask dtype
follows the routing-weight dtype, matching the pattern used in the
shared MoELayer component.

Co-authored-by: Copilot <[email protected]>
Signed-off-by: Justin Chu <[email protected]>
Switch the qwen3_6-35b-a3b test case to dtype=float16 (the dtype that
the CUDA EP can actually run for LinearAttention/CausalConvWithState),
regenerate the HF golden in fp16 to match, and propagate the decoder's
declared input dtype through the e2e VL prefill+generation harness so
inputs_embeds and image_features are always cast to whatever the model
expects.

- testdata/cases/.../qwen3_6-35b-a3b.yaml: bfloat16 -> float16
- scripts/generate_golden.py: pass case.dtype through to HF loader
- src/mobius/_testing/ort_inference.py: handle bf16 / ml_dtypes both for
  feeds (via ortvalue_from_numpy_with_onnx_type) and outputs (via
  dlpack + torch + ml_dtypes view). Add get_input_dtype().
- tests/e2e_golden_test.py: cast inputs_embeds, image_features and
  empty KV cache to the decoder/embedding session's declared dtypes.

L4 + L5 pass on CUDA with the fp16 build of Qwen3.6-35B-A3B.

Signed-off-by: justinchuby <[email protected]>
Comment thread tests/e2e_golden_test.py Resolved
…eights

1) Add Pillow to the ort-genai optional-dependencies extra. The
   examples/qwen3_6_35b_a3b_ort_genai.py and other multimodal example
   scripts import PIL.Image, but the doc says
   'pip install mobius-ai[ort-genai]' which previously installed only
   onnxruntime-genai. Without this users hit ModuleNotFoundError when
   running --image.

2) Remove Qwen35MoEVLDecoderModel.preprocess_weights. The method was
   unreachable: this class is only ever constructed as a sub-module of
   Qwen35MoEVL3ModelCausalLMModel and is not registered standalone, so
   the wrapper's preprocess_weights does all weight routing
   (prefix-strip + MoE expert unpack + tied lm_head). The removed
   method also had two latent bugs (tie_word_embeddings checked for
   the un-stripped key 'model.embed_tokens.weight' that never exists
   post-strip; fused MoE expert tensors were not unpacked into
   per-expert ONNX initializers). Rather than fix dead code, drop it
   and document why the class has no preprocess_weights.

Signed-off-by: justinchuby <[email protected]>
@justinchuby
justinchuby merged commit 32cbe86 into main May 27, 2026
18 of 21 checks passed
@justinchuby
justinchuby deleted the qwen3_6-35b-a3b-vlm-support branch May 27, 2026 03:59
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