-
Notifications
You must be signed in to change notification settings - Fork 319
Bug Bash - EP+Performance compile paths and fixes #634
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
b2136e8
a93a6c8
ae6b60b
9c21e19
df488b7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,11 +11,11 @@ This sample demonstrates how to use ONNX Runtime in a C++ desktop application, f | |
| ``` | ||
| CppConsoleDesktop.exe [options] | ||
| Options: | ||
| --ep_policy <policy> Set execution provider policy (NPU, CPU, GPU, DEFAULT, DISABLE). Default: DISABLE | ||
| --ep_policy <policy> Set execution provider policy (NPU, CPU, GPU, DEFAULT) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see that there's an open PR for addressing the issue w/ the DISABLE option: (#620). How would you all like to reconcile this? @mahabayana @yeelam-gordon
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @adrastogi @yeelam-gordon Scenario 1 : User explicitly passes DISABLE: The user runs --ep_policy DISABLE. The parser sets ep_policy = null and ep_name remains empty. Validation sees neither is set and throws: "Missing EP selection" - even though the user did specify a policy. Scenario 2 : User passes an invalid value (e.g., a typo): The user runs --ep_policy NPUU. The parser prints "Unknown EP policy: NPUU, using default (DISABLE)" and silently sets ep_policy = null. Validation again throws "Missing EP selection" : masking the real error (an invalid value) Thus I would propose this resolution
|
||
| --compile Compile the model | ||
| --download Download required packages | ||
| --model <path> Path to input ONNX model (default: SqueezeNet.onnx in executable directory) | ||
| --compiled_output <path> Path for compiled output model (default: SqueezeNet_ctx.onnx) | ||
| --compiled_output <path> Path for compiled output model (default: auto-generated with device info) | ||
| --image_path <path> Path to the input image (default: sample kitten image) | ||
| ``` | ||
|
|
||
|
|
@@ -68,7 +68,14 @@ for (const auto& [ep_name, devices] : ep_device_map) | |
|
|
||
| ### 2. Model Compilation | ||
|
|
||
| The sample shows how to compile an ONNX model for optimized execution: | ||
| The sample shows how to compile an ONNX model for optimized execution. Compiled model filenames | ||
| are automatically generated with device-specific identifiers to prevent collisions: | ||
|
|
||
| - Policy mode: `SqueezeNet_ctx_PREFER_GPU.onnx` | ||
| - Explicit EP: `SqueezeNet_ctx_DML_GPU.onnx` | ||
| - With perf mode: `SqueezeNet_ctx_PREFER_NPU_MaxPerformance.onnx` | ||
|
|
||
| Use `--compiled_output` to override with a custom path. | ||
|
|
||
| ```cpp | ||
| #include <win_onnxruntime_cxx_api.h> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.