Skip to content

[DO NOT MERGE] Copy of #2717 - #2726

Draft
Xiaoyu Z (xiaoyu-work) wants to merge 16 commits into
mainfrom
feature/openvino-model-package
Draft

Xiaoyu Z (xiaoyu-work) wants to merge 16 commits into
mainfrom
feature/openvino-model-package

Conversation

@xiaoyu-work

@xiaoyu-work Xiaoyu Z (xiaoyu-work) commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Describe your changes

Exact, destination-owned copy of the latest #2717 for independent tracking. Do not merge this draft. Upstream commits were copied without implementation edits, merges, or cherry-picks.

  • Source: preetha-intel/Olive:feature/openvino-model-package
  • Destination: microsoft/Olive:feature/openvino-model-package
  • Base: main
  • Preserved head: d4b86dee727c04e42ee705c16d1737706ba2e2b0

The copied change extends EPContextBinaryGenerator with OpenVINO AOT/JIT compilation and introduces the EP-agnostic ORTModelPackage pass. The latter uses ONNX Runtime's ModelPackage authoring API (ORT >= 1.32) to assemble precompiled EPContext variants and shared assets into .ortpackage outputs. The latest source also includes automatic OpenVINO plugin registration, normalized device selection, EPContext option handling, and failed-compilation cleanup.

An earlier synchronization replaced divergent copied history using an explicitly approved --force-with-lease, checking the previous destination head 9bc198eff22a2dcd4308278f4ac236b4a65e77ac. This refresh uses a normal fast-forward. The original PR remains unchanged.

Copy verification: All four commands below passed and resolved to the preserved head:

git rev-parse --verify "refs/heads/feature/openvino-model-package"
git rev-parse --verify "refs/remotes/origin/feature/openvino-model-package"
git ls-remote --heads "https://github.com/preetha-intel/Olive.git" "refs/heads/feature/openvino-model-package"
git ls-remote --heads origin "refs/heads/feature/openvino-model-package"

Unit tests, model execution, and lintrunner -a were not run for this copy-only synchronization; the upstream implementation has not been revalidated. The existing dirty worktree was left on main without checking out the copied branch or modifying its files.

Release note: Add EP-agnostic ONNX Runtime model-package assembly and OpenVINO EPContext compilation through EPContextBinaryGenerator.

Checklist before requesting a review

  • Add unit tests for this change.
  • Make sure all tests can pass.
  • Update documents if necessary.
  • Lint and apply fixes to your code by running lintrunner -a
  • Is this a user-facing change? If yes, give a description of this change to be included in the release notes.

(Optional) Issue link

Original PR: #2717

@xiaoyu-work
Xiaoyu Z (xiaoyu-work) force-pushed the feature/openvino-model-package branch from 9bc198e to 579e7e1 Compare November 4, 2026 21:54
- Register onnxruntime-ep-openvino automatically in maybe_register_ep_libraries when
  no library path is configured.
- Lower the plugin-EP ORT floor to 1.23; require 1.30 only for ep.enable_weightless and
  call ModelCompiler.set_ep_context_binary_information only when the binding exists.
- Select OrtEpDevices by the accelerator's device type and compare device ids
  numerically (case, 0x prefix, leading zeros, integers); reject malformed ids.
- Validate the compiled output (EPContext nodes present, referenced binaries exist) and
  remove the partial output of a failed attempt so the output path can be retried.
- Move the model-package doc under docs/source, add ORTModelPackage to the pass
  reference and add an openvino-ep install extra.
- Fix lint findings in the new tests.
fix CI build errors
EPContextBinaryGenerator:
- Type compile_flow as Literal["aot", "jit"]; reject jit with
  model_compiler_options before registering the plugin
- Accept integer enum values for model_compiler_options and validate
  bool/int options strictly via pydantic TypeAdapter
- Move the virtual NPU preference out of the generic _select_ep_device
  into an OpenVINO prefer_ep_devices hook that logs when it fires
- Keep device_id with npu_platform in per-target device filters
- Require the metadata key to exist when matching ep_device_filters
- Record ep_device_filters and provider_options on target_devices
  components and the composite, matching the single-target path

ORTModelPackage:
- Normalize session_options to string values as ORT requires at load
- Add provider_options, written to executor_info.ort.provider_options
- Treat a missing EPContext embed_mode as embedded (schema default 1)
- Raise a clear error for an invalid variant_name_template
- Prefer a public get_compatibility_info_from_model when available

Port the #2732 tests for incomplete output cleanup, existing-output
refusal, option parsing and plugin discovery, and update the docs.

This branch has not been deployed

No deployments
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.

2 participants