Skip to content

qwen3.5-* models fail to load: genai_config.json contains patch_size field unsupported by bundled onnxruntime-genai (v1.4.3) #468

@jessehouwing

Description

@jessehouwing

Description

Attempting to load any qwen3.5-* model (e.g. qwen3.5-2b-cuda-gpu:2) fails immediately with a JSON parse error at model load time.

Expected Behavior

The model loads and responds to prompts successfully.

Actual Behavior

The model fails to load with:

Failed loading model qwen3.5-2b-cuda-gpu:2. Error encountered while parsing
'C:\Users\<user>\.aitk\models\Microsoft\qwen3.5-2b-cuda-gpu-2\v2\genai_config.json'
JSON Error: model:vision: Unknown value "patch_size" at line 68 index 23

Steps to Reproduce

  1. Install Foundry Toolkit v1.4.3
  2. Download any qwen3.5-* model from the model catalog
  3. Load the model in GitHub Copilot

Root Cause

The genai_config.json for qwen3.5 models contains a "patch_size": 16 field in the model.vision section:

"vision": {
  "filename": "vision.onnx",
  "config_filename": "processor_config.json",
  "spatial_merge_size": 2,
  "tokens_per_second": 2.0,
  "patch_size": 16,
  ...
}

The onnxruntime-genai version bundled with extension v1.4.3 does not recognize patch_size as a valid vision config field. The qwen3.5 model catalog entries were published targeting a newer runtime version than what ships with the current extension, causing a version mismatch.

Workaround

Remove the patch_size field from the downloaded model config:

$config = "$env:USERPROFILE\.aitk\models\Microsoft\qwen3.5-2b-cuda-gpu-2\v2\genai_config.json"
$json = Get-Content $config -Raw | ConvertFrom-Json
$json.model.vision.PSObject.Properties.Remove("patch_size")
$json | ConvertTo-Json -Depth 20 | Set-Content $config

Note: the path will differ depending on which qwen3.5 variant was downloaded.

Expected Fix

Either:

  • Update the bundled onnxruntime-genai in v1.4.x to support the patch_size field, or
  • Gate qwen3.5 model catalog entries so they are only shown for extension versions that support them

Specifications

  • Extension version: 1.4.3
  • VS Code version: 1.123.0
  • Platform: Windows x64

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs attentionThe issue needs contributor's attention

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions