huggingface / huggingface/optimum-intel
Qwen3.6 (qwen3_5 / qwen3_5_moe) text-generation export blocked — only image-text-to-text task registered
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 621
- Forks
- 273
- Avg merge
- 4d 47m
- Merged PRs (30d)
- 25
Description
## Summary
Both `Qwen/Qwen3.6-35B-A3B` (MoE) and `Qwen/Qwen3.6-27B` (dense) are published by the Qwen team as unified VL variants with `architectures: ['Qwen3_5MoeForConditionalGeneration']` / `['Qwen3_5ForConditionalGeneration']`. There are no separate text-only releases.
The OpenVINO exporter on `main` (`1.27.0.dev0+d4dd21a` as of 2026-05-05) registers these parent architectures for `image-text-to-text` only, so attempting a text-generation export aborts:
```
$ optimum-cli export openvino \
--model Qwen/Qwen3.6-35B-A3B \
--task text-generation-with-past \
--weight-format int4 \
--group-size 64 \
--ratio 1.0 \
out/
ValueError: Asked to export a qwen3_5_moe model for the task text-generation-with-past,
but the Optimum OpenVINO exporter only supports the tasks image-text-to-text for qwen3_5_moe.
Please use a supported task. Please open an issue at https://github.com/huggingface/optimum-intel/issues
if you would like the task text-generation-with-past to be supported in the OpenVINO export for qwen3_5_moe.
```
Same error for `Qwen/Qwen3.6-27B` (`qwen3_5`).
## Repro
```bash
pip install \
"optimum-intel @ git+https://github.com/huggingface/optimum-intel.git@main" \
"transformers @ git+https://github.com/huggingface/transformers.git@main"
optimum-cli export openvino \
--model Qwen/Qwen3.6-27B \
--task text-generation-with-past \
--weight-format int4 \
out/
```
(transformers main is required separately — release < 5.7 doesn't recognize the `qwen3_5` / `qwen3_5_moe` model_types.)
## Root cause
`optimum/exporters/openvino/model_configs.py` has the registrations split:
- `qwen3_5_moe` (line ~6174) → `image-text-to-text` only — corresponds to the unified `*_ForConditionalGeneration` architecture HF publishes
- `qwen3_5_moe_text` (line ~6165) → `text-generation`, `text-generation-with-past` — works but only routable from inside the VL config's LANGUAGE behavior code path, not as an export entrypoint
- Same split for `qwen3_5` / `qwen3_5_text`
The text-only sub-configs do work: `Qwen3_5MoeOpenVINOConfig` already delegates to `qwen3_5_moe_text` via `get_vlm_text_generation_config` for the `LANGUAGE` behavior. So the conversion machinery is in place — only the entry-point routing is missing.
## Suggested fix
Add `text-generation` / `text-generation-with-past` to the `qwen3_5_moe` and `qwen3_5` task registrations. When the user requests text-generation, the exporter should route to `LANGUAGE` behavior (extract `text_config` from the unified config, run the text-only path).
Pattern would mirror the `gemma3` / `gemma-4` family which has `image-text-to-text` and `text-generation` both registered against the same parent architecture.
## Why it matters
These are widely-used Qwen models (~3M and ~1.5M HF downloads). Without the text-generation export route, OpenVINO users have to either:
- Custom-extract `model.language_model` and re-save as a text-only Qwen3_5MoeForCausalLM (several hours of careful work)
- Patch optimum-intel locally (fragile across pip upgrades)
- Wait
If a quick fix is welcome, I can put together a PR. Just wanted to log the issue so others hitting this aren't stuck guessing.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in optimum/exporters/openvino/model_configs.py around the qwen3_5 and qwen3_5_moe registrations, then compare the task routing used by the gemma3 and gemma-4 families. Add the text-generation task entry points so unified Qwen3.6 configurations use their LANGUAGE behavior, and verify that the provided optimum-cli text-generation-with-past export commands complete successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100