Draft
Conversation
…used by model package workflow
Contributor
|
Top-level manifest.json should define the overall inputs/outputs so a user of the package knows what it does. They shouldn't have to trawl through the information to find the first and last things that will be run to infer this info. |
skottmckay
reviewed
Mar 23, 2026
Comment on lines
+114
to
+122
| { | ||
| "variant_name": "variant_1", | ||
| "file": "mul_1.onnx", | ||
| "constraints": { | ||
| "ep": "example_ep", | ||
| "device": "cpu", | ||
| "architecture": "arch1" | ||
| } | ||
| }, |
Contributor
There was a problem hiding this comment.
This seems like lower level per-variant info I would have expected to be in the component model's metadata.json not the top level manifest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
To support the model package design, one of the goals for ORT is to automatically select the most suitable compiled EPContext binary from a collection of precompiled variants based on the EP, provider options, metadata, and available devices.
This PR is for ORT to support first phase model package. There could be other follow-up PRs in the future.
A model package is a collection of models, binaries, and metadata files organized in a hierarchically structured directory.
The directory structure is not yet finalized, so the following is just a simple example of a model package directory:
A manifest.json should reside in the top-level of the model package directory and describing the components of the package.
Following is an example of a manifest.json:
Check the unit test here to better understand how to use model package.
This pull request introduces significant enhancements to the execution provider (EP) selection and management infrastructure in ONNX Runtime. The main focus is on supporting more sophisticated device selection and manifest-based model packaging, as well as refactoring provider selection logic for modularity and future extensibility.
Key changes include:
The most important changes are:
Model Package Context and Manifest Support
model_package_context.handmodel_package_context.ccto implement manifest parsing, device/EP constraint matching, and component selection logic for model packages. This enables ONNX Runtime to select the most appropriate model variant based on available hardware and EP configuration. [1] [2]Execution Provider Interface Enhancements
IExecutionProviderclass to support construction with a list ofOrtEpDevicepointers, and added aGetEpDevices()method to retrieve the supported devices. This allows plugin and bridge EPs to expose multiple devices. [1] [2]Provider Policy Context Refactoring
SelectEpsForSessioninto smaller methods:OrderDevices,SelectEpDevices,LogTelemetry,CreateExecutionProviders,RegisterExecutionProviders, and a new flow for model package-based EP selection. [1] [2] [3] [4]These changes collectively lay the groundwork for more flexible, robust, and extensible device and EP selection in ONNX Runtime, especially in scenarios involving packaged models with multiple variants and complex hardware environments.
Motivation and Context