Skip to content

Commit 2a792de

Browse files
authored
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
1 parent 7a92e75 commit 2a792de

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

cmake/external/lite.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ if (NOT LITE_SOURCE_DIR OR NOT LITE_BINARY_DIR)
4444
${LITE_PROJECT}
4545
${EXTERNAL_PROJECT_LOG_ARGS}
4646
GIT_REPOSITORY "https://github.com/PaddlePaddle/Paddle-Lite.git"
47-
GIT_TAG 922ace19a45f30075618f71428523e7a2d5898d6
47+
GIT_TAG 0f875ef367bd2dbfa2e557eb2a2fc841bacdf6cf
4848
PREFIX ${LITE_SOURCES_DIR}
4949
UPDATE_COMMAND ""
5050
BUILD_COMMAND ${LITE_BUILD_COMMAND}

paddle/fluid/inference/lite/op_teller.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace lite {
2828
struct SimpleOpTeller : public Teller {
2929
SimpleOpTeller() {
3030
const std::map<std::string, std::string>& op2path =
31-
OpKernelInfoCollector::Global().GetOp2PathDict();
31+
paddle::lite::GetOp2PathDict();
3232
auto is_non_inst = [](const std::string& op) -> bool {
3333
const std::vector<std::string> ops = {"feed", "fetch", "while"};
3434
return std::find(ops.begin(), ops.end(), op) != ops.end();

paddle/fluid/inference/lite/tensor_utils.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,10 @@ void TensorCopyAsync(paddle::lite::Tensor* dst, const framework::LoDTensor& src,
157157
dst->Resize(framework::vectorize(src.dims()));
158158
const void* src_data = src.data<void>();
159159
void* dst_data = dst->mutable_data(bytes);
160+
VLOG(3) << "[CopyAsync fluid -> lite] Bytes = " << bytes << ", src = " << &src
161+
<< ", dst = " << dst << ", src_type = " << src.type();
160162
MemoryCopyAsync(dst_place, dst_data, src_place, src_data, bytes, ctx);
163+
VLOG(3) << "[Lite memory size] Bytes = " << dst->memory_size();
161164
}
162165

163166
template <>
@@ -172,7 +175,10 @@ void TensorCopyAsync(framework::LoDTensor* dst, const paddle::lite::Tensor& src,
172175
const void* src_data = src.raw_data();
173176
// When Lite is ready, the source type needs to be modified here.
174177
void* dst_data = dst->mutable_data(dst_place, dst->type());
178+
VLOG(3) << "[CopyAsync lite -> fluid] Bytes = " << bytes << ", src = " << &src
179+
<< ", dst = " << dst << ", src_type = " << dst->type();
175180
MemoryCopyAsync(dst_place, dst_data, src_place, src_data, bytes, ctx);
181+
VLOG(3) << "[Lite memory size] Bytes = " << src.memory_size();
176182
}
177183

178184
} // namespace utils

paddle/fluid/operators/lite/lite_engine_op.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ class LiteEngineOp : public framework::OperatorBase {
7777
inference::analysis::GetFromScope<framework::LoDTensor>(scope,
7878
in_names_[i]);
7979
paddle::lite::Tensor *dst_t = engine_->GetInput(i);
80-
VLOG(3) << "fluid -> lite: " << in_names_[i];
80+
VLOG(3) << "[Copy] fluid -> lite (" << in_names_[i] << " -> "
81+
<< engine_->GetInputNames()[i] << ")";
8182
inference::lite::utils::TensorCopyAsync(dst_t, src_t, *ctx);
8283
}
8384
#ifdef PADDLE_WITH_CUDA
@@ -94,7 +95,8 @@ class LiteEngineOp : public framework::OperatorBase {
9495
framework::LoDTensor *dst_t =
9596
&inference::analysis::GetFromScope<framework::LoDTensor>(
9697
scope, out_names_[i]);
97-
VLOG(3) << "lite -> fluid: " << out_names_[i];
98+
VLOG(3) << "[Copy] lite -> fluid (" << out_names_[i] << " -> "
99+
<< engine_->GetOutputNames()[i] << ")";
98100
inference::lite::utils::TensorCopyAsync(dst_t, src_t, *ctx);
99101
}
100102
#ifdef PADDLE_WITH_CUDA

0 commit comments

Comments
 (0)