-
Notifications
You must be signed in to change notification settings - Fork 57
CVS-167480 : Report import failure error code #715
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
base: ovep-develop
Are you sure you want to change the base?
Conversation
7dbe8e9 to
faf1a6e
Compare
MayureshV1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@javier-intel .. DO we have a way to trigger compatibility failure and ensure exception triggered by elf loader and UMD is caught here?
MayureshV1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM !
c75e346 to
64bcdad
Compare
|
@javier-intel can you please rebase this branch so I can merge it in. Mayuresh has already approved. |
|
Why has this not been merged yet ? @javier-intel ? |
|
@MayureshV1 please merge PR if you are approving ..You must have permissions |
|
@sfatimar I think it flew under the radar. It's a simple change but will probably need careful rebase as it's been some time since it was implemented. This week as I'll be busy with traveling so either I do it next week or someone from your team picks it up. |
c3dc39d to
93a6e38
Compare
|
@MayureshV1 can you please review again? I just built, haven't tested :( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces proper error handling for OpenVINO model import failures by creating typed exceptions that can communicate specific error codes back to the ONNX Runtime core, particularly for invalid binary errors during context model imports.
- Enhanced exception handling with a new typed exception system that preserves error codes
- Modified OvExceptionBoundary to support typed exceptions for model import operations
- Added fallback logic for NPU compilation failures with better error reporting
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| exceptions.h | New exception class with error code parsing and Status conversion |
| ov_interface.cc | Updated exception boundary template and ImportModel to use typed exceptions |
| openvino_execution_provider.cc | Added exception handling wrapper in Compile method |
| backend_manager.cc | Enhanced NPU fallback logic with typed exception handling |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
MayureshV1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backend Manager.cc has CPU fallback flow for NPU compile failure scenario. This logic was moved to basic_backedn.cc and needs to be adapted.
5778e4f to
49fe713
Compare
Per MayureshV1's review comment, the NPU->CPU fallback logic was moved to basic_backend.cc in PR #723. This commit removes the duplicate implementation from backend_manager.cc constructor to avoid conflicts and maintain single responsibility.
1e8d394 to
3ca0979
Compare
Fixed. We are ready to merge now |
javier-intel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small change
| } | ||
|
|
||
| std::string error_message = "Unhandled exception type: " + std::to_string(static_cast<int>(type_)); | ||
| return {category_ort, common::FAIL, error_message}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change FAIL to common::EP_FAIL
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // Newer drivers | ||
| if ((type_ == type::import_model) && | ||
| (error_code_ == 0x7800000f /* ZE_RESULT_ERROR_INVALID_NATIVE_BINARY */)) { | ||
| std::string message{error_name_ + ", code 0x" + std::to_string(error_code_) + "\nModel needs to be recompiled\n"}; |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using std::to_string() on a hexadecimal value converts it to decimal. Use a hex formatting approach (e.g., std::format or a stringstream with hex manipulator) to preserve the hexadecimal representation of error_code_.
| return func(); | ||
| } catch (const ov::Exception& e) { | ||
| ORT_THROW(log_tag + std::vformat(fmt.get(), std::make_format_args(args...)) + ": " + std::string(e.what())); | ||
| const auto message = log_tag + (args + ...) + ": " + std::string(e.what()); |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fold expression (args + ...) requires all args to be string-like types. If any argument is not a string, this will fail to compile. Consider using string concatenation with explicit conversions or std::format as in the original implementation.
| }, | ||
| " Cannot access IE Blob for input number: {}", index); |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The format string and argument are passed but no longer used in the new implementation of OvExceptionBoundary. These arguments should be removed or the function signature needs to be updated to accept formatted messages.
| }, | ||
| " Cannot set Remote Blob for output: {}", name); |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to Comment 4: the format string and argument are passed but not utilized by the updated OvExceptionBoundary function.
| OvExceptionBoundary<false>([&]() { | ||
| ovInfReq.infer(); | ||
| }, | ||
| "In Error Couldn't start Inference"); |
Copilot
AI
Nov 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message string is passed but not used by the new OvExceptionBoundary implementation.
| "In Error Couldn't start Inference"); | |
| " In Error Couldn't start Inference"); |
Description
Report invalid binary when context model can't be imported by OV
Motivation and Context
Correctly communicate to ORT core the failure to import EpCtx
https://jira.devtools.intel.com/browse/CVS-167480