-
Notifications
You must be signed in to change notification settings - Fork 154
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
Add possibility to add graph optimization level to session options #1268
base: main
Are you sure you want to change the base?
Add possibility to add graph optimization level to session options #1268
Conversation
@microsoft-github-policy-service agree |
@@ -62,6 +62,19 @@ struct ProviderOptionsArray_Element : JSON::Element { | |||
ProviderOptionsObject_Element object_{v_}; | |||
}; | |||
|
|||
GraphOptimizationLevel getGraphOptimizationLevel(std::string_view name) { |
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.
To keep in style with the casing used in other methods within this file:
GraphOptimizationLevel getGraphOptimizationLevel(std::string_view name) { | |
GraphOptimizationLevel GetGraphOptimizationLevel(std::string_view name) { |
Thanks for your contribution! A PR was recently merged that should fix the Hugging Face authentication errors. Can you merge main into your branch to resolve those CI errors? |
@benHeid the changes look good. Could you please address @kunal-vaishnavi's comment and the lint errors? We can merge this in then. |
} else if (name == "ORT_ENABLE_ALL") { | ||
return ORT_ENABLE_ALL; | ||
} else | ||
throw JSON::unknown_value_error{}; |
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.
throw JSON::unknown_value_error{}; | |
throw std::runtime_error("Unrecognized value:" + name); |
This exception isn't what you want, it's to say that the value name is unknown (it'll say "graph_optimization_level" is not recognized). The value name is recognized, but it's being set to an unrecognized value. This should be more useful.
This PR adds the option to set the graph optimization level when running a model.
See discussion in #1260 (reply in thread)
(Disclaimer: I am not very familiar with cpp, so any hints for improving my changes are very very welcome)