From 2a792de7c263fa038ba3e29285e4d9d7e86ab6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=9F=B3=E6=99=93=E4=BC=9F?= <39303645+Shixiaowei02@users.noreply.github.com> Date: Mon, 9 Mar 2020 10:22:55 +0800 Subject: [PATCH] change the function in op_teller, test=release/1.7 (#22834) * change the function in op_teller, test=develop * correct the commit-id, test=develop --- cmake/external/lite.cmake | 2 +- paddle/fluid/inference/lite/op_teller.cc | 2 +- paddle/fluid/inference/lite/tensor_utils.cc | 6 ++++++ paddle/fluid/operators/lite/lite_engine_op.h | 6 ++++-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/cmake/external/lite.cmake b/cmake/external/lite.cmake index 6c837c97089..2617bdd834d 100644 --- a/cmake/external/lite.cmake +++ b/cmake/external/lite.cmake @@ -44,7 +44,7 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR) ${LITE_PROJECT} ${EXTERNAL_PROJECT_LOG_ARGS} GIT_REPOSITORY "https://github.com/PaddlePaddle/Paddle-Lite.git" - GIT_TAG 922ace19a45f30075618f71428523e7a2d5898d6 + GIT_TAG 0f875ef367bd2dbfa2e557eb2a2fc841bacdf6cf PREFIX ${LITE_SOURCES_DIR} UPDATE_COMMAND "" BUILD_COMMAND ${LITE_BUILD_COMMAND} diff --git a/paddle/fluid/inference/lite/op_teller.cc b/paddle/fluid/inference/lite/op_teller.cc index fd7a5da7cec..c5f1eccc333 100644 --- a/paddle/fluid/inference/lite/op_teller.cc +++ b/paddle/fluid/inference/lite/op_teller.cc @@ -28,7 +28,7 @@ namespace lite { struct SimpleOpTeller : public Teller { SimpleOpTeller() { const std::map& op2path = - OpKernelInfoCollector::Global().GetOp2PathDict(); + paddle::lite::GetOp2PathDict(); auto is_non_inst = [](const std::string& op) -> bool { const std::vector ops = {"feed", "fetch", "while"}; return std::find(ops.begin(), ops.end(), op) != ops.end(); diff --git a/paddle/fluid/inference/lite/tensor_utils.cc b/paddle/fluid/inference/lite/tensor_utils.cc index 9f361d563b0..8e7ebd3119e 100644 --- a/paddle/fluid/inference/lite/tensor_utils.cc +++ b/paddle/fluid/inference/lite/tensor_utils.cc @@ -157,7 +157,10 @@ void TensorCopyAsync(paddle::lite::Tensor* dst, const framework::LoDTensor& src, dst->Resize(framework::vectorize(src.dims())); const void* src_data = src.data(); void* dst_data = dst->mutable_data(bytes); + VLOG(3) << "[CopyAsync fluid -> lite] Bytes = " << bytes << ", src = " << &src + << ", dst = " << dst << ", src_type = " << src.type(); MemoryCopyAsync(dst_place, dst_data, src_place, src_data, bytes, ctx); + VLOG(3) << "[Lite memory size] Bytes = " << dst->memory_size(); } template <> @@ -172,7 +175,10 @@ void TensorCopyAsync(framework::LoDTensor* dst, const paddle::lite::Tensor& src, const void* src_data = src.raw_data(); // When Lite is ready, the source type needs to be modified here. void* dst_data = dst->mutable_data(dst_place, dst->type()); + VLOG(3) << "[CopyAsync lite -> fluid] Bytes = " << bytes << ", src = " << &src + << ", dst = " << dst << ", src_type = " << dst->type(); MemoryCopyAsync(dst_place, dst_data, src_place, src_data, bytes, ctx); + VLOG(3) << "[Lite memory size] Bytes = " << src.memory_size(); } } // namespace utils diff --git a/paddle/fluid/operators/lite/lite_engine_op.h b/paddle/fluid/operators/lite/lite_engine_op.h index 62bbef66323..3b48615338f 100644 --- a/paddle/fluid/operators/lite/lite_engine_op.h +++ b/paddle/fluid/operators/lite/lite_engine_op.h @@ -77,7 +77,8 @@ class LiteEngineOp : public framework::OperatorBase { inference::analysis::GetFromScope(scope, in_names_[i]); paddle::lite::Tensor *dst_t = engine_->GetInput(i); - VLOG(3) << "fluid -> lite: " << in_names_[i]; + VLOG(3) << "[Copy] fluid -> lite (" << in_names_[i] << " -> " + << engine_->GetInputNames()[i] << ")"; inference::lite::utils::TensorCopyAsync(dst_t, src_t, *ctx); } #ifdef PADDLE_WITH_CUDA @@ -94,7 +95,8 @@ class LiteEngineOp : public framework::OperatorBase { framework::LoDTensor *dst_t = &inference::analysis::GetFromScope( scope, out_names_[i]); - VLOG(3) << "lite -> fluid: " << out_names_[i]; + VLOG(3) << "[Copy] lite -> fluid (" << out_names_[i] << " -> " + << engine_->GetOutputNames()[i] << ")"; inference::lite::utils::TensorCopyAsync(dst_t, src_t, *ctx); } #ifdef PADDLE_WITH_CUDA -- GitLab