Browse Source

!16043 fix If the frequency is not set on the NPU, the CompileGraph fails

From: @zhaozhenlong
Reviewed-by: @zhang_xue_tong,@zhanghaibo5
Signed-off-by: @zhang_xue_tong
pull/16043/MERGE
mindspore-ci-bot Gitee 5 years ago
parent
commit
ac5af72836
1 changed files with 7 additions and 2 deletions
  1. +7
    -2
      mindspore/lite/src/runtime/agent/npu/subgraph_npu_kernel.cc

+ 7
- 2
mindspore/lite/src/runtime/agent/npu/subgraph_npu_kernel.cc View File

@@ -206,8 +206,13 @@ int SubGraphNpuKernel::Init() {

MS_ASSERT(npu_manager_ != nullptr);

npu_manager_->AddModel(model_buffer_data, GetOMModelName(),
static_cast<const lite::InnerContext *>(context_)->GetNpuInfo().frequency_);
int frequency = static_cast<const lite::InnerContext *>(context_)->GetNpuInfo().frequency_;
if (frequency != hiai::AiModelDescription_Frequency_LOW && frequency != hiai::AiModelDescription_Frequency_MEDIUM &&
frequency != hiai::AiModelDescription_Frequency_HIGH &&
frequency != hiai::AiModelDescription_Frequency_EXTREME) {
frequency = hiai::AiModelDescription_Frequency_HIGH;
}
npu_manager_->AddModel(model_buffer_data, GetOMModelName(), frequency);

executor_ = new (std::nothrow) mindspore::lite::NPUExecutor(GetOMModelName(), npu_manager_);



Loading…
Cancel
Save