-
Notifications
You must be signed in to change notification settings - Fork 75
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
[Wait for #2849] [ Context ] Add Engine Class to manage Contexts #2848
base: main
Are you sure you want to change the base?
Conversation
This PR add ComputeEngine Enum Property. Enum elements are "cpu", "gpu", "qnn" for now. The property format is "engine=qnn". **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon <[email protected]>
996fa4f
to
af1b279
Compare
9d38a3a
to
a2e6707
Compare
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 PR implements Engine and Context class to support multiple compute engines. I have some comments and a question on this PR below.
createLayerObject(const std::string &type, | ||
const std::vector<std::string> &properties = {}) const { | ||
auto ct = getRegisteredContext(parseComputeEngine(properties)); | ||
ct->getName(); |
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 line (L132) seems redundant. The return value is not used.
@@ -37,6 +37,7 @@ | |||
#include <common_properties.h> | |||
#include <compiler_fwd.h> | |||
#include <dynamic_training_optimization.h> | |||
#include <engine.h> |
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.
Please remove #include <app_contxt.h>
as well.
nntrainer/nntrainer/models/neuralnet.h
Line 36 in 24a868d
#include <app_context.h> |
if (!(options & LayerCreateSetPropertyOptions::AVAILABLE_FROM_APP_CONTEXT)) { | ||
ac.registerFactory<nntrainer::Layer>(std::get<0>(GetParam())); | ||
ac->registerFactory<nntrainer::Layer>(std::get<0>(GetParam())); |
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.
I have a question.
In this PR, createOptimizerObject
is implemented as an interface for engine, but registerFactory
is not.
I guess registerFactory
can also be an another common function used in various contexts; in this sense, it might be better to be implemented in Context
class and called at the Engine
according to its property. By doing so, only the engine header will be explosed to the outside. Could you share your idea on this? I couldn't catch what is the standard allowing to access via engine.
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.
yes. it should be. this should be done in later PR. I will leave the todo comments.
25d5cc9
to
dbbde82
Compare
In order to extend the Context more easily, this PR adds Engine Class to manage the Contexts. It adds Context Class as well which is base class of all the Context. . add Engine Class . add Context Class . set default Context is app contexts . Pluggable support in Engine . some more code optimization & test codes requires. **Self evaluation:** 1. Build test: [X]Passed [ ]Failed [ ]Skipped 2. Run test: [X]Passed [ ]Failed [ ]Skipped Signed-off-by: jijoong.moon <[email protected]>
dbbde82
to
89a624e
Compare
Add Engine and Context Class
In order to extend the Context more easily, this PR adds Engine Class
to manage the Contexts. It adds Context Class as well which is base
class of all the Context.
. add Engine Class
. add Context Class
. set default Context is app contexts
. Pluggable support in Engine
. some more code optimization & test codes requires.
Self evaluation:
Signed-off-by: jijoong.moon [email protected]