Skip to content

Conversation

@kanvi-nervana
Copy link
Contributor

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.

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
@kanvi-nervana kanvi-nervana added the wip Work in progress label Jul 23, 2019
@kanvi-nervana kanvi-nervana removed the wip Work in progress label Jul 24, 2019
Copy link
Contributor

@shresthamalik shresthamalik left a 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);
Copy link
Contributor

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();
Copy link
Contributor

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();

Copy link
Contributor

@sayantan-nervana sayantan-nervana left a 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.

@sayantan-nervana sayantan-nervana merged commit 3fa1df0 into master Jul 25, 2019
gopoka pushed a commit that referenced this pull request Oct 28, 2019
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
@ashahba ashahba deleted the kanvi/remove_additional_attr_check branch April 24, 2020 23:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants