File tree 3 files changed +10
-8
lines changed
paddle/fluid/inference/tests/api
3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -385,7 +385,7 @@ function(cc_test TARGET_NAME)
385
385
set_property (TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cpu_deterministic=true )
386
386
set_property (TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_init_allocated_mem=true )
387
387
set_property (TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_limit_of_tmp_allocation=4294967296) # 4G
388
- set_property (TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true ${MKL_DEBUG_FLAG} )
388
+ set_property (TEST ${TARGET_NAME} PROPERTY ENVIRONMENT FLAGS_cudnn_deterministic=true )
389
389
# No unit test should exceed 10 minutes.
390
390
set_tests_properties (${TARGET_NAME} PROPERTIES TIMEOUT 600)
391
391
endif ()
Original file line number Diff line number Diff line change @@ -33,14 +33,12 @@ function(inference_analysis_api_int8_test target model_dir data_dir filename)
33
33
--paddle_num_threads=${CPU_NUM_THREADS_ON_CI}
34
34
--iterations=2)
35
35
endfunction ()
36
- function (inference_analysis_api_test_with_fake_data target install_dir filename model_name mkl_debug)
37
- if (mkl_debug)
38
- set (MKL_DEBUG_FLAG MKL_DEBUG_CPU_TYPE=7)
39
- endif ()
36
+ function (inference_analysis_api_test_with_fake_data target install_dir filename model_name disable_fc)
40
37
download_model(${install_dir} ${model_name} )
41
38
inference_analysis_test(${target} SRCS ${filename}
42
39
EXTRA_DEPS ${INFERENCE_EXTRA_DEPS}
43
- ARGS --infer_model=${install_dir} /model)
40
+ ARGS --infer_model=${install_dir} /model
41
+ --disable_mkldnn_fc=${disable_fc} )
44
42
endfunction ()
45
43
46
44
function (inference_analysis_api_test_with_refer_result target install_dir filename)
Original file line number Diff line number Diff line change @@ -16,6 +16,8 @@ limitations under the License. */
16
16
#include < iostream>
17
17
#include " paddle/fluid/inference/tests/api/tester_helper.h"
18
18
19
+ DEFINE_bool (disable_mkldnn_fc, false , " Disable usage of MKL-DNN's FC op" );
20
+
19
21
namespace paddle {
20
22
namespace inference {
21
23
namespace analysis {
@@ -48,7 +50,8 @@ void profile(bool use_mkldnn = false) {
48
50
49
51
if (use_mkldnn) {
50
52
cfg.EnableMKLDNN ();
51
- cfg.pass_builder ()->AppendPass (" fc_mkldnn_pass" );
53
+ if (!FLAGS_disable_mkldnn_fc)
54
+ cfg.pass_builder ()->AppendPass (" fc_mkldnn_pass" );
52
55
}
53
56
std::vector<std::vector<PaddleTensor>> outputs;
54
57
@@ -80,7 +83,8 @@ void compare(bool use_mkldnn = false) {
80
83
SetConfig (&cfg);
81
84
if (use_mkldnn) {
82
85
cfg.EnableMKLDNN ();
83
- cfg.pass_builder ()->AppendPass (" fc_mkldnn_pass" );
86
+ if (!FLAGS_disable_mkldnn_fc)
87
+ cfg.pass_builder ()->AppendPass (" fc_mkldnn_pass" );
84
88
}
85
89
86
90
std::vector<std::vector<PaddleTensor>> input_slots_all;
You can’t perform that action at this time.
0 commit comments