-
Notifications
You must be signed in to change notification settings - Fork 699
Enable calling into runtime from onnxifi #2300
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
Enable calling into runtime from onnxifi #2300
Conversation
lib/Onnxifi/Base.cpp
Outdated
@@ -22,17 +22,22 @@ | |||
|
|||
namespace glow { | |||
namespace onnxifi { | |||
namespace { | |||
const std::string inferenceFunctionName = "inference"; |
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.
Why is this std::string and not "const char*" ?
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.
No reason, I'll change this and the below std::string
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.
+1, those strings could cause SIOFs
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. I'd wait until HostManager lands and then merge.
As it's hard to do proper integration test in OSS, I'd like to see an integration test with host manager on fbcode side.
lib/Onnxifi/Base.cpp
Outdated
@@ -22,17 +22,22 @@ | |||
|
|||
namespace glow { | |||
namespace onnxifi { | |||
namespace { | |||
const std::string inferenceFunctionName = "inference"; |
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.
+1, those strings could cause SIOFs
bool use_onnx) | ||
: id_(id), use_onnx_(use_onnx), concurrency_(concurrency), | ||
executionEngine_(kind) {} | ||
bool useOnnx, bool useHostManager) |
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.
update doxygen with the useHostManager
.
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.
This looks good, It should allow us to run a test through onnxifi for the new runtime. Thanks!
lib/Onnxifi/Base.cpp
Outdated
@@ -146,26 +156,42 @@ void Graph::run( | |||
phs.push_back(var); | |||
} | |||
|
|||
auto ctx = std::make_unique<Context>(); |
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.
make this llvm::make_unique.
@bertmaher recently fixed bunch of places to make glow g++-4.8.5 compatible.
a911d58
to
61050d5
Compare
61050d5
to
0f5608b
Compare
Landing this now so we can keep moving with refactoring the onnxifi interface to get ready for full HostManager integration once it's ready. Will add integration tests once HostManager is ready. |
Description:
Enable calling into the Glow runtime from ONNXIFI through the HostManager.
This diff enables running onnxifi inference through HostManager once HostManager is implemented.
This diff is intended to get end-to-end support for the runtime working but there are many things that we cannot yet do such as multiple runs with the same Graph, running multiple onnxifi Graphs on the same onnxifi Backend, etc. To enable these things, some more larger refactoring steps will be needed in followups including 1. Moving all resources necessary for running graphs into BackendId, 2. Abstracting BackendId to enable separate implementations for HostManager and ExecutionEngine backed BackendIds (module is still always owned by ExecutionEngine no matter what), 3 move all graph state into the graph itself to enable running multiple times with different contexts, 4 move components necessary for compatibility check into runtime and separate the ExecutionEngine from the HostManager implementations.
Depends on #2284.
Testing:
ninja test
, CIDocumentation:
doxygen