From bfc5cdad51143ed0e05c07b4bbfe44a3fd4c66eb Mon Sep 17 00:00:00 2001 From: ling Date: Wed, 28 Oct 2020 18:56:11 +0800 Subject: [PATCH] [MSLITE] fp16 abort --- .../lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc | 2 -- .../runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc | 5 +++++ .../runtime/kernel/arm/fp16/deconvolution_winograd_fp16.h | 2 ++ .../src/runtime/kernel/arm/fp32/deconvolution_winograd.cc | 5 +++++ .../lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc | 4 ++-- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc index 52dce32804..f28d0220b0 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_fp16.cc @@ -264,6 +264,4 @@ kernel::LiteKernel *CpuDeConvFp16KernelCreator(const std::vector } return kernel; } - -REG_KERNEL(kCPU, kNumberTypeFloat16, PrimitiveType_DeConv2D, CpuDeConvFp16KernelCreator) } // namespace mindspore::kernel diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc index b261045e80..815de47d62 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.cc @@ -99,6 +99,11 @@ void DeConvWinogradFp16CPUKernel::FreeDeconvParam() { } } + if (deconv_param_->compute_units_ != nullptr) { + free(deconv_param_->compute_units_); + deconv_param_->compute_units_ = nullptr; + } + if (deconv_param_ != nullptr) { delete (deconv_param_); deconv_param_ = nullptr; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.h b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.h index bcbca65043..45b1c6cc98 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.h +++ b/mindspore/lite/src/runtime/kernel/arm/fp16/deconvolution_winograd_fp16.h @@ -34,6 +34,8 @@ class DeConvWinogradFp16CPUKernel : public ConvolutionBaseFP16CPUKernel { deconv_param_ = new DeConvParam(); for (auto &wg : deconv_param_->a_buffer_) { wg.buf_init_ = false; + wg.dest_buffer_ = nullptr; + wg.middle_buffer_ = nullptr; } } ~DeConvWinogradFp16CPUKernel() override; diff --git a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd.cc b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd.cc index 5e2d3760f0..41e2e871f5 100644 --- a/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd.cc +++ b/mindspore/lite/src/runtime/kernel/arm/fp32/deconvolution_winograd.cc @@ -88,6 +88,11 @@ void DeConvolutionWinogradCPUKernel::FreeDeconvParam() { } } + if (deconv_param_->compute_units_ != nullptr) { + free(deconv_param_->compute_units_); + deconv_param_->compute_units_ = nullptr; + } + if (deconv_param_ != nullptr) { delete (deconv_param_); deconv_param_ = nullptr; diff --git a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc index eb6d88455f..5b30b09ada 100644 --- a/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc +++ b/mindspore/lite/src/runtime/kernel/arm/int8/deconvolution_int8.cc @@ -103,13 +103,13 @@ void DeConvInt8CPUKernel::CheckSupportOptimize() { if (dlopen_error != nullptr) { MS_LOG(ERROR) << "load matmul func failed! " << dlopen_error << "."; support_optimize_ = false; - matmul_func_ = nullptr; + matmul_func_ = MatMulR4Int8Neon64; } else { support_optimize_ = true; } } else { support_optimize_ = false; - matmul_func_ = nullptr; + matmul_func_ = MatMulR4Int8Neon64; } #endif return;