Skip to content

Commit b378ada

Browse files
co63ocSigureMo
authored andcommitted
rename test_mkldnn_matmul_elementwise_add_fuse_pass [fluid_ops] (PaddlePaddle#75572)
1 parent 05af9bc commit b378ada

7 files changed

Lines changed: 41 additions & 56 deletions

File tree

test/cpp/inference/api/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -583,7 +583,7 @@ if(WITH_TESTING AND WITH_INFERENCE_API_TEST)
583583

584584
# Quant2 MobileNetV1
585585
inference_analysis_api_quant_test_run(
586-
test_analyzer_quant2_mobilenetv1_mkldnn
586+
test_analyzer_quant2_mobilenetv1_onednn
587587
${QUANT_IMG_CLASS_TEST_APP}
588588
${QUANT2_MobileNetV1_MODEL_DIR}/MobileNet_qat_perf/float
589589
${QUANT2_MobileNetV1_MODEL_DIR}/MobileNet_qat_perf/float
@@ -604,7 +604,7 @@ if(WITH_TESTING AND WITH_INFERENCE_API_TEST)
604604
set(QUANT2_RESNET50_MODEL
605605
${QUANT2_RESNET50_CHANNELWISE_MODEL_DIR}/ResNet50_qat_channelwise)
606606
inference_analysis_api_quant_test_run(
607-
test_analyzer_quant2_resnet50_channelwise_mkldnn
607+
test_analyzer_quant2_resnet50_channelwise_onednn
608608
${QUANT_IMG_CLASS_TEST_APP} ${QUANT2_RESNET50_MODEL}
609609
${QUANT2_RESNET50_MODEL} ${IMAGENET_DATA_PATH} true)
610610

@@ -1016,9 +1016,9 @@ if(WITH_TESTING AND WITH_INFERENCE_API_TEST)
10161016
if(WITH_ONEDNN)
10171017
set_tests_properties(test_analyzer_quant_performance_benchmark
10181018
PROPERTIES TIMEOUT 120)
1019-
set_tests_properties(test_analyzer_quant2_mobilenetv1_mkldnn
1019+
set_tests_properties(test_analyzer_quant2_mobilenetv1_onednn
10201020
PROPERTIES TIMEOUT 120)
1021-
set_tests_properties(test_analyzer_quant2_resnet50_channelwise_mkldnn
1021+
set_tests_properties(test_analyzer_quant2_resnet50_channelwise_onednn
10221022
PROPERTIES TIMEOUT 120)
10231023
endif()
10241024

test/ir/inference/CMakeLists.txt

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -117,15 +117,6 @@ if(WITH_GPU AND TENSORRT_FOUND)
117117
endforeach()
118118
endif()
119119

120-
file(
121-
GLOB TEST_MKLDNN_IR_PASSES
122-
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
123-
"test_mkldnn_*.py")
124-
string(REPLACE ".py" "" TEST_MKLDNN_IR_PASSES "${TEST_MKLDNN_IR_PASSES}")
125-
foreach(TEST_INFERENCE_IR_PASS ${TEST_MKLDNN_IR_PASSES})
126-
list(REMOVE_ITEM TEST_INFERENCE_IR_PASSES ${TEST_INFERENCE_IR_PASS})
127-
endforeach()
128-
129120
file(
130121
GLOB TEST_ONEDNN_IR_PASSES
131122
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
@@ -138,11 +129,6 @@ endforeach()
138129
if(WIN32 AND WIN_UNITTEST_LEVEL LESS 2)
139130
message(STATUS "Skip tests unrelated to CUDA/TRT")
140131
elseif(WITH_ONEDNN)
141-
foreach(target ${TEST_MKLDNN_IR_PASSES})
142-
py_test_modules(${target} MODULES ${target})
143-
set_tests_properties(${target} PROPERTIES LABELS "RUN_TYPE=INFER")
144-
endforeach()
145-
146132
foreach(target ${TEST_ONEDNN_IR_PASSES})
147133
py_test_modules(${target} MODULES ${target})
148134
set_tests_properties(${target} PROPERTIES LABELS "RUN_TYPE=INFER")
@@ -305,8 +291,7 @@ endif()
305291
if(WIN32 AND WIN_UNITTEST_LEVEL LESS 2)
306292
message(STATUS "Skip tests unrelated to CUDA/TRT")
307293
elseif(WITH_ONEDNN)
308-
309-
set(PIR_COVERAGE_MKLDNN_TESTS
294+
set(PIR_COVERAGE_ONEDNN_TESTS
310295
test_onednn_conv_affine_channel_fuse_pass
311296
test_onednn_conv_gelu_fuse_pass
312297
test_onednn_conv_hard_sigmoid_fuse_pass
@@ -316,14 +301,7 @@ elseif(WITH_ONEDNN)
316301
test_onednn_conv3d_op
317302
test_onednn_depthwise_conv_pass
318303
test_onednn_shape_op
319-
test_onednn_shuffle_channel_op)
320-
foreach(target ${PIR_COVERAGE_MKLDNN_TESTS})
321-
py_test_modules(${target}_pir MODULES ${target} ENVS FLAGS_enable_pir_api=1)
322-
set_tests_properties(${target} PROPERTIES LABELS "RUN_TYPE=INFER")
323-
message(STATUS "PIR Copied Test: ${target}_pir in inference test")
324-
endforeach()
325-
326-
set(PIR_COVERAGE_ONEDNN_TESTS
304+
test_onednn_shuffle_channel_op
327305
test_onednn_batch_norm_act_fuse_pass
328306
test_onednn_conv_bias_fuse_pass
329307
test_onednn_conv_bn_fuse_pass

test/ir/inference/test_mkldnn_matmul_elementwise_add_fuse_pass.py renamed to test/ir/inference/test_onednn_matmul_elementwise_add_fuse_pass.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
import hypothesis.strategies as st
1919
import numpy as np
2020
from auto_scan_test import PassAutoScanTest
21+
from op_test import OpTestTool
2122
from program_config import OpConfig, ProgramConfig, TensorConfig
2223

2324

25+
@OpTestTool.skip_if_not_cpu()
2426
class TestMatmulElementwiseAddOnednnFusePass(PassAutoScanTest):
2527
def sample_program_config(self, draw):
2628
axis = draw(st.sampled_from([-1, 0, 1]))
@@ -84,7 +86,8 @@ def test(self):
8486
)
8587

8688

87-
class TestMatmulElementwiseAddMkldnnFuse1CHWPass(PassAutoScanTest):
89+
@OpTestTool.skip_if_not_cpu()
90+
class TestMatmulElementwiseAddOnednnFuse1CHWPass(PassAutoScanTest):
8891
def sample_program_config(self, draw):
8992
axis = draw(st.sampled_from([-1, 0, 1]))
9093
matmul_as_x = draw(st.booleans())
@@ -147,6 +150,7 @@ def test(self):
147150
)
148151

149152

153+
@OpTestTool.skip_if_not_cpu()
150154
class TestMatmulElementwiseAddExpendResidualPass(PassAutoScanTest):
151155
def sample_program_config(self, draw):
152156
axis = draw(st.sampled_from([0]))

test/quantization/CMakeLists.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function(inference_analysis_python_api_int8_test_custom_warmup_batch_size
3939
${filename})
4040
endfunction()
4141

42-
function(inference_analysis_python_api_int8_test_mkldnn target model_dir
42+
function(inference_analysis_python_api_int8_test_onednn target model_dir
4343
data_path filename)
4444
_inference_analysis_python_api_int8_test(${target} ${model_dir} ${data_path}
4545
${filename} True)
@@ -271,7 +271,7 @@ if(LINUX AND WITH_ONEDNN)
271271
${QUANT_RESNET50_MODEL_DIR} ${QUANT_RESNET50_MODEL_ARCHIVE}
272272
ff89b934ab961c3a4a844193ece2e8a7)
273273
inference_quant_int8_image_classification_test(
274-
test_quant_int8_resnet50_mkldnn ${QUANT_RESNET50_MODEL_DIR}/model
274+
test_quant_int8_resnet50_onednn ${QUANT_RESNET50_MODEL_DIR}/model
275275
${IMAGENET_DATA_PATH})
276276

277277
# Quant ResNet101
@@ -281,7 +281,7 @@ if(LINUX AND WITH_ONEDNN)
281281
${QUANT_RESNET101_MODEL_DIR} ${QUANT_RESNET101_MODEL_ARCHIVE}
282282
95c6d01e3aeba31c13efb2ba8057d558)
283283
# inference_quant_int8_image_classification_test( \
284-
# test_quant_int8_resnet101_mkldnn \
284+
# test_quant_int8_resnet101_onednn \
285285
# ${QUANT_RESNET101_MODEL_DIR}/model \
286286
# ${IMAGENET_DATA_PATH})
287287

@@ -292,7 +292,7 @@ if(LINUX AND WITH_ONEDNN)
292292
${QUANT_GOOGLENET_MODEL_DIR} ${QUANT_GOOGLENET_MODEL_ARCHIVE}
293293
1d4a7383baa63e7d1c423e8db2b791d5)
294294
#inference_quant_int8_image_classification_test(
295-
# test_quant_int8_googlenet_mkldnn ${QUANT_GOOGLENET_MODEL_DIR}/model
295+
# test_quant_int8_googlenet_onednn ${QUANT_GOOGLENET_MODEL_DIR}/model
296296
# ${IMAGENET_DATA_PATH})
297297

298298
# Quant MobileNetV1
@@ -309,7 +309,7 @@ if(LINUX AND WITH_ONEDNN)
309309
${QUANT_MOBILENETV2_MODEL_DIR} ${QUANT_MOBILENETV2_MODEL_ARCHIVE}
310310
758a99d9225d8b73e1a8765883f96cdd)
311311
inference_quant_int8_image_classification_test(
312-
test_quant_int8_mobilenetv2_mkldnn ${QUANT_MOBILENETV2_MODEL_DIR}/model
312+
test_quant_int8_mobilenetv2_onednn ${QUANT_MOBILENETV2_MODEL_DIR}/model
313313
${IMAGENET_DATA_PATH})
314314

315315
# Quant VGG16
@@ -318,7 +318,7 @@ if(LINUX AND WITH_ONEDNN)
318318
download_quant_model(${QUANT_VGG16_MODEL_DIR} ${QUANT_VGG16_MODEL_ARCHIVE}
319319
c37e63ca82a102f47be266f8068b0b55)
320320
# inference_quant_int8_image_classification_test( \
321-
# test_quant_int8_vgg16_mkldnn \
321+
# test_quant_int8_vgg16_onednn \
322322
# ${QUANT_VGG16_MODEL_DIR}/model \
323323
# ${IMAGENET_DATA_PATH})
324324

@@ -328,7 +328,7 @@ if(LINUX AND WITH_ONEDNN)
328328
download_quant_model(${QUANT_VGG19_MODEL_DIR} ${QUANT_VGG19_MODEL_ARCHIVE}
329329
62bcd4b6c3ca2af67e8251d1c96ea18f)
330330
# inference_quant_int8_image_classification_test( \
331-
# test_quant_int8_vgg19_mkldnn ${QUANT_VGG19_MODEL_DIR}/model \
331+
# test_quant_int8_vgg19_onednn ${QUANT_VGG19_MODEL_DIR}/model \
332332
# ${IMAGENET_DATA_PATH})
333333

334334
### Quant2 for image classification
@@ -420,15 +420,15 @@ if(LINUX AND WITH_ONEDNN)
420420
${QUANT2_INT8_LSTM_SAVE_PATH} ${QUANT2_FP32_LSTM_MODEL_ARCHIVE}
421421
eecd9f44d69a84acc1cf2235c4b8b743)
422422
inference_quant2_int8_lstm_model_test(
423-
test_quant2_int8_lstm_mkldnn ${QUANT2_INT8_LSTM_SAVE_PATH}/lstm_fp32_model
423+
test_quant2_int8_lstm_onednn ${QUANT2_INT8_LSTM_SAVE_PATH}/lstm_fp32_model
424424
${QUANT2_LSTM_MODEL_DIR}/lstm_quant
425425
${QUANT2_INT8_LSTM_SAVE_PATH}/quant_lstm_input_data)
426426

427427
endif()
428428

429429
# Since the tests for Quant & INT8 comparison support only testing on Linux
430-
# with MKL-DNN, we remove it here to not test it on other systems.
431-
list(REMOVE_ITEM TEST_OPS test_mkldnn_int8_quantization_strategy
430+
# with One-DNN, we remove it here to not test it on other systems.
431+
list(REMOVE_ITEM TEST_OPS test_onednn_int8_quantization_strategy
432432
quant_int8_image_classification_comparison quant_int8_nlp_comparison)
433433

434434
#TODO(wanghaoshuang): Fix this unittest failed on GCC8.
@@ -477,11 +477,11 @@ set_tests_properties(test_imperative_qat_channelwise PROPERTIES TIMEOUT 200)
477477
set_tests_properties(test_imperative_out_scale PROPERTIES TIMEOUT 200)
478478
set_tests_properties(test_imperative_skip_op PROPERTIES TIMEOUT 300)
479479
if(LINUX AND WITH_ONEDNN)
480-
set_tests_properties(test_quant_int8_mobilenetv2_mkldnn PROPERTIES TIMEOUT
480+
set_tests_properties(test_quant_int8_mobilenetv2_onednn PROPERTIES TIMEOUT
481481
120)
482-
set_tests_properties(test_quant_int8_resnet50_mkldnn PROPERTIES TIMEOUT 120)
483-
#set_tests_properties(test_quant_int8_googlenet_mkldnn PROPERTIES TIMEOUT 120)
484-
set_tests_properties(test_quant2_int8_lstm_mkldnn PROPERTIES TIMEOUT 120)
482+
set_tests_properties(test_quant_int8_resnet50_onednn PROPERTIES TIMEOUT 120)
483+
#set_tests_properties(test_quant_int8_googlenet_onednn PROPERTIES TIMEOUT 120)
484+
set_tests_properties(test_quant2_int8_lstm_onednn PROPERTIES TIMEOUT 120)
485485
endif()
486486

487487
if(APPLE)

test/white_list/pir_op_test_white_list

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
test_accuracy_op
2-
test_activation_bf16_mkldnn_op
2+
test_activation_bf16_onednn_op
33
test_activation_op
44
test_activation_op_zero_size
55
test_adadelta_op
@@ -42,16 +42,16 @@ test_cholesky_op
4242
test_cholesky_solve_op
4343
test_class_center_sample_op
4444
test_clip_by_norm_op
45-
test_clip_mkldnn_op
45+
test_clip_onednn_op
4646
test_clip_op
4747
test_coalesce_tensor_op
4848
test_compare_op
4949
test_compare_reduce_op
5050
test_complex_abs
5151
test_complex_op
5252
test_complex_view_op
53-
test_concat_int8_mkldnn_op
54-
test_concat_mkldnn_op
53+
test_concat_int8_onednn_op
54+
test_concat_onednn_op
5555
test_concat_op
5656
test_conj_op
5757
test_conv2d_op
@@ -127,7 +127,7 @@ test_fusion_seqexpand_concat_fc_op
127127
test_fusion_transpose_flatten_concat_op
128128
test_gather_nd_op
129129
test_gather_tree_op
130-
test_gaussian_random_mkldnn_op
130+
test_gaussian_random_onednn_op
131131
test_gaussian_random_op
132132
test_generate_proposals_v2_op
133133
test_graph_send_recv_op
@@ -215,7 +215,7 @@ test_polygamma_op
215215
test_pool2d_op
216216
test_pool3d_op
217217
test_pool_max_op
218-
test_prelu_mkldnn_op
218+
test_prelu_onednn_op
219219
test_prelu_op
220220
test_prior_box_op
221221
test_psroi_pool_op
@@ -245,7 +245,7 @@ test_segment_ops
245245
test_segment_ops_static_build
246246
test_selu_op
247247
test_sgd_op
248-
test_shape_mkldnn_op
248+
test_shape_onednn_op
249249
test_shape_op
250250
test_shard_index_op
251251
test_shuffle_batch_op
@@ -260,20 +260,20 @@ test_solve_op
260260
test_sparse_momentum_op
261261
test_spectral_norm_op
262262
test_spectral_op
263-
test_split_mkldnn_op
263+
test_split_onednn_op
264264
test_split_op
265265
test_squared_l2_norm_op
266266
test_squeeze2_op
267-
test_sum_mkldnn_op
267+
test_sum_onednn_op
268268
test_svd_op
269269
test_take_along_axis_op
270270
test_tdm_sampler_op
271271
test_temporal_shift_op
272272
test_tile_op
273273
test_top_k_v2_op
274274
test_trace_op
275-
test_transpose_bf16_mkldnn_op
276-
test_transpose_int8_mkldnn_op
275+
test_transpose_bf16_onednn_op
276+
test_transpose_int8_onednn_op
277277
test_transpose_op
278278
test_triangular_solve_op
279279
test_tril_indices_op

tools/get_quick_disable_lt.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def download_file():
103103
external_xpu = external_xpu + "|" + local_list
104104
disabled_ut_list = disabled_ut_list + "|" + external_xpu
105105

106+
# change mkldnn to onednn tests
107+
disabled_ut_list = disabled_ut_list.replace("_mkldnn", "_onednn")
108+
106109
print(disabled_ut_list)
107110
sys.exit(0)
108111

tools/windows/run_unittests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ disable_wingpu_cuda12_test="^test_cholesky_op$|\
151151
^test_onednn_conv_mish_fuse_pass$|\
152152
^test_onednn_conv_transpose_bias_fuse_pass$|\
153153
^test_onednn_depthwise_conv_pass$|\
154-
^test_mkldnn_matmul_elementwise_add_fuse_pass$|\
154+
^test_onednn_matmul_elementwise_add_fuse_pass$|\
155155
^test_onednn_matmul_v2_elementwise_add_fuse_pass$|\
156156
^test_onednn_matmul_v2_transpose_reshape_fuse_pass$|\
157157
^test_onednn_mish_op$|\
@@ -352,7 +352,7 @@ disable_win_inference_test="^trt_quant_int8_yolov3_r50_test$|\
352352
^test_variable$|\
353353
^test_onednn_conv_hard_sigmoid_fuse_pass$|\
354354
^test_onednn_conv_hard_swish_fuse_pass$|\
355-
^test_conv_act_mkldnn_fuse_pass$|\
355+
^test_conv_act_onednn_fuse_pass$|\
356356
^test_matmul_scale_fuse_pass$|\
357357
^test_addmm_op$|\
358358
^test_inverse_op$|\

0 commit comments

Comments
 (0)