microsoft / microsoft/winml-cli
marian + m2m_100 / translation: 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 Marian (Helsinki-NLP opus-mt) and M2M-100 (facebook/nllb) translation models fail during ONNX export due to EncoderDecoderCache being an unsupported TorchScript type — the same root cause as the T5 and BART issues.
Eval Results (2026-03-11)
| Status | Model | Task | Error |
|---|---|---|---|
| FAIL | Helsinki-NLP/opus-mt-nl-en | translation | EncoderDecoderCache unsupported JIT input |
| FAIL | Helsinki-NLP/opus-mt-en-ru | translation | same |
| FAIL | Helsinki-NLP/opus-mt-fr-en | translation | same |
| FAIL | Helsinki-NLP/opus-mt-tr-en | translation | same |
| FAIL | Helsinki-NLP/opus-mt-es-en | translation | same |
| FAIL | facebook/nllb-200-distilled-600M | translation | same |
6/6 models fail — 0 pass.
Error: Only tuples, lists and Variables are supported as JIT inputs/outputs. Here, received an input of unsupported type: EncoderDecoderCache
Root Cause
Same as T5/BART: recent transformers EncoderDecoderCache type is not serializable by TorchScript. Marian (MarianMTModel) is an encoder-decoder seq2seq model.
Current State
- No
marian.pymodel config inmodelkit/models/hf/ - Relies on Optimum default export, which does not bypass
EncoderDecoderCache facebook/nllb-200-distilled-600Musesm2m_100model_type — same issue
Desired State
All 6 translation models above pass wmk perf.
Acceptance Criteria
- All 6 models listed above pass
wmk perf - Fix is universal — no hardcoded model names (CLAUDE.md Cardinal Rule #1)
-
uv run pytest tests/passes (CLAUDE.md Cardinal Rule #3) - Eval re-run confirms 6/6 pass
Technical Notes
- If a shared encoder-decoder ONNX config fix is implemented for T5/BART, it should automatically cover marian and m2m_100 as well
- Marian model_type:
marian; NLLB model_type:m2m_100 - Both use
MarianMTModel/M2M100ForConditionalGeneration— both are seq2seq with decoder cache - Fix: register ONNX config overrides or patch export to set
use_cache=Falsefor all encoder-decoder models universally
Related Files
modelkit/models/hf/bert.py— pattern for ONNX config registrationmodelkit/export/io.py—register_onnx_overwrite()eval_results/2026-03-11/models/Helsinki-NLP__opus-mt-nl-en__translation/result.jsoneval_results/2026-03-11/models/facebook__nllb-200-distilled-600M__translation/result.json
References
- CLAUDE.md Cardinal Rule #1: No hardcoded model type strings
- CLAUDE.md Cardinal Rule #3: Run
uv run pytest tests/after implementation - Related: T5 issue, BART issue (same root cause — coordinate fix)
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/export/io.py and the ONNX configuration pattern in modelkit/models/hf/bert.py, then compare the related T5 and BART fixes. Reproduce the failures with the listed Marian and NLLB models using wmk perf, and inspect the referenced result.json files. Done means all six models pass, the fix is universal rather than model-name-specific, and uv run pytest tests/ passes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100