-
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
Add ComputeEngine Property for choosing Engine #2827
Conversation
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!
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.
Almost first official stepping stone for supporting QNN as compute engine on the nntrainer! Great!
} | ||
} | ||
|
||
return ml::train::LayerComputeEngine::CPU; |
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.
If this function is called frequently and may affect the latency, you may use:
if (key[0] == 'q')
return QNN;
if (key[0] == 'g')
return GPU;
return CPU;
If you want a generalized code (wtih a bit of inefficiency), use EnumStr
for (i = 0; i < arraysize(EnumStr); i++) {
if (istrequal(key, EnumStr[i])
return EnumList[i];
}
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 ! 🚀
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.
It seems tflite unittests face some failures. I guess you need to update node_exporter.h
as well.
nntrainer/nntrainer/utils/node_exporter.h
Lines 246 to 253 in 712f6c3
template <> | |
void Exporter::saveTflResult( | |
const std::tuple<props::Name, props::Distribute, props::Trainable, | |
std::vector<props::InputConnection>, | |
std::vector<props::InputShape>, props::SharedFrom, | |
props::ClipGradByGlobalNorm, props::Packed, | |
props::LossScaleForMixed> &props, | |
const LayerNode *self); |
ea672dd
to
1ab9671
Compare
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]>
1ab9671
to
1a6e1ff
Compare
This PR add ComputeEngine Enum Property.
Enum elements are "cpu", "gpu", "qnn" for now.
The property format is "engine=qnn".
Self evaluation:
Signed-off-by: jijoong.moon [email protected]