Skip to content

Conversation

@sindhu-nervana
Copy link
Contributor

@sindhu-nervana sindhu-nervana commented Dec 18, 2019

This PR fixes static build and static linking with recent ngraph core level changes

@sindhu-nervana sindhu-nervana added the wip Work in progress label Dec 19, 2019
@kanvi-nervana kanvi-nervana mentioned this pull request Dec 19, 2019
@sindhu-nervana sindhu-nervana removed the wip Work in progress label Dec 19, 2019
// Map with all the backends, and what the boolean is_supported should be
std::map<std::string, bool> backend_map{
{"CPU", true}, {"INTERPRETER", true}, {"NOP", false}};
std::map<std::string, bool> backend_map{{"CPU", true}, {"INTERPRETER", true}};
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed NOP case here because we do not have static library available for this backend, so we cannot register NOP with static builds - so this test will fail.

#include "ngraph_bridge/ngraph_builder.h"
#include "ngraph_bridge/ngraph_pipelined_tensors.h"
#include "ngraph_bridge/ngraph_utils.h"
#include "ngraph_bridge/version.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not required anymore

return -1;
}

// Register backends for static linking
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Register backends for static linking
// Register cpu backend for static linking

return -1;
}

// Register backends for static linking
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Register backends for static linking
// Register cpu backend for static linking

sindhu-nervana and others added 3 commits December 19, 2019 16:29
- Enabled --var build to use parallel executor integrating weights-on-device and data pipelining
- moved ngraph_var files outside the var build
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

#if defined(NGRAPH_BRIDGE_STATIC_LIB_ENABLE)
ngraph_register_cpu_backend();
#endif

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now we create only CPU backend here, hence the ifdef is only for CPU. But suggestions for future is we can query the backend we are trying to set/create and register just that backend if NGRAPH_BRIDGE_STATIC_LIB_ENABLE is enabled

return -1;
}

// Register cpu backend for static linking
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need to register here, since we have a registration in create backend?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah it was failing otherwise because we are using set backend here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: Revisit this to see if we can remove registering here and register only in BackendManager.

}

// Register cpu backend for static linking
#if defined(NGRAPH_BRIDGE_STATIC_LIB_ENABLE)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment

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.

LGTM

@kanvi-nervana kanvi-nervana added the ready to merge This PR is the next in the queue. label Dec 31, 2019
@sayantan-nervana sayantan-nervana merged commit d85e9bc into master Dec 31, 2019
@sayantan-nervana sayantan-nervana deleted the sindhu/static_build branch December 31, 2019 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fully reviewed ready to merge This PR is the next in the queue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants