diff --git a/paddle/fluid/lite/api/cxx_api_bin_int8.cc b/paddle/fluid/lite/api/cxx_api_bin_int8.cc index 0b14b8fbc6a7a3356a47fe82be40550aeae61d5d..4e30cb88b105d6aed6bff693726802fac276e689 100644 --- a/paddle/fluid/lite/api/cxx_api_bin_int8.cc +++ b/paddle/fluid/lite/api/cxx_api_bin_int8.cc @@ -34,6 +34,7 @@ double time_diff(Time t1, Time t2) { void Run(const char* model_dir, int repeat) { #ifdef LITE_WITH_ARM DeviceInfo::Init(); + DeviceInfo::Global().SetRunMode(LITE_POWER_HIGH, 1); #endif lite::Predictor predictor; std::vector valid_places({ @@ -52,6 +53,7 @@ void Run(const char* model_dir, int repeat) { data[i] = 1; } + for (int i = 0; i < 10; i++) predictor.Run(); auto time1 = time(); for (int i = 0; i < repeat; i++) predictor.Run(); auto time2 = time(); @@ -60,10 +62,16 @@ void Run(const char* model_dir, int repeat) { auto* out = predictor.GetOutput(0); LOG(INFO) << out << " memory size " << out->data_size(); - LOG(INFO) << "out " << out->data()[0]; - LOG(INFO) << "out " << out->data()[1]; LOG(INFO) << "dims " << out->dims(); LOG(INFO) << "out data size: " << out->data_size(); + /* + float sum = 0.; + for (int i = 0; i < out->data_size(); i++) { + LOG(INFO) << "out " << out->data()[i]; + sum += out->data()[i]; + } + LOG(INFO) << sum; + */ } } // namespace lite diff --git a/paddle/fluid/lite/kernels/arm/conv_compute.cc b/paddle/fluid/lite/kernels/arm/conv_compute.cc index 0854ba65c7b4b31f4fe0bc3fc4f42de8cbe2acb7..29a88ba1a17674dfadc26adadd0f0fc2a708596f 100644 --- a/paddle/fluid/lite/kernels/arm/conv_compute.cc +++ b/paddle/fluid/lite/kernels/arm/conv_compute.cc @@ -74,7 +74,7 @@ void ConvCompute::PrepareForRun() { } else if (param.groups == 1 && kw == 3 && stride == 2 && kps_equal && no_dilation) { // direct conv impl - impl_ = new lite::arm::math::DirectConv; + impl_ = new lite::arm::math::GemmLikeConv; VLOG(3) << "invoking direct conv"; } else { impl_ = new lite::arm::math::GemmLikeConv; @@ -123,8 +123,7 @@ void ConvComputeInt8::PrepareForRun() { // weigth is int8 and bias is int32 so do not need trans if (param.groups == ic && ic == oc && kps_equal && no_dilation && flag_dw) { - // impl_ = new lite::arm::math::DepthwiseConvInt8; - impl_ = new lite::arm::math::GemmLikeConvInt8; + impl_ = new lite::arm::math::DepthwiseConvInt8; VLOG(3) << "Run DepthwiseConv Int8"; } else if (param.groups == 1 && kw == 3 && (sw == 1 || sw == 2) && kps_equal && no_dilation) {