Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

jijoongmoon
Copy link
Collaborator

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]

Copy link
Contributor

@djeong20 djeong20 left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Member

@skykongkong8 skykongkong8 left a 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;
Copy link
Member

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];
}

Copy link
Contributor

@EunjuYang EunjuYang left a comment

Choose a reason for hiding this comment

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

LGTM ! 🚀

Copy link
Contributor

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

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

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]>
@jijoongmoon jijoongmoon closed this by deleting the head repository Dec 24, 2024
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.

5 participants