diff --git a/mindspore/lite/nnacl/fp16/exp_fp16.h b/mindspore/lite/nnacl/fp16/exp_fp16.h index 1f23d1ea72..f9db27c09e 100644 --- a/mindspore/lite/nnacl/fp16/exp_fp16.h +++ b/mindspore/lite/nnacl/fp16/exp_fp16.h @@ -59,7 +59,7 @@ static inline void single_exp_fp16(float16_t src, float16_t *dst) { int integer = (float)src / param[0]; float decimal = (float)src - integer * param[0]; int int_exp = (integer + 127) << 23; - float decimal_exp = + const float decimal_exp = 1.0f + decimal * (1.0f + decimal * (0.5f + decimal * (param[3] + decimal * (param[2] + decimal * param[1])))); *dst = (float16_t)(*((float *)&int_exp) * decimal_exp); } diff --git a/mindspore/lite/nnacl/fp32/conv_depthwise_fp32.c b/mindspore/lite/nnacl/fp32/conv_depthwise_fp32.c index 1cfc5e4a04..08b0332ffb 100644 --- a/mindspore/lite/nnacl/fp32/conv_depthwise_fp32.c +++ b/mindspore/lite/nnacl/fp32/conv_depthwise_fp32.c @@ -330,7 +330,7 @@ bool CheckConvDw1DWinograd(const ConvParameter *conv_param, int thread_num) { conv_param->stride_h_ == 1 && conv_param->dilation_h_ == 1 && conv_param->dilation_w_ == 1 && conv_param->pad_u_ == 1 && conv_param->pad_d_ == 1 && conv_param->pad_l_ == 1 && conv_param->pad_r_ == 1 && conv_param->input_channel_ == conv_param->output_channel_ && - conv_param->output_h_ / thread_num >= 4; // better had more than 4 rows for each thread + conv_param->output_h_ >= thread_num * 4; // better had more than 4 rows for each thread } void ConvDw3x3RowLeft(const float *src, float *line, int lw, int channel) { diff --git a/mindspore/lite/nnacl/fp32_grad/pooling_grad.c b/mindspore/lite/nnacl/fp32_grad/pooling_grad.c index d775b9b554..cd80ee470f 100644 --- a/mindspore/lite/nnacl/fp32_grad/pooling_grad.c +++ b/mindspore/lite/nnacl/fp32_grad/pooling_grad.c @@ -144,8 +144,7 @@ void MaxPoolingGrad(const float *input_ptr, const float *dy_ptr, float *output_p int xw = yw * stride_w + kw - pad_w; int val_idx = (xw + in_w * xh) * channel + ic; #ifdef ENABLE_ARM - unsigned int val_idx_vec[] = {val_idx, val_idx + 1, val_idx + 2, val_idx + 3}; - uint32x4_t index = vld1q_u32(val_idx_vec); + uint32x4_t index = {val_idx, val_idx + 1, val_idx + 2, val_idx + 3}; float32x4_t in = vld1q_f32(inPtr + val_idx); max_idx = MaxIndex(in, &max_val, index, max_idx); #else diff --git a/mindspore/lite/src/runtime/kernel/npu/npu_kernel.h b/mindspore/lite/src/runtime/kernel/npu/npu_kernel.h index ed912c7718..92652603f1 100644 --- a/mindspore/lite/src/runtime/kernel/npu/npu_kernel.h +++ b/mindspore/lite/src/runtime/kernel/npu/npu_kernel.h @@ -27,7 +27,6 @@ using mindspore::kernel::LiteKernel; using mindspore::lite::RET_ERROR; using mindspore::lite::RET_OK; namespace mindspore::kernel { -#define NPU_MEMORY_MAX 200 * 1024 * 1024 class NPUKernel : public LiteKernel { public: NPUKernel(OpParameter *parameter, const std::vector &inputs, @@ -65,12 +64,6 @@ kernel::LiteKernel *NPUKernelCreator(const std::vector &inputs, free(opParameter); return nullptr; } - if (inputs[0]->Size() > NPU_MEMORY_MAX) { - MS_LOG(ERROR) << "Npu does not support input tensor size greater than 200MB"; - free(opParameter); - return nullptr; - } - auto *kernel = new (std::nothrow) T(opParameter, inputs, outputs, ctx, primitive); if (kernel == nullptr) { MS_LOG(ERROR) << "kernel " << opParameter->name_ << "is nullptr."; diff --git a/mindspore/lite/test/run_benchmark_nets.sh b/mindspore/lite/test/run_benchmark_nets.sh index 76d39fc6e3..3e6c680df6 100755 --- a/mindspore/lite/test/run_benchmark_nets.sh +++ b/mindspore/lite/test/run_benchmark_nets.sh @@ -2309,16 +2309,6 @@ if [[ ${backend} == "all" || ${backend} == "npu" ]]; then fi # Check benchmark result and return value -if [[ ${backend} == "all" || ${backend} == "x86" ]]; then - wait ${Run_x86_PID} - Run_x86_status=$? - - if [[ ${Run_x86_status} != 0 ]];then - echo "Run_x86 failed" - cat ${run_x86_log_file} - isFailed=1 - fi -fi if [[ ${backend} == "all" || ${backend} == "x86-sse" ]]; then wait ${Run_x86_sse_PID} Run_x86_sse_status=$? @@ -2339,6 +2329,16 @@ if [[ ${backend} == "all" || ${backend} == "x86-avx" ]]; then isFailed=1 fi fi +if [[ ${backend} == "all" || ${backend} == "x86" ]]; then + wait ${Run_x86_PID} + Run_x86_status=$? + + if [[ ${Run_x86_status} != 0 ]];then + echo "Run_x86 failed" + cat ${run_x86_log_file} + isFailed=1 + fi +fi if [[ ${backend} == "all" || ${backend} == "arm64_fp32" ]]; then if [[ ${Run_arm64_fp32_status} != 0 ]];then