microsoft / microsoft/winml-cli
qwen2 + qwen3 / text-generation: all models pass wmk perf
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40
- Forks
- 11
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 50
Description
Summary
All Qwen2 and Qwen3 text-generation models fail. Smaller models hit Error parsing message with type 'onnx.ModelProto' (protobuf 2GB limit), while larger models timeout. This blocks the entire Qwen LLM family.
Eval Results (2026-03-11)
| Status | Model | model_type | Error |
|---|---|---|---|
| FAIL | Qwen/Qwen2.5-0.5B-Instruct | qwen2 | Error parsing message with type 'onnx.ModelProto' |
| FAIL | Qwen/Qwen2.5-1.5B-Instruct | qwen2 | same |
| FAIL | Qwen/Qwen2.5-3B-Instruct | qwen2 | same / TIMEOUT |
| FAIL | Qwen/Qwen2.5-7B-Instruct | qwen2 | TIMEOUT (process crash, exit 3221225477) |
| FAIL | trl-internal-testing/tiny-Qwen2ForCausalLM-2.5 | qwen2 | Export completes; perf fails |
| FAIL | Qwen/Qwen3-0.6B | qwen3 | Error parsing message with type 'onnx.ModelProto' |
| FAIL | Qwen/Qwen3-1.7B | qwen3 | same |
| FAIL | Qwen/Qwen3-8B | qwen3 | TIMEOUT |
8/8 models fail — 0 pass.
Root Cause
- ONNX ModelProto size: LLMs generate ONNX graphs >2GB, hitting protobuf's message size limit. Requires external data format (
save_as_external_data=True). - Compilation/runtime crash:
Qwen2.5-7Bexits with code3221225477(Windows access violation / memory error) — likely OOM during compilation. - Tiny model perf failure:
tiny-Qwen2ForCausalLM-2.5export completes but perf fails — likely input generation issue fortext-generation(autoregressive models need different input handling).
Current State
- No
qwen2.pyorqwen3.pyinmodelkit/models/hf/ - No text-generation WinML inference class:
modelkit/models/winml/__init__.py:37mapstext-generation → WinMLModelForCausalLMbut this class is not implemented (falls back toWinMLModelForGenericTask) openai-community/gpt2also fails text-generation (gpt2model_type) with export completing but perf failing — same missing CausalLM inference class
Desired State
Qwen2 and Qwen3 models pass wmk perf for text-generation, at least for smaller sizes (0.5B–3B).
Acceptance Criteria
-
Qwen/Qwen2.5-0.5B-Instruct,Qwen2.5-1.5B-Instruct,Qwen2.5-3B-Instructpasswmk perf -
Qwen/Qwen3-0.6B,Qwen3-1.7Bpasswmk perf -
trl-internal-testing/tiny-Qwen2ForCausalLM-2.5passeswmk perf - External data format enabled for LLMs exceeding ONNX size threshold (CLAUDE.md Cardinal Rule #1 — size-based, not model-name-based)
-
WinMLModelForCausalLMinference wrapper implemented -
uv run pytest tests/passes (CLAUDE.md Cardinal Rule #3) - Eval re-run confirms ≥5/8 pass (7B+ size may remain gated by hardware memory)
Technical Notes
- ONNX size: Enable
use_external_data_format=Truefor large model exports — coordinate with xlm-roberta issue which has the same fix - CausalLM inference:
WinMLModelForCausalLMis mapped inTASK_TO_WINML_CLASSbut not implemented inmodelkit/models/winml/. Need to implement at minimum a greedy-decode single-pass wrapper - Input generation for text-generation: Autoregressive models need
input_ids+attention_mask— checkmodelkit/core/model_input_generator.pyfor correct handling - Large model OOM: 7B models may need memory-mapped loading or INT4 quantization path — out of scope for this issue unless hardware supports it
- Same
onnx.ModelProtoerror affects xlm-roberta and laion/CLIP-ViT-H-14 — a single shared fix for external data format covers all
Related Files
modelkit/models/winml/__init__.py:37—WinMLModelForCausalLMmapping (not implemented)modelkit/export/config.py—WinMLExportConfig— checkuse_external_data_formatfieldmodelkit/core/model_input_generator.py— input generationmodelkit/models/hf/bert.py— pattern for adding model-specific ONNX configeval_results/2026-03-11/models/— Qwen result.json files
References
- CLAUDE.md Cardinal Rule #1: No hardcoded model type strings — use size-based detection for external data format
- CLAUDE.md Cardinal Rule #3: Run
uv run pytest tests/after implementation
Contributor guide
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 with modelkit/models/winml/init.py, modelkit/export/config.py, and modelkit/core/model_input_generator.py to trace the text-generation mapping, external-data setting, and inputs. Compare model-specific export patterns in modelkit/models/hf/bert.py and run the existing tests before changing behavior. Done means the listed smaller Qwen models and tiny model pass wmk perf, with external data enabled by size and uv run pytest tests/ passing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning, testing-qa
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100