Skip to content

Add Openvino support - #1461

Merged
Qiong Wu (qiowu) (DingmaomaoBJTU) merged 8 commits into
mainfrom
user/spalne/OpenVINO
Oct 10, 2026
Merged

Qiong Wu (qiowu) (DingmaomaoBJTU) merged 8 commits into
mainfrom
user/spalne/OpenVINO

Conversation

@spalne

@spalne Supreet Singh Palne (spalne) commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Adds OpenVINO NPU/GPU support for Qwen3 GenAI bundles and winml perf --runtime ort-genai.

  • Routes context/iterator stages to OpenVINO while keeping companion stages on CPU.
  • Applies shared OpenVINO NPU defaults automatically; custom provider settings use the existing repeatable --ep-options KEY=VALUE option (for example, --ep-options load_config='{"NPU":{"NPU_TURBO":"NO"}}'). Explicit nested values override matching defaults while unspecified defaults remain.
  • Includes effective provider options in EPContext cache identity.
  • Supports external weights and shared EPContexts without duplicating compatible weights.
  • Shows the generated response in the perf report and JSON.

Verified on Intel NPU with Qwen3-0.6B: correct answers, ~1.5 s load, ~45–53 tokens/sec.

winml-intel

@spalne
Supreet Singh Palne (spalne) marked this pull request as ready for review October 7, 2026 21:03
@spalne
Supreet Singh Palne (spalne) requested a review from a team as a code owner October 7, 2026 21:03
Comment thread tests/unit/session/test_genai_session.py Fixed
Comment thread src/winml/modelkit/session/genai_session.py Outdated
Comment thread src/winml/modelkit/commands/perf.py Outdated
Comment thread npu_config_npuw.json Outdated
Comment thread src/winml/modelkit/models/hf/qwen3/genai.py Outdated
Comment thread src/winml/modelkit/models/hf/qwen3/genai.py Outdated
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Comment thread src/winml/modelkit/models/hf/qwen3/genai.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@xieofxie
xieofxie requested a balanced review from Copilot October 9, 2026 07:47
Qiong Wu (qiowu) (DingmaomaoBJTU) added a commit that referenced this pull request Oct 9, 2026
Documents Intel OpenVINO NPU prerequisites, Qwen3 bundle build and perf
commands, pipeline stage placement, and optional runtime `--ep-options
load_config=...` usage. The options are passed to GenaiSession at
runtime; they are not embedded in the model-ID auto-build bundle.

Includes the minimal type annotation fix in
`src/winml/modelkit/export/value_range.py` required to pass the
repository's Mypy lint check.

Depends on #1461.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Shared sidecar paths can select incorrect weights, and the advertised OpenVINO configuration option is not implemented.

2 open findings
What changed in this PR

Adds OpenVINO NPU/GPU support to Qwen3 GenAI bundles and performance reporting.

Changes:

  • Adds OpenVINO routing, defaults, and provider-option overrides.
  • Handles external weights for shared OpenVINO EPContexts.
  • Includes generated responses in reports and JSON.
File Description
src/​winml/​modelkit/​session/​genai_session.py Adds provider overrides and shared-weight handling.
src/​winml/​modelkit/​session/​ep_device.py Catalogs OpenVINO defaults.
src/​winml/​modelkit/​models/​winml/​genai_bundle.py Forwards device and assembler options.
src/​winml/​modelkit/​models/​hf/​qwen3/​genai.py Adds OpenVINO Qwen3 routing.
src/​winml/​modelkit/​commands/​perf.py Forwards GenAI EP options.
src/​winml/​modelkit/​commands/​_perf_genai.py Reports generated responses.
src/​winml/​modelkit/​export/​value_range.py Improves typing annotations.
tests/​unit/​session/​test_genai_session.py Tests overrides and external weights.
tests/​unit/​session/​test_ep_device.py Tests OpenVINO defaults.
tests/​unit/​models/​winml/​test_genai_bundle_registry.py Tests registered OpenVINO targets.
tests/​unit/​models/​winml/​test_genai_bundle_orchestrator.py Tests device forwarding.
tests/​unit/​models/​qwen3/​test_genai_config.py Tests OpenVINO pipeline configuration.
tests/​unit/​commands/​test_perf_genai.py Tests options and response reporting.
tests/​unit/​commands/​test_build_genai_bundle.py Tests OpenVINO GPU builds.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/winml/modelkit/session/genai_session.py
Comment thread src/winml/modelkit/commands/perf.py
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
# Conflicts:
#	src/winml/modelkit/export/value_range.py
@DingmaomaoBJTU
Qiong Wu (qiowu) (DingmaomaoBJTU) merged commit 33d2500 into main Oct 10, 2026
10 checks passed
@DingmaomaoBJTU
Qiong Wu (qiowu) (DingmaomaoBJTU) deleted the user/spalne/OpenVINO branch October 10, 2026 01:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants