-
Notifications
You must be signed in to change notification settings - Fork 47
[OVEP] Support for providing layout to input/output to OpenVINO #767
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
@@ -828,6 +828,8 @@ select from 'TF8', 'TF16', 'UINT8', 'FLOAT', 'ITENSOR'. \n)"); | |||
ov_options[key] = value; | |||
} else if (key == "reshape_input") { | |||
ov_options[key] = value; | |||
} else if (key == "layout") { | |||
ov_options[key] = value; |
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.
Should we then also update the THROW message?
ORT_THROW(
"[ERROR] [OpenVINO] wrong key type entered. Choose from the following runtime key options that are available for OpenVINO."
" ['device_type', 'device_id', 'num_of_threads', 'load_config', 'cache_dir', 'num_streams', "
"'enable_opencl_throttling', 'disable_dynamic_shapes', 'enable_qdq_optimizer',"
" 'enable_causallm', 'model_priority', 'layout'] \n");
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.
fixed
std::unordered_set<char> seen_alphabets; | ||
for (char c : layout_str) { | ||
if (std::isalpha(c)) { | ||
char upper_c = std::toupper(c); // Convert to uppercase for case-insensitive comparison |
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.
Hope this helps. The following error occurred during Windows build:
error C2220: the following warning is treated as an error [...\onnxruntime\build\Windows\Release\onnxruntime_providers_openvino.vcxproj] ...\onnxruntime\onnxruntime\core\providers\openvino\openvino_parser_utils.cc(297,20): warning C4244: 'initializing': conversion from 'int' to 'char', possible loss of data
This change helped me fix the issue:
char upper_c = static_cast<char>(std::toupper(c));
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.
fixed
@sfatimar, @preetha-intel hi! |
This PR introduces a new provider option that allows users to explicitly set the layout for model inputs and outputs
The layout can be configured using the following command-line format:
"N"
,"C"
,"H"
,"W"
, or use"?"
as a placeholder if the layout dimension is unknown.