diff --git a/test/cpp/inference/api/CMakeLists.txt b/test/cpp/inference/api/CMakeLists.txt index 1fa338e3e3d76..bb104950eb7a5 100644 --- a/test/cpp/inference/api/CMakeLists.txt +++ b/test/cpp/inference/api/CMakeLists.txt @@ -583,7 +583,7 @@ if(WITH_TESTING AND WITH_INFERENCE_API_TEST) # Quant2 MobileNetV1 inference_analysis_api_quant_test_run( - test_analyzer_quant2_mobilenetv1_mkldnn + test_analyzer_quant2_mobilenetv1_onednn ${QUANT_IMG_CLASS_TEST_APP} ${QUANT2_MobileNetV1_MODEL_DIR}/MobileNet_qat_perf/float ${QUANT2_MobileNetV1_MODEL_DIR}/MobileNet_qat_perf/float @@ -604,7 +604,7 @@ if(WITH_TESTING AND WITH_INFERENCE_API_TEST) set(QUANT2_RESNET50_MODEL ${QUANT2_RESNET50_CHANNELWISE_MODEL_DIR}/ResNet50_qat_channelwise) inference_analysis_api_quant_test_run( - test_analyzer_quant2_resnet50_channelwise_mkldnn + test_analyzer_quant2_resnet50_channelwise_onednn ${QUANT_IMG_CLASS_TEST_APP} ${QUANT2_RESNET50_MODEL} ${QUANT2_RESNET50_MODEL} ${IMAGENET_DATA_PATH} true) @@ -1016,9 +1016,9 @@ if(WITH_TESTING AND WITH_INFERENCE_API_TEST) if(WITH_ONEDNN) set_tests_properties(test_analyzer_quant_performance_benchmark PROPERTIES TIMEOUT 120) - set_tests_properties(test_analyzer_quant2_mobilenetv1_mkldnn + set_tests_properties(test_analyzer_quant2_mobilenetv1_onednn PROPERTIES TIMEOUT 120) - set_tests_properties(test_analyzer_quant2_resnet50_channelwise_mkldnn + set_tests_properties(test_analyzer_quant2_resnet50_channelwise_onednn PROPERTIES TIMEOUT 120) endif() diff --git a/test/ir/inference/CMakeLists.txt b/test/ir/inference/CMakeLists.txt index 1eb5d7b852aa7..9467475378f55 100755 --- a/test/ir/inference/CMakeLists.txt +++ b/test/ir/inference/CMakeLists.txt @@ -117,15 +117,6 @@ if(WITH_GPU AND TENSORRT_FOUND) endforeach() endif() -file( - GLOB TEST_MKLDNN_IR_PASSES - RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" - "test_mkldnn_*.py") -string(REPLACE ".py" "" TEST_MKLDNN_IR_PASSES "${TEST_MKLDNN_IR_PASSES}") -foreach(TEST_INFERENCE_IR_PASS ${TEST_MKLDNN_IR_PASSES}) - list(REMOVE_ITEM TEST_INFERENCE_IR_PASSES ${TEST_INFERENCE_IR_PASS}) -endforeach() - file( GLOB TEST_ONEDNN_IR_PASSES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" @@ -138,11 +129,6 @@ endforeach() if(WIN32 AND WIN_UNITTEST_LEVEL LESS 2) message(STATUS "Skip tests unrelated to CUDA/TRT") elseif(WITH_ONEDNN) - foreach(target ${TEST_MKLDNN_IR_PASSES}) - py_test_modules(${target} MODULES ${target}) - set_tests_properties(${target} PROPERTIES LABELS "RUN_TYPE=INFER") - endforeach() - foreach(target ${TEST_ONEDNN_IR_PASSES}) py_test_modules(${target} MODULES ${target}) set_tests_properties(${target} PROPERTIES LABELS "RUN_TYPE=INFER") @@ -305,8 +291,7 @@ endif() if(WIN32 AND WIN_UNITTEST_LEVEL LESS 2) message(STATUS "Skip tests unrelated to CUDA/TRT") elseif(WITH_ONEDNN) - - set(PIR_COVERAGE_MKLDNN_TESTS + set(PIR_COVERAGE_ONEDNN_TESTS test_onednn_conv_affine_channel_fuse_pass test_onednn_conv_gelu_fuse_pass test_onednn_conv_hard_sigmoid_fuse_pass @@ -316,14 +301,7 @@ elseif(WITH_ONEDNN) test_onednn_conv3d_op test_onednn_depthwise_conv_pass test_onednn_shape_op - test_onednn_shuffle_channel_op) - foreach(target ${PIR_COVERAGE_MKLDNN_TESTS}) - py_test_modules(${target}_pir MODULES ${target} ENVS FLAGS_enable_pir_api=1) - set_tests_properties(${target} PROPERTIES LABELS "RUN_TYPE=INFER") - message(STATUS "PIR Copied Test: ${target}_pir in inference test") - endforeach() - - set(PIR_COVERAGE_ONEDNN_TESTS + test_onednn_shuffle_channel_op test_onednn_batch_norm_act_fuse_pass test_onednn_conv_bias_fuse_pass test_onednn_conv_bn_fuse_pass diff --git a/test/ir/inference/test_mkldnn_matmul_elementwise_add_fuse_pass.py b/test/ir/inference/test_onednn_matmul_elementwise_add_fuse_pass.py similarity index 97% rename from test/ir/inference/test_mkldnn_matmul_elementwise_add_fuse_pass.py rename to test/ir/inference/test_onednn_matmul_elementwise_add_fuse_pass.py index dd71be8461bca..fb2d8e4c5460f 100644 --- a/test/ir/inference/test_mkldnn_matmul_elementwise_add_fuse_pass.py +++ b/test/ir/inference/test_onednn_matmul_elementwise_add_fuse_pass.py @@ -18,9 +18,11 @@ import hypothesis.strategies as st import numpy as np from auto_scan_test import PassAutoScanTest +from op_test import OpTestTool from program_config import OpConfig, ProgramConfig, TensorConfig +@OpTestTool.skip_if_not_cpu() class TestMatmulElementwiseAddOnednnFusePass(PassAutoScanTest): def sample_program_config(self, draw): axis = draw(st.sampled_from([-1, 0, 1])) @@ -84,7 +86,8 @@ def test(self): ) -class TestMatmulElementwiseAddMkldnnFuse1CHWPass(PassAutoScanTest): +@OpTestTool.skip_if_not_cpu() +class TestMatmulElementwiseAddOnednnFuse1CHWPass(PassAutoScanTest): def sample_program_config(self, draw): axis = draw(st.sampled_from([-1, 0, 1])) matmul_as_x = draw(st.booleans()) @@ -147,6 +150,7 @@ def test(self): ) +@OpTestTool.skip_if_not_cpu() class TestMatmulElementwiseAddExpendResidualPass(PassAutoScanTest): def sample_program_config(self, draw): axis = draw(st.sampled_from([0])) diff --git a/test/quantization/CMakeLists.txt b/test/quantization/CMakeLists.txt index c2f533b9b31d8..59e642e812840 100644 --- a/test/quantization/CMakeLists.txt +++ b/test/quantization/CMakeLists.txt @@ -39,7 +39,7 @@ function(inference_analysis_python_api_int8_test_custom_warmup_batch_size ${filename}) endfunction() -function(inference_analysis_python_api_int8_test_mkldnn target model_dir +function(inference_analysis_python_api_int8_test_onednn target model_dir data_path filename) _inference_analysis_python_api_int8_test(${target} ${model_dir} ${data_path} ${filename} True) @@ -271,7 +271,7 @@ if(LINUX AND WITH_ONEDNN) ${QUANT_RESNET50_MODEL_DIR} ${QUANT_RESNET50_MODEL_ARCHIVE} ff89b934ab961c3a4a844193ece2e8a7) inference_quant_int8_image_classification_test( - test_quant_int8_resnet50_mkldnn ${QUANT_RESNET50_MODEL_DIR}/model + test_quant_int8_resnet50_onednn ${QUANT_RESNET50_MODEL_DIR}/model ${IMAGENET_DATA_PATH}) # Quant ResNet101 @@ -281,7 +281,7 @@ if(LINUX AND WITH_ONEDNN) ${QUANT_RESNET101_MODEL_DIR} ${QUANT_RESNET101_MODEL_ARCHIVE} 95c6d01e3aeba31c13efb2ba8057d558) # inference_quant_int8_image_classification_test( \ - # test_quant_int8_resnet101_mkldnn \ + # test_quant_int8_resnet101_onednn \ # ${QUANT_RESNET101_MODEL_DIR}/model \ # ${IMAGENET_DATA_PATH}) @@ -292,7 +292,7 @@ if(LINUX AND WITH_ONEDNN) ${QUANT_GOOGLENET_MODEL_DIR} ${QUANT_GOOGLENET_MODEL_ARCHIVE} 1d4a7383baa63e7d1c423e8db2b791d5) #inference_quant_int8_image_classification_test( - # test_quant_int8_googlenet_mkldnn ${QUANT_GOOGLENET_MODEL_DIR}/model + # test_quant_int8_googlenet_onednn ${QUANT_GOOGLENET_MODEL_DIR}/model # ${IMAGENET_DATA_PATH}) # Quant MobileNetV1 @@ -309,7 +309,7 @@ if(LINUX AND WITH_ONEDNN) ${QUANT_MOBILENETV2_MODEL_DIR} ${QUANT_MOBILENETV2_MODEL_ARCHIVE} 758a99d9225d8b73e1a8765883f96cdd) inference_quant_int8_image_classification_test( - test_quant_int8_mobilenetv2_mkldnn ${QUANT_MOBILENETV2_MODEL_DIR}/model + test_quant_int8_mobilenetv2_onednn ${QUANT_MOBILENETV2_MODEL_DIR}/model ${IMAGENET_DATA_PATH}) # Quant VGG16 @@ -318,7 +318,7 @@ if(LINUX AND WITH_ONEDNN) download_quant_model(${QUANT_VGG16_MODEL_DIR} ${QUANT_VGG16_MODEL_ARCHIVE} c37e63ca82a102f47be266f8068b0b55) # inference_quant_int8_image_classification_test( \ - # test_quant_int8_vgg16_mkldnn \ + # test_quant_int8_vgg16_onednn \ # ${QUANT_VGG16_MODEL_DIR}/model \ # ${IMAGENET_DATA_PATH}) @@ -328,7 +328,7 @@ if(LINUX AND WITH_ONEDNN) download_quant_model(${QUANT_VGG19_MODEL_DIR} ${QUANT_VGG19_MODEL_ARCHIVE} 62bcd4b6c3ca2af67e8251d1c96ea18f) # inference_quant_int8_image_classification_test( \ - # test_quant_int8_vgg19_mkldnn ${QUANT_VGG19_MODEL_DIR}/model \ + # test_quant_int8_vgg19_onednn ${QUANT_VGG19_MODEL_DIR}/model \ # ${IMAGENET_DATA_PATH}) ### Quant2 for image classification @@ -420,15 +420,15 @@ if(LINUX AND WITH_ONEDNN) ${QUANT2_INT8_LSTM_SAVE_PATH} ${QUANT2_FP32_LSTM_MODEL_ARCHIVE} eecd9f44d69a84acc1cf2235c4b8b743) inference_quant2_int8_lstm_model_test( - test_quant2_int8_lstm_mkldnn ${QUANT2_INT8_LSTM_SAVE_PATH}/lstm_fp32_model + test_quant2_int8_lstm_onednn ${QUANT2_INT8_LSTM_SAVE_PATH}/lstm_fp32_model ${QUANT2_LSTM_MODEL_DIR}/lstm_quant ${QUANT2_INT8_LSTM_SAVE_PATH}/quant_lstm_input_data) endif() # Since the tests for Quant & INT8 comparison support only testing on Linux -# with MKL-DNN, we remove it here to not test it on other systems. -list(REMOVE_ITEM TEST_OPS test_mkldnn_int8_quantization_strategy +# with One-DNN, we remove it here to not test it on other systems. +list(REMOVE_ITEM TEST_OPS test_onednn_int8_quantization_strategy quant_int8_image_classification_comparison quant_int8_nlp_comparison) #TODO(wanghaoshuang): Fix this unittest failed on GCC8. @@ -477,11 +477,11 @@ set_tests_properties(test_imperative_qat_channelwise PROPERTIES TIMEOUT 200) set_tests_properties(test_imperative_out_scale PROPERTIES TIMEOUT 200) set_tests_properties(test_imperative_skip_op PROPERTIES TIMEOUT 300) if(LINUX AND WITH_ONEDNN) - set_tests_properties(test_quant_int8_mobilenetv2_mkldnn PROPERTIES TIMEOUT + set_tests_properties(test_quant_int8_mobilenetv2_onednn PROPERTIES TIMEOUT 120) - set_tests_properties(test_quant_int8_resnet50_mkldnn PROPERTIES TIMEOUT 120) - #set_tests_properties(test_quant_int8_googlenet_mkldnn PROPERTIES TIMEOUT 120) - set_tests_properties(test_quant2_int8_lstm_mkldnn PROPERTIES TIMEOUT 120) + set_tests_properties(test_quant_int8_resnet50_onednn PROPERTIES TIMEOUT 120) + #set_tests_properties(test_quant_int8_googlenet_onednn PROPERTIES TIMEOUT 120) + set_tests_properties(test_quant2_int8_lstm_onednn PROPERTIES TIMEOUT 120) endif() if(APPLE) diff --git a/test/white_list/pir_op_test_white_list b/test/white_list/pir_op_test_white_list index e35e4c9dbe37d..f32b1010f40e8 100644 --- a/test/white_list/pir_op_test_white_list +++ b/test/white_list/pir_op_test_white_list @@ -1,5 +1,5 @@ test_accuracy_op -test_activation_bf16_mkldnn_op +test_activation_bf16_onednn_op test_activation_op test_activation_op_zero_size test_adadelta_op @@ -42,7 +42,7 @@ test_cholesky_op test_cholesky_solve_op test_class_center_sample_op test_clip_by_norm_op -test_clip_mkldnn_op +test_clip_onednn_op test_clip_op test_coalesce_tensor_op test_compare_op @@ -50,8 +50,8 @@ test_compare_reduce_op test_complex_abs test_complex_op test_complex_view_op -test_concat_int8_mkldnn_op -test_concat_mkldnn_op +test_concat_int8_onednn_op +test_concat_onednn_op test_concat_op test_conj_op test_conv2d_op @@ -127,7 +127,7 @@ test_fusion_seqexpand_concat_fc_op test_fusion_transpose_flatten_concat_op test_gather_nd_op test_gather_tree_op -test_gaussian_random_mkldnn_op +test_gaussian_random_onednn_op test_gaussian_random_op test_generate_proposals_v2_op test_graph_send_recv_op @@ -215,7 +215,7 @@ test_polygamma_op test_pool2d_op test_pool3d_op test_pool_max_op -test_prelu_mkldnn_op +test_prelu_onednn_op test_prelu_op test_prior_box_op test_psroi_pool_op @@ -245,7 +245,7 @@ test_segment_ops test_segment_ops_static_build test_selu_op test_sgd_op -test_shape_mkldnn_op +test_shape_onednn_op test_shape_op test_shard_index_op test_shuffle_batch_op @@ -260,11 +260,11 @@ test_solve_op test_sparse_momentum_op test_spectral_norm_op test_spectral_op -test_split_mkldnn_op +test_split_onednn_op test_split_op test_squared_l2_norm_op test_squeeze2_op -test_sum_mkldnn_op +test_sum_onednn_op test_svd_op test_take_along_axis_op test_tdm_sampler_op @@ -272,8 +272,8 @@ test_temporal_shift_op test_tile_op test_top_k_v2_op test_trace_op -test_transpose_bf16_mkldnn_op -test_transpose_int8_mkldnn_op +test_transpose_bf16_onednn_op +test_transpose_int8_onednn_op test_transpose_op test_triangular_solve_op test_tril_indices_op diff --git a/tools/get_quick_disable_lt.py b/tools/get_quick_disable_lt.py index 732d2801da4b2..0a8749af9bfa8 100644 --- a/tools/get_quick_disable_lt.py +++ b/tools/get_quick_disable_lt.py @@ -103,6 +103,9 @@ def download_file(): external_xpu = external_xpu + "|" + local_list disabled_ut_list = disabled_ut_list + "|" + external_xpu + # change mkldnn to onednn tests + disabled_ut_list = disabled_ut_list.replace("_mkldnn", "_onednn") + print(disabled_ut_list) sys.exit(0) diff --git a/tools/windows/run_unittests.sh b/tools/windows/run_unittests.sh index ace7c049e378e..1594f04692d9e 100644 --- a/tools/windows/run_unittests.sh +++ b/tools/windows/run_unittests.sh @@ -151,7 +151,7 @@ disable_wingpu_cuda12_test="^test_cholesky_op$|\ ^test_onednn_conv_mish_fuse_pass$|\ ^test_onednn_conv_transpose_bias_fuse_pass$|\ ^test_onednn_depthwise_conv_pass$|\ -^test_mkldnn_matmul_elementwise_add_fuse_pass$|\ +^test_onednn_matmul_elementwise_add_fuse_pass$|\ ^test_onednn_matmul_v2_elementwise_add_fuse_pass$|\ ^test_onednn_matmul_v2_transpose_reshape_fuse_pass$|\ ^test_onednn_mish_op$|\ @@ -352,7 +352,7 @@ disable_win_inference_test="^trt_quant_int8_yolov3_r50_test$|\ ^test_variable$|\ ^test_onednn_conv_hard_sigmoid_fuse_pass$|\ ^test_onednn_conv_hard_swish_fuse_pass$|\ -^test_conv_act_mkldnn_fuse_pass$|\ +^test_conv_act_onednn_fuse_pass$|\ ^test_matmul_scale_fuse_pass$|\ ^test_addmm_op$|\ ^test_inverse_op$|\