Skip to content

BUG Report: Qwen3.5-9B Olive Text Model Conversion Failure #2446

@suki-lqh

Description

@suki-lqh

Describe the bug
When running the optimize.py script in the olive-recipes/Qwen-Qwen3.5-9B/builtin directory to process the text.json configuration, a NotImplementedError is triggered during the ModelBuilder pass phase, with the message "The Qwen/Qwen3.5-9B model is not currently supported". However, the conversion of the embedding and vision modules in the same directory runs successfully.
To Reproduce

  1. Clone the microsoft/olive-recipes repository and navigate to the Qwen-Qwen3.5-9B/builtin directory.
  2. Set up a Python virtual environment and install the required dependencies (see the Other information section below for the full dependency list).
  3. Modify the code in optimize.py: change config["model"]["decoder"]["session_options"] = session_options to config["model"]["decoder"]["session_options"] = vision_session_options.
  4. Execute theoptimize.py script to trigger the model conversion process corresponding totext.json.
  5. A NotImplementedError is thrown during the ModelBuilder pass phase, resulting in conversion failure.
    Expected behavior
    Successfully convert the Qwen/Qwen3.5-9B model to int4 quantized ONNX format via Olive without errors, and generate ONNX files usable for AMD processors (output to the output_dir specified in the configuration).
    Olive config
    Take cpu_and_mobile/text.json as an example (the logic of other configurations such as cuda/webgpu is consistent):
    {
    "input_model": {
    "type": "HfModel",
    "model_path": "Qwen/Qwen3.5-9B"
    },
    "passes": {
    "m": {
    "type": "ModelBuilder",
    "precision": "int4",
    "int4_accuracy_level": 4,
    "extra_options": {
    "filename": "text.onnx",
    "quant_mode": "int4",
    "prune_lm_head": true
    }
    },
    "t": {
    "type": "GraphSurgeries",
    "surgeries": [{"surgeon": "TieWordEmbeddings"}]
    }
    },
    "no_artifacts": true,
    "output_dir": "cpu_and_mobile/models/text.onnx"
    }
    Olive logs
    [2026-05-07 14:25:34,321] [INFO] [engine.py:665:_run_pass] Running pass m:modelbuilder
    2026-05-07 14:25:35,210 httpx [INFO] - HTTP Request: HEAD https://hf-mirror.com/Qwen/Qwen3.5-9B/resolve/main/config.json "HTTP/1.1 307 Temporary Redirect"
    2026-05-07 14:25:35,355 httpx [INFO] - HTTP Request: HEAD https://hf-mirror.com/api/resolve-cache/models/Qwen/Qwen3.5-9B/c202236235762e1c871ad0ccb60c8ee5ba337b9a/config.json "HTTP/1.1 200 OK"
    [2026-05-07 14:25:35,363] [ERROR] [engine.py:728:_run_pass] Pass run failed.
    Traceback (most recent call last):
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\engine\engine.py", line 716, in _run_pass
    output_model_config = host.run_pass(p, input_model_config, output_model_path)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\systems\local.py", line 45, in run_pass
    output_model = the_pass.run(model, output_model_path)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\passes\olive_pass.py", line 243, in run
    output_model = self._run_for_config(model, self.config, output_model_path)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\passes\onnx\model_builder.py", line 274, in _run_for_config
    create_model(
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\torch\utils_contextlib.py", line 124, in decorate_context
    return func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\onnxruntime_genai\models\builder.py", line 328, in create_model
    raise NotImplementedError(f"The {hf_name} model is not currently supported.")
    NotImplementedError: The Qwen/Qwen3.5-9B model is not currently supported.
    [2026-05-07 14:25:35,365] [WARNING] [engine.py:288:run_accelerator] Failed to run Olive on cpu-cpu.
    Traceback (most recent call last):
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\engine\engine.py", line 284, in run_accelerator
    self._run_no_search(input_model_config, input_model_id, accelerator_spec, artifacts_dir)
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\engine\engine.py", line 328, in _run_no_search
    should_prune, signal, model_ids = self._run_passes(input_model_config, input_model_id, accelerator_spec)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\engine\engine.py", line 621, in _run_passes
    model_config, model_id = self._run_pass(
    ^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\engine\engine.py", line 716, in _run_pass
    output_model_config = host.run_pass(p, input_model_config, output_model_path)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\systems\local.py", line 45, in run_pass
    output_model = the_pass.run(model, output_model_path)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\passes\olive_pass.py", line 243, in run
    output_model = self._run_for_config(model, self.config, output_model_path)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\olive\passes\onnx\model_builder.py", line 274, in _run_for_config
    create_model(
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\torch\utils_contextlib.py", line 124, in decorate_context
    return func(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^
    File "C:\Code\git\olive-recipes.venv\Lib\site-packages\onnxruntime_genai\models\builder.py", line 328, in create_model
    raise NotImplementedError(f"The {hf_name} model is not currently supported.")
    NotImplementedError: The Qwen/Qwen3.5-9B model is not currently supported.
    Other information
  • OS: Windows
  • Olive version: 0.11.0.dev0 (olive-ai 0.11.0.dev0)
  • ONNXRuntime package and version: onnxruntime 1.26.0, onnxruntime-genai 0.12.2
  • Transformers package version: 5.8.0
  • Full dependency list:
    Package Version

alembic 1.18.4
annotated-doc 0.0.4
annotated-types 0.7.0
anyio 4.13.0
certifi 2026.4.22
charset-normalizer 3.4.7
click 8.3.3
colorama 0.4.6
colorlog 6.10.1
filelock 3.29.0
flatbuffers 25.12.19
fsspec 2026.4.0
greenlet 3.5.0
h11 0.16.0
hf-xet 1.5.0
httpcore 1.0.9
httpx 0.28.1
huggingface_hub 1.14.0
idna 3.13
importlib_metadata 8.7.1
Jinja2 3.1.6
lightning-utilities 0.15.3
Mako 1.3.12
markdown-it-py 4.1.0
MarkupSafe 3.0.3
mdurl 0.1.2
ml_dtypes 0.5.4
mpmath 1.3.0
networkx 3.6.1
numpy 2.4.4
olive-ai 0.11.0.dev0
onnx 1.21.0
onnx-ir 0.2.1
onnxruntime 1.26.0
onnxruntime-genai 0.12.2
onnxscript 0.7.0
opentelemetry-api 1.41.1
opentelemetry-sdk 1.41.1
opentelemetry-semantic-conventions 0.62b1
optuna 4.8.0
packaging 26.2
pandas 3.0.2
pip 26.1.1
prompt_toolkit 3.0.52
protobuf 7.34.1
pydantic 2.13.4
pydantic_core 2.46.4
Pygments 2.20.0
python-dateutil 2.9.0.post0
PyYAML 6.0.3
questionary 2.1.1
regex 2026.4.4
requests 2.33.1
rich 15.0.0
safetensors 0.7.0
setuptools 81.0.0
shellingham 1.5.4
six 1.17.0
SQLAlchemy 2.0.49
sympy 1.14.0
tabulate 0.10.0
tokenizers 0.22.2
torch 2.10.0
torchmetrics 1.9.0
tqdm 4.67.3
transformers 5.8.0
typer 0.25.1
typing_extensions 4.15.0
typing-inspection 0.4.2
tzdata 2026.2
urllib3 2.6.3
wcwidth 0.7.0
zipp 3.23.1
Additional context

  1. Modifying session_options to vision_session_options in optimize.py is a temporary adjustment to adapt to AMD processors.
  2. The goal is to convert Qwen/Qwen3.5-9B to ONNX format and run it on AMD processors.
  3. The conversion processes of the embedding and vision modules in the Qwen-Qwen3.5-9B/builtin directory of the same repository can be executed successfully; only the text module triggers the "model unsupported" error.
  4. The root cause of the error is that the support check for the Qwen/Qwen3.5-9B model in onnxruntime_genai.models.builder.py fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions