microsoft / microsoft/winml-cli
Add end-to-end guided workflow command for winml config
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 40
- Forks
- 11
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 50
Description
Summary
Add a single winml flow <model> command that runs the full model preparation pipeline as an interactive, step-by-step guided workflow — completing each stage, showing a summary, then prompting the user to continue or skip.
Motivation
Currently, preparing a model for WinML deployment requires users to know and chain 6–8 separate commands in the correct order (inspect, export, analyze, optimize, quantize, compile, perf, eval). This creates a steep learning curve for new users and forces experienced users to manually orchestrate the pipeline.
A single guided command lowers the barrier to entry, surfaces the recommended workflow explicitly, and eliminates the need to remember inter-command dependencies or flag syntax.
Proposed Solution
Command signature
# HuggingFace model (full pipeline incl. export)
winml flow ProsusAI/finbert
# Local ONNX file (export step skipped; flow adapts to model format)
winml flow ./model.onnx
winml flow ./build/finbert/
Interactive pipeline UX
Each step runs to completion, prints a summary block, then pauses:
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Step 2 / 7 — analyze
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✔ Operators: 48 / 48 supported on QNN
⚠ Warnings: 2 (see details below)
✘ Blocking: 0
[Enter] Continue to optimize [s] Skip [q] Quit
Two input paths
| Input | Pipeline steps |
|---|---|
| HuggingFace model ID | inspect → export → analyze → optimize → quantize → compile → perf → eval |
| ONNX file / directory | inspect → analyze → optimize → quantize → compile → perf → eval |
ONNX-aware step suggestions
When the input is an ONNX file, flow inspects the model format and skips or adjusts steps that are not applicable:
- Already-quantized (QDQ) model → skip
quantize, warn that re-quantization may degrade accuracy - Already-compiled EP artifact → skip
optimize/compile, jump toperf/eval - FP16 model → suggest quantize to INT8 for NPU targets
Non-interactive / CI mode
winml flow ProsusAI/finbert --yes # auto-continue all steps
winml flow model.onnx --skip quantize,eval # skip specific steps
winml flow model.onnx --steps analyze,perf # run only selected steps
Acceptance Criteria
-
winml flow <huggingface_model_id>runs the full HF pipeline interactively -
winml flow <path_to_onnx>runs the ONNX pipeline, adapting steps to model format - Each step prints a structured summary before prompting
- Prompt supports
[Enter](continue),[s](skip),[q](quit) -
--yesflag runs all steps non-interactively (CI-friendly) -
--skip <step,...>allows excluding specific steps -
--steps <step,...>allows running only selected steps - Already-processed ONNX inputs (QDQ, compiled) are detected and steps adjusted with user-visible rationale
- New command module
src/winml/modelkit/commands/flow.pyfollowing existingLazyGroupconventions - Unit tests cover step sequencing, skip logic, and ONNX format detection
Alternatives Considered
winml buildextension:buildis scoped to HuggingFace export; conflating it with the full pipeline would bloat the command and break its single-responsibility contract.- Notebook / tutorial: Good for learning but not a repeatable CLI workflow.
Additional Context
Related existing commands that flow would orchestrate:
inspect, export, analyze, optimize, quantize, compile, perf, eval
The command module system uses LazyGroup (see cli.py) — flow.py should follow the same lazy-import pattern.
Multi-surface opportunity: The recommended flow is not exclusive to the CLI. The foundryTK Template UI is another natural surface for exposing this guided pipeline — a visual step-by-step wizard in the Template UI could mirror the same inspect → export → analyze → optimize → quantize → compile → perf → eval progression, making the workflow accessible to users who prefer a graphical experience over the command line.
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 by reading the existing command modules and cli.py, focusing on the LazyGroup conventions and the inspect, export, analyze, optimize, quantize, compile, perf, and eval entry points. Add src/winml/modelkit/commands/flow.py and tests covering step sequencing, skip logic, and ONNX format detection; done means both input paths, interactive prompts, and the --yes, --skip, and --steps modes meet the acceptance criteria.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, machine-learning
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100