Skip to content

Commit 6cc689d

Browse files
co63ocHz188
authored andcommitted
test/ directory modify MKLDNN [fluid_ops] (PaddlePaddle#74678)
* Fix * fix
1 parent 810b588 commit 6cc689d

File tree

8 files changed

+19
-16
lines changed

8 files changed

+19
-16
lines changed

test/cpp/fluid/mkldnn/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ paddle_test(test_onednn_cpu_quantize_pass SRCS test_onednn_cpu_quantize_pass.cc)
44

55
paddle_test(test_conv_onednn_nhwc SRCS test_conv_onednn_nhwc.cc)
66

7-
set(TEST_MKLDNN_CACHING_DEPS
7+
set(TEST_ONEDNN_CACHING_DEPS
88
op_registry
99
elementwise_mul_op
1010
elementwise_add_op
@@ -16,7 +16,7 @@ set(TEST_MKLDNN_CACHING_DEPS
1616
generated_static_op)
1717

1818
if(WITH_GPU OR WITH_ROCM)
19-
set(TEST_MKLDNN_CACHING_DEPS ${TEST_MKLDNN_CACHING_DEPS} depthwise_conv)
19+
set(TEST_ONEDNN_CACHING_DEPS ${TEST_ONEDNN_CACHING_DEPS} depthwise_conv)
2020
endif()
2121
paddle_test(test_onednn_caching SRCS test_onednn_caching.cc)
2222

test/ir/inference/inference_pass_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def _get_analysis_config(
188188
def check_output(self, atol=1e-5):
189189
'''
190190
Check whether calculating on CPU and GPU, enable TensorRT
191-
or disable TensorRT, enable MKLDNN or disable MKLDNN
191+
or disable TensorRT, enable ONEDNN or disable ONEDNN
192192
are all the same.
193193
'''
194194
self.assertFalse(
@@ -203,7 +203,7 @@ def check_output_with_option(
203203
):
204204
'''
205205
Check whether calculating on CPU and GPU, enable TensorRT
206-
or disable TensorRT, enable MKLDNN or disable MKLDNN
206+
or disable TensorRT, enable ONEDNN or disable ONEDNN
207207
are all the same.
208208
'''
209209
place = base.CUDAPlace(0) if use_gpu else base.CPUPlace()
@@ -295,7 +295,7 @@ def check_output_with_option(
295295

296296
self.assertTrue(
297297
len(paddle_outs) == len(onednn_outputs),
298-
"The number of outputs is different between CPU and MKLDNN. ",
298+
"The number of outputs is different between CPU and ONEDNN. ",
299299
)
300300

301301
if self.enable_onednn_bfloat16:
@@ -306,7 +306,7 @@ def check_output_with_option(
306306
onednn_output,
307307
rtol=1e-05,
308308
atol=atol,
309-
err_msg='Output has diff between CPU and MKLDNN. ',
309+
err_msg='Output has diff between CPU and ONEDNN. ',
310310
)
311311

312312
class TensorRTParam:

test/ir/inference/quant_dequant_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def check_output_with_option(
242242
):
243243
'''
244244
Check whether calculating on CPU and GPU, enable TensorRT
245-
or disable TensorRT, enable MKLDNN or disable MKLDNN
245+
or disable TensorRT, enable ONEDNN or disable ONEDNN
246246
are all the same.
247247
'''
248248
place = paddle.CUDAPlace(0) if use_gpu else paddle.CPUPlace()
@@ -397,7 +397,7 @@ def check_output_with_option(
397397

398398
self.assertTrue(
399399
len(paddle_outs) == len(onednn_outputs),
400-
"The number of outputs is different between CPU and MKLDNN. ",
400+
"The number of outputs is different between CPU and ONEDNN. ",
401401
)
402402

403403
if self.enable_onednn_bfloat16:
@@ -408,7 +408,7 @@ def check_output_with_option(
408408
onednn_output,
409409
rtol=1e-05,
410410
atol=atol,
411-
err_msg='Output has diff between CPU and MKLDNN. ',
411+
err_msg='Output has diff between CPU and ONEDNN. ',
412412
)
413413

414414
class TensorRTParam:

test/ir/inference/test_conv_eltwiseadd_bn_fuse_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def sample_predictor_configs(self, program_config):
4545
config = self.create_inference_config(use_gpu=False)
4646
yield config, ["conv2d", "elementwise_add"], (1e-4, 1e-5)
4747

48-
# MKLDNN
48+
# ONEDNN
4949
config = self.create_inference_config(use_gpu=False)
5050
config.enable_onednn()
5151
yield config, ["conv2d", "elementwise_add"], (1e-4, 1e-5)

test/ir/inference/test_mkldnn_depthwise_conv_pass.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
from program_config import OpConfig, ProgramConfig, TensorConfig
2121

2222

23-
class DepthwiseConvMKLDNNPass(PassAutoScanTest):
23+
class DepthwiseConvONEDNNPass(PassAutoScanTest):
2424
r'''
2525
conv_input conv_weight_var(persistable)
2626
\ /

test/ir/inference/test_mkldnn_log_softmax_op.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
from program_config import OpConfig, ProgramConfig, TensorConfig
2323

2424

25-
class TestMKLDNNLogSoftmaxOp(OnednnAutoScanTest):
25+
class TestONEDNNLogSoftmaxOp(OnednnAutoScanTest):
2626
def is_program_valid(self, program_config: ProgramConfig) -> bool:
2727
return True
2828

test/legacy_test/op_test.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,10 @@ def is_empty_grad_op(op_type):
516516
if is_onednn_op_test():
517517
grad_op_kernels = all_op_kernels[grad_op]
518518
for grad_op_kernel in grad_op_kernels:
519-
if 'MKLDNN' in grad_op_kernel:
519+
if (
520+
'MKLDNN' in grad_op_kernel
521+
or 'ONEDNN' in grad_op_kernel
522+
):
520523
return False
521524
else:
522525
return False

test/quantization/test_post_training_quantization_mobilenetv1.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -821,10 +821,10 @@ def test_post_training_onnx_format_mobilenetv1_tensorrt(self):
821821
)
822822

823823

824-
class TestPostTrainingKLONNXFormatForMobilenetv1MKLDNN(
824+
class TestPostTrainingKLONNXFormatForMobilenetv1ONEDNN(
825825
TestPostTrainingQuantization
826826
):
827-
def test_post_training_onnx_format_mobilenetv1_mkldnn(self):
827+
def test_post_training_onnx_format_mobilenetv1_onednn(self):
828828
model = "MobileNet-V1"
829829
algo = "ptf"
830830
round_type = "round"
@@ -843,7 +843,7 @@ def test_post_training_onnx_format_mobilenetv1_mkldnn(self):
843843
onnx_format = True
844844
diff_threshold = 0.05
845845
batch_nums = 12
846-
deploy_backend = "mkldnn"
846+
deploy_backend = "onednn"
847847
self.run_test(
848848
model,
849849
'inference.pdmodel',

0 commit comments

Comments
 (0)