Browse Source

!13093 Enable tbe dynamic shape op for run op

From: @HulkTang
Reviewed-by: @zhoufeng54,@jjfeing
Signed-off-by: @jjfeing
tags/v1.2.0-rc1
mindspore-ci-bot Gitee 4 years ago
parent
commit
fb31e724aa
2 changed files with 3 additions and 3 deletions
  1. +1
    -1
      mindspore/ccsrc/backend/session/ascend_session.cc
  2. +2
    -2
      mindspore/ccsrc/runtime/device/kernel_runtime.cc

+ 1
- 1
mindspore/ccsrc/backend/session/ascend_session.cc View File

@@ -911,7 +911,7 @@ void AscendSession::BuildDynamicKernel(const std::shared_ptr<KernelGraph> &kerne
MS_EXCEPTION_IF_NULL(kernel_graph);
const auto &kernels = kernel_graph->execution_order();
auto iter = std::find_if(kernels.begin(), kernels.end(), [](const CNodePtr &kernel) {
return AnfAlgo::GetKernelType(kernel) == AICPU_KERNEL && AnfAlgo::GetBooleanAttr(kernel, kAttrOutputIsDynamicShape);
return AnfAlgo::GetBooleanAttr(kernel, kAttrOutputIsDynamicShape);
});
if (iter == kernels.end()) {
return;


+ 2
- 2
mindspore/ccsrc/runtime/device/kernel_runtime.cc View File

@@ -931,9 +931,8 @@ bool KernelRuntime::LaunchKernelMod(const session::KernelGraph &graph) {
<< " should be equal to the size of kernels " << kernels.size();
}
for (size_t i = 0; i < kernels.size(); ++i) {
auto &kernel = kernels[i];
if (!dynamic_kernel_list.empty() && dynamic_kernel_list[i] != nullptr &&
dynamic_kernel_list[i]->is_dynamic_shape() && AnfAlgo::GetKernelType(kernel) == AICPU_KERNEL) {
dynamic_kernel_list[i]->is_dynamic_shape()) {
dynamic_kernel_list[i]->InferShape();
dynamic_kernel_list[i]->UpdateArgs();
dynamic_kernel_list[i]->Execute();
@@ -943,6 +942,7 @@ bool KernelRuntime::LaunchKernelMod(const session::KernelGraph &graph) {
}
dynamic_kernel_list[i]->PostExecute();
} else {
auto &kernel = kernels[i];
auto kernel_mod = AnfAlgo::GetKernelMod(kernel);
MS_EXCEPTION_IF_NULL(kernel_mod);
AddressPtrList kernel_inputs;


Loading…
Cancel
Save