-
Notifications
You must be signed in to change notification settings - Fork 63
Kanvi/remove additional attr check #150
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
Conversation
Make ngraph_backend mandatory, so the user using ngraph-optimizer can only specify backend using the rewriter config
Make all other config attributes optional Remove backend_config files Fix tests accordingly
Co-Authored-By: Sayantan Sarkar <sayantan.sarkar@intel.com>
…om/tensorflow/ngraph-bridge into kanvi/remove_additional_attr_check
shresthamalik
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.
Left few minor comments. Otherwise LGTM 👍
| // For e.g. _ngraph_ice_cores --> ice_cores | ||
| if (itx.first.find("_ngraph_") != std::string::npos) { | ||
| // find the index of the second '_' | ||
| int delimiter_index = itx.first.find('_', 6); |
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.
minor you dont need the delimiter
itx.first.substr(strlen("ngraph")) should give you the attribute name, and you get rid of the hardcoded 6
| if (i.first == "device_id") { | ||
| config_map["ngraph_" + i.first] = i.second.s(); | ||
| } else { | ||
| config_map["_ngraph_" + i.first] = i.second.s(); |
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.
config_map[(i.first == "device_id" ? "" : "_") + "ngraph_" + i.first] = i.second.s();
sayantan-nervana
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. waiting for final review comments to be incorporated and CI.
…om/tensorflow/ngraph-bridge into kanvi/remove_additional_attr_check
Grappler to use rewriter config only. backend manager and env variable based backend setting is going to be deprecated for grappler. ngraph_backend & device_id are 2 mandatory fields, other extra params are optional. update_config has been modified to accept these new params
Make ngraph_backend & device_id as a mandatory attribute to be supplied using rewriter_config.
Make all other backend related attributes optional.
All attributes thhat will have 'ngraph' appended will be passed to the specified backend and it is upto the backend to do the checks for the one's it expects.
Remove ngraph_backend_config class as it is no longer required. We can now use common Split and Join functions for all backends.
When using the grappler, rewriter_config is the only way to specify backend, env variable and backend manager will not work. Hence, removed code for the same from ngraph_optimizer.cc
Fix tests.