From b9d63330a94bca2824d4ec63b6610a2824f44d9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:29:28 +0800 Subject: [PATCH 01/12] Update CMakeLists.txt --- test/cpp/fluid/benchmark/CMakeLists.txt | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/test/cpp/fluid/benchmark/CMakeLists.txt b/test/cpp/fluid/benchmark/CMakeLists.txt index a6b5fe0d21572..ae1fabab39b70 100644 --- a/test/cpp/fluid/benchmark/CMakeLists.txt +++ b/test/cpp/fluid/benchmark/CMakeLists.txt @@ -1,16 +1,8 @@ -cc_test( +paddle_test( op_tester SRCS op_tester.cc - DEPS timer - framework_proto - proto_desc - lod_tensor - op_registry - device_context - scope - ${GLOB_OP_LIB} + DEPS ${GLOB_OP_LIB} ${GLOB_OPERATOR_DEPS} - phi common) if(WITH_ONNXRUNTIME AND WIN32) From a5e38f51213dc8c1b43a3aff31efa77810306d8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:18:05 +0800 Subject: [PATCH 02/12] Update CMakeLists.txt --- test/cpp/fluid/benchmark/CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/test/cpp/fluid/benchmark/CMakeLists.txt b/test/cpp/fluid/benchmark/CMakeLists.txt index ae1fabab39b70..c75b4ef170b8e 100644 --- a/test/cpp/fluid/benchmark/CMakeLists.txt +++ b/test/cpp/fluid/benchmark/CMakeLists.txt @@ -1,9 +1,11 @@ paddle_test( op_tester - SRCS op_tester.cc - DEPS ${GLOB_OP_LIB} - ${GLOB_OPERATOR_DEPS} - common) + SRCS + op_tester.cc + DEPS + ${GLOB_OP_LIB} + ${GLOB_OPERATOR_DEPS} + common) if(WITH_ONNXRUNTIME AND WIN32) # Copy onnxruntime for some c++ test in Windows, since the test will From 6d272e0781e012e2a9f8b1509ebdfa95384e4720 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 22:06:01 +0800 Subject: [PATCH 03/12] Update CMakeLists.txt --- test/cpp/fluid/benchmark/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/cpp/fluid/benchmark/CMakeLists.txt b/test/cpp/fluid/benchmark/CMakeLists.txt index c75b4ef170b8e..3ae8cea9ad842 100644 --- a/test/cpp/fluid/benchmark/CMakeLists.txt +++ b/test/cpp/fluid/benchmark/CMakeLists.txt @@ -3,8 +3,6 @@ paddle_test( SRCS op_tester.cc DEPS - ${GLOB_OP_LIB} - ${GLOB_OPERATOR_DEPS} common) if(WITH_ONNXRUNTIME AND WIN32) From 2fbc1a4720a606ef7cfaba72a17da798600317cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:22:06 +0800 Subject: [PATCH 04/12] Update CMakeLists.txt --- test/cpp/fluid/benchmark/CMakeLists.txt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/test/cpp/fluid/benchmark/CMakeLists.txt b/test/cpp/fluid/benchmark/CMakeLists.txt index 3ae8cea9ad842..0b14b812af9f9 100644 --- a/test/cpp/fluid/benchmark/CMakeLists.txt +++ b/test/cpp/fluid/benchmark/CMakeLists.txt @@ -1,9 +1,4 @@ -paddle_test( - op_tester - SRCS - op_tester.cc - DEPS - common) +paddle_test(op_tester SRCS op_tester.cc DEPS common) if(WITH_ONNXRUNTIME AND WIN32) # Copy onnxruntime for some c++ test in Windows, since the test will From 132a9c14885b6b2a6d2376482476422ba3c8f50f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 22:31:58 +0800 Subject: [PATCH 05/12] Update variable_helper.h --- paddle/fluid/framework/variable_helper.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/framework/variable_helper.h b/paddle/fluid/framework/variable_helper.h index 4cdfba29249cc..8e50302f10987 100644 --- a/paddle/fluid/framework/variable_helper.h +++ b/paddle/fluid/framework/variable_helper.h @@ -22,7 +22,7 @@ namespace framework { class Variable; -void InitializeVariable(Variable* var, proto::VarType::Type var_type); +TEST_API void InitializeVariable(Variable* var, proto::VarType::Type var_type); void CopyVariable(const Variable& src_var, Variable* dst_var); } // end namespace framework From 778084b7ada9fd65a24238d0d0907f1d0a7f709a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 22:33:37 +0800 Subject: [PATCH 06/12] Update timer.h --- paddle/fluid/platform/timer.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/paddle/fluid/platform/timer.h b/paddle/fluid/platform/timer.h index 1da141876a8ae..c6121d0e044d5 100644 --- a/paddle/fluid/platform/timer.h +++ b/paddle/fluid/platform/timer.h @@ -34,16 +34,16 @@ class Timer { // Reset() will be called during initialization // all timing variables will be set 0 in Reset() Timer() { Reset(); } - void Reset(); - void Start(); - void Pause(); + TEST_API void Reset(); + TEST_API void Start(); + TEST_API void Pause(); // Resume will get current system time void Resume(); int Count(); // return elapsed time in us double ElapsedUS(); // return elapsed time in ms - double ElapsedMS(); + TEST_API double ElapsedMS(); // return elapsed time in sec double ElapsedSec(); From 89910504375ad05b761f1a8c858f3f390ffd006c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 23:04:14 +0800 Subject: [PATCH 07/12] Update operators.cmake --- cmake/operators.cmake | 3 --- 1 file changed, 3 deletions(-) diff --git a/cmake/operators.cmake b/cmake/operators.cmake index 7b1987f1c3cf2..5740542e695d2 100644 --- a/cmake/operators.cmake +++ b/cmake/operators.cmake @@ -698,9 +698,6 @@ function(prune_pybind_h) list(APPEND op_list "load_combine") list(APPEND op_list "tensorrt_engine") - # TODO(ming1753): conditional_block_infer is temporarily reserved here to avoid link errors in functions of standalone_executor - list(APPEND op_list "conditional_block_infer") - # add fused_op in op_list list(APPEND op_list "fc") list(APPEND op_list "fused_conv2d_add_act") From b9c749b99fc47de34fdeb19e10f624398cf2e0c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Sun, 4 Feb 2024 20:02:00 +0800 Subject: [PATCH 08/12] Update operators.cmake --- cmake/operators.cmake | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmake/operators.cmake b/cmake/operators.cmake index 5740542e695d2..7b1987f1c3cf2 100644 --- a/cmake/operators.cmake +++ b/cmake/operators.cmake @@ -698,6 +698,9 @@ function(prune_pybind_h) list(APPEND op_list "load_combine") list(APPEND op_list "tensorrt_engine") + # TODO(ming1753): conditional_block_infer is temporarily reserved here to avoid link errors in functions of standalone_executor + list(APPEND op_list "conditional_block_infer") + # add fused_op in op_list list(APPEND op_list "fc") list(APPEND op_list "fused_conv2d_add_act") From 648d7f9c5f503823f59c28131dff620d4d23859a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 7 Feb 2024 05:11:20 +0800 Subject: [PATCH 09/12] Update timer.h --- paddle/fluid/platform/timer.h | 1 + 1 file changed, 1 insertion(+) diff --git a/paddle/fluid/platform/timer.h b/paddle/fluid/platform/timer.h index c6121d0e044d5..ab029577fbdd1 100644 --- a/paddle/fluid/platform/timer.h +++ b/paddle/fluid/platform/timer.h @@ -16,6 +16,7 @@ limitations under the License. */ #include #include "paddle/phi/backends/dynload/port.h" +#include "paddle/utils/test_macros.h" #ifdef _WIN32 static unsigned sleep(unsigned seconds) { From bef95ec083dd05cd60e81a1ab99ec075eb655051 Mon Sep 17 00:00:00 2001 From: liyulingyue <852433440@qq.com> Date: Wed, 7 Feb 2024 06:25:42 +0800 Subject: [PATCH 10/12] delete fetchv2, remain error lnk should be 314 --- test/cpp/new_executor/standalone_executor_test.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/cpp/new_executor/standalone_executor_test.cc b/test/cpp/new_executor/standalone_executor_test.cc index 727cb895c5e6b..e7bfa0c796c97 100644 --- a/test/cpp/new_executor/standalone_executor_test.cc +++ b/test/cpp/new_executor/standalone_executor_test.cc @@ -62,7 +62,6 @@ USE_OP_ITSELF(sgd); USE_OP_ITSELF(squared_l2_norm); USE_OP_ITSELF(memcpy_h2d); USE_OP_ITSELF(memcpy_d2h); -USE_OP_ITSELF(fetch_v2); PD_DECLARE_KERNEL(full, GPU, ALL_LAYOUT); PD_DECLARE_KERNEL(uniform_raw, GPU, ALL_LAYOUT); From 17984359befc15f825fe96857c0e5130868bf6b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Mon, 19 Feb 2024 19:17:28 +0800 Subject: [PATCH 11/12] Update standalone_executor_test.cc --- test/cpp/new_executor/standalone_executor_test.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/cpp/new_executor/standalone_executor_test.cc b/test/cpp/new_executor/standalone_executor_test.cc index e7bfa0c796c97..f8fe50dcb52c8 100644 --- a/test/cpp/new_executor/standalone_executor_test.cc +++ b/test/cpp/new_executor/standalone_executor_test.cc @@ -74,7 +74,6 @@ PD_DECLARE_KERNEL(concat_grad, GPU, ALL_LAYOUT); PD_DECLARE_KERNEL(matmul, GPU, ALL_LAYOUT); PD_DECLARE_KERNEL(add_raw, KPS, ALL_LAYOUT); PD_DECLARE_KERNEL(add, KPS, ALL_LAYOUT); -PD_DECLARE_KERNEL(add, CPU, ALL_LAYOUT); PD_DECLARE_KERNEL(multiply, KPS, ALL_LAYOUT); PD_DECLARE_KERNEL(multiply_grad, GPU, ALL_LAYOUT); PD_DECLARE_KERNEL(divide, KPS, ALL_LAYOUT); From e50b5efaa7206bca423d1c68d0cc626d2931071a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Tue, 20 Feb 2024 19:46:47 +0800 Subject: [PATCH 12/12] Update op_tester.cc --- test/cpp/fluid/benchmark/op_tester.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/test/cpp/fluid/benchmark/op_tester.cc b/test/cpp/fluid/benchmark/op_tester.cc index ed78f75ef6453..b6044f7985a24 100644 --- a/test/cpp/fluid/benchmark/op_tester.cc +++ b/test/cpp/fluid/benchmark/op_tester.cc @@ -24,7 +24,6 @@ limitations under the License. */ #include "paddle/fluid/platform/init.h" #include "paddle/fluid/platform/profiler.h" #include "paddle/fluid/platform/timer.h" -#include "paddle/fluid/pybind/pybind.h" // phi #include "paddle/phi/kernels/declarations.h"