Skip to content

Commit f025385

Browse files
authoredFeb 5, 2024
[CherryPick] Fix issue 60092 (#61427)
* fix issue 60092 * update * update * update
1 parent 0ccb9cb commit f025385

13 files changed

+4
-441
lines changed
 

‎paddle/fluid/inference/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ get_property(fluid_modules GLOBAL PROPERTY FLUID_MODULES)
3535
get_property(phi_modules GLOBAL PROPERTY PHI_MODULES)
3636
get_property(ir_targets GLOBAL PROPERTY IR_TARGETS)
3737
get_property(not_infer_modules GLOBAL PROPERTY NOT_INFER_MODULES)
38-
set(utils_modules pretty_log string_helper benchmark utf8proc)
38+
set(utils_modules pretty_log string_helper utf8proc)
3939

4040
if(NOT WITH_GFLAGS)
4141
set(utils_modules ${utils_modules} paddle_flags)
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
cc_library(
2-
benchmark
3-
SRCS benchmark.cc
4-
DEPS enforce common)
5-
paddle_test(test_benchmark SRCS benchmark_tester.cc DEPS benchmark)
61
cc_library(
72
infer_io_utils
83
SRCS io_utils.cc
@@ -13,13 +8,5 @@ cc_library(
138
DEPS proto_desc enforce common)
149

1510
cc_library(table_printer SRCS table_printer.cc)
16-
paddle_test(test_table_printer SRCS table_printer_tester.cc)
1711

1812
proto_library(shape_range_info_proto SRCS shape_range_info.proto)
19-
20-
if(WITH_ONNXRUNTIME AND WIN32)
21-
# Copy onnxruntime for some c++ test in Windows, since the test will
22-
# be build only in CI, so suppose the generator in Windows is Ninja.
23-
copy_onnx(test_benchmark)
24-
copy_onnx(test_table_printer)
25-
endif()

‎paddle/fluid/inference/utils/benchmark.cc

-54
This file was deleted.

‎paddle/fluid/inference/utils/benchmark.h

-56
This file was deleted.

‎paddle/fluid/inference/utils/benchmark_tester.cc

-40
This file was deleted.

‎paddle/fluid/inference/utils/table_printer_tester.cc

-82
This file was deleted.

‎test/cpp/fluid/CMakeLists.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
add_subdirectory(benchmark)
22
add_subdirectory(framework)
33

4-
add_subdirectory(inference)
5-
64
if(WITH_CINN)
75
add_subdirectory(cinn)
86
endif()

‎test/cpp/fluid/inference/CMakeLists.txt

-1
This file was deleted.

‎test/cpp/fluid/inference/utils/CMakeLists.txt

-16
This file was deleted.

‎test/cpp/fluid/inference/utils/io_utils_tester.cc

-154
This file was deleted.

‎test/cpp/inference/api/tester_helper.h

-12
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#include "paddle/fluid/inference/api/analysis_predictor.h"
3535
#include "paddle/fluid/inference/api/helper.h"
3636
#include "paddle/fluid/inference/api/paddle_inference_api.h"
37-
#include "paddle/fluid/inference/utils/benchmark.h"
3837
#include "paddle/fluid/platform/profiler/event_tracing.h"
3938
#include "test/cpp/inference/api/config_printer.h"
4039
#include "test/cpp/inference/test_helper.h"
@@ -69,9 +68,6 @@ PD_DEFINE_int32(num_threads,
6968
PD_DEFINE_bool(use_analysis,
7069
true,
7170
"Running the inference program in analysis mode.");
72-
PD_DEFINE_bool(record_benchmark,
73-
false,
74-
"Record benchmark after profiling the model");
7571
PD_DEFINE_double(accuracy, 1e-3, "Result Accuracy.");
7672
PD_DEFINE_double(quantized_accuracy, 2e-2, "Result Quantized Accuracy.");
7773
PD_DEFINE_bool(zero_copy, false, "Use ZeroCopy to speedup Feed/Fetch.");
@@ -594,14 +590,6 @@ void PredictionRun(PaddlePredictor *predictor,
594590

595591
if (sample_latency != nullptr)
596592
*sample_latency = batch_latency / FLAGS_batch_size;
597-
598-
if (FLAGS_record_benchmark) {
599-
Benchmark benchmark;
600-
benchmark.SetName(FLAGS_model_name);
601-
benchmark.SetBatchSize(FLAGS_batch_size);
602-
benchmark.SetLatency(batch_latency);
603-
benchmark.PersistToFile("benchmark_record.txt");
604-
}
605593
}
606594

607595
void TestOneThreadPrediction(

‎test/cpp/inference/test.cmake

+3-4
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,9 @@ function(inference_base_test_build TARGET)
111111
add_executable(${TARGET} ${base_test_SRCS})
112112
if("${base_test_DEPS};" MATCHES "paddle_inference_shared;")
113113
list(REMOVE_ITEM base_test_DEPS paddle_inference_shared)
114-
target_link_libraries(
115-
${TARGET} $<TARGET_LINKER_FILE:paddle_inference_shared>
116-
$<TARGET_LINKER_FILE:benchmark>)
117-
add_dependencies(${TARGET} paddle_inference_shared benchmark)
114+
target_link_libraries(${TARGET}
115+
$<TARGET_LINKER_FILE:paddle_inference_shared>)
116+
add_dependencies(${TARGET} paddle_inference_shared)
118117
elseif("${base_test_DEPS};" MATCHES "paddle_inference_c_shared;")
119118
list(REMOVE_ITEM base_test_DEPS paddle_inference_c_shared)
120119
target_link_libraries(${TARGET}

‎tools/parallel_UT_rule.py

-6
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
'test_fc_gru_fuse_pass_cc',
2929
'device_worker_test',
3030
'test_custom_conj',
31-
'infer_io_utils_tester',
3231
'test_transpose_bf16_mkldnn_op',
3332
'test_container',
3433
'cpu_helper_test',
@@ -73,7 +72,6 @@
7372
'test_pybind_interface',
7473
'test_io_save_load',
7574
'test_fusion_lstm_int8_mkldnn_op',
76-
'test_benchmark',
7775
'test_protobuf',
7876
'test_tdm_sampler_op',
7977
'test_teacher_student_sigmoid_loss_op',
@@ -482,7 +480,6 @@
482480
'test_communicator_half_async',
483481
'test_dynrnn_gradient_check',
484482
'test_pool2d_bf16_mkldnn_op',
485-
'test_table_printer',
486483
'test_framework_debug_str',
487484
'test_dist_fleet_ps2',
488485
'test_collective_scatter_api',
@@ -1926,7 +1923,6 @@
19261923
'test_bpr_loss_op',
19271924
'test_boxps',
19281925
'test_bipartite_match_op',
1929-
'test_benchmark',
19301926
'test_beam_search_op',
19311927
'test_batch_sampler',
19321928
'test_batch_norm_act_fuse_pass',
@@ -1970,7 +1966,6 @@
19701966
'lodtensor_printer_test',
19711967
'test_dispatch_jit',
19721968
'inlined_vector_test',
1973-
'infer_io_utils_tester',
19741969
'graph_to_program_pass_test',
19751970
'graph_test',
19761971
'graph_helper_test',
@@ -2176,7 +2171,6 @@
21762171
'test_auto_parallel_api',
21772172
'test_tensor_copy_from',
21782173
'test_analyzer_capi_exp_xpu',
2179-
'test_table_printer',
21802174
'test_egr_task_autocodegen',
21812175
'test_static_save_load_bf16',
21822176
'test_parallel_executor_run_cinn',

0 commit comments

Comments
 (0)
Please sign in to comment.