From 77fd30551f067dab829796f5427b72e3dba26a4a Mon Sep 17 00:00:00 2001 From: co63oc Date: Sat, 9 Aug 2025 13:46:30 +0800 Subject: [PATCH 1/2] Fix --- python/paddle/static/quantization/quant_int8_onednn_pass.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/paddle/static/quantization/quant_int8_onednn_pass.py b/python/paddle/static/quantization/quant_int8_onednn_pass.py index 2387e8bd9b70f7..909a94427c9718 100644 --- a/python/paddle/static/quantization/quant_int8_onednn_pass.py +++ b/python/paddle/static/quantization/quant_int8_onednn_pass.py @@ -177,7 +177,7 @@ def _transform_to_conv_onednn(self, graph, op_node): conv_op_node.set_attr("Scale_weights", scale_w) conv_op_node.set_attr("Scale_in", scale_in) conv_op_node.set_attr("Scale_out", 1.0) - conv_op_node.set_attr("use_mkldnn", 1) + conv_op_node.set_attr("use_onednn", 1) conv_op_node.set_attr("force_fp32_output", 1) graph.link_to(input_var_node, conv_op_node) graph.link_to(weight_var_node, conv_op_node) @@ -223,7 +223,7 @@ def _transform_to_mul_onednn(self, graph, op_node): mul_op_node.set_attr("scale_y", scale_w) mul_op_node.set_attr("scale_x", scale_in) mul_op_node.set_attr("scale_out", 1.0) - mul_op_node.set_attr("use_mkldnn", 1) + mul_op_node.set_attr("use_onednn", 1) mul_op_node.set_attr("force_fp32_output", 1) graph.link_to(input_var_node, mul_op_node) graph.link_to(weight_var_node, mul_op_node) @@ -248,7 +248,7 @@ def _transform_to_quantize_onednn(self, graph, op_node): op_type='quantize', attrs={ 'data_format': 'ONEDNNLAYOUT', - 'use_mkldnn': 1, + 'use_onednn': 1, 'Scale': scale_in, 'is_negative_input': 1, }, From 5e662fce0139c9aaeb39d0a528e3540575ee52fe Mon Sep 17 00:00:00 2001 From: co63oc Date: Mon, 11 Aug 2025 13:10:56 +0800 Subject: [PATCH 2/2] Fix --- .../test_mkldnn_matmul_v2_elementwise_add_fuse_pass.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/ir/inference/test_mkldnn_matmul_v2_elementwise_add_fuse_pass.py b/test/ir/inference/test_mkldnn_matmul_v2_elementwise_add_fuse_pass.py index d6be1efaa34353..cf383495f52c42 100644 --- a/test/ir/inference/test_mkldnn_matmul_v2_elementwise_add_fuse_pass.py +++ b/test/ir/inference/test_mkldnn_matmul_v2_elementwise_add_fuse_pass.py @@ -53,7 +53,7 @@ def generate_input(type): type='matmul_v2', inputs={'X': ['matmul_X'], 'Y': ['matmul_Y']}, outputs={'Out': ['matmul_output']}, - attrs={'use_mkldnn': True}, + attrs={'use_onednn': True}, ) if matmul_as_x: @@ -65,7 +65,7 @@ def generate_input(type): type='elementwise_add', inputs=inputs, outputs={'Out': ['elementwise_add_output']}, - attrs={'axis': axis, 'use_mkldnn': True}, + attrs={'axis': axis, 'use_onednn': True}, ) model_net = [matmul_op, elt_add_op]