From c2c9be7f455afd48784e719d4e345bea685d084e Mon Sep 17 00:00:00 2001 From: co63oc Date: Wed, 13 Aug 2025 15:04:45 +0800 Subject: [PATCH] Fix --- paddle/fluid/framework/ir/auto_mixed_precision_pass.cc | 2 +- paddle/fluid/framework/ir/pass_test_util.cc | 4 ++-- paddle/fluid/framework/ir/pass_test_util.h | 6 +++--- paddle/fluid/framework/ir/pass_tester_helper.h | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/paddle/fluid/framework/ir/auto_mixed_precision_pass.cc b/paddle/fluid/framework/ir/auto_mixed_precision_pass.cc index fd12b6f9dbff07..e27f4ce97316e2 100644 --- a/paddle/fluid/framework/ir/auto_mixed_precision_pass.cc +++ b/paddle/fluid/framework/ir/auto_mixed_precision_pass.cc @@ -137,7 +137,7 @@ void DoInsertCastOp(Graph* graph, desc.SetAttr("in_dtype", in_dtype); desc.SetAttr("out_dtype", out_dtype); } - desc.SetAttr("use_mkldnn", false); + desc.SetAttr("use_onednn", false); desc.SetAttr("with_quant_attr", false); desc.Flush(); }; diff --git a/paddle/fluid/framework/ir/pass_test_util.cc b/paddle/fluid/framework/ir/pass_test_util.cc index 309f451e9da2df..254ba6943cca97 100644 --- a/paddle/fluid/framework/ir/pass_test_util.cc +++ b/paddle/fluid/framework/ir/pass_test_util.cc @@ -34,10 +34,10 @@ OpDesc* CreateOp(ProgramDesc* prog, const std::string& op_type_name, const std::vector& inputs, const std::vector& outputs, - bool use_mkldnn) { + bool use_onednn) { auto* op = prog->MutableBlock(0)->AppendOp(); op->SetType(op_type_name); - op->SetAttr("use_mkldnn", use_mkldnn); + op->SetAttr("use_onednn", use_onednn); for (const auto& input : inputs) { op->SetInput(input.first, {input.second}); diff --git a/paddle/fluid/framework/ir/pass_test_util.h b/paddle/fluid/framework/ir/pass_test_util.h index 54955c2ce97b43..588538384e2284 100644 --- a/paddle/fluid/framework/ir/pass_test_util.h +++ b/paddle/fluid/framework/ir/pass_test_util.h @@ -46,8 +46,8 @@ using OpTypeCountPair = std::pair; /// @param[in] inputs The vector of input pairs: {input_name, variable /// name} /// @param[in] outputs The vector of output pairs {output_name, variable} -/// @param[in] use_mkldnn The flag deciding whether or not to set -/// 'use_mkldnn' attribute. +/// @param[in] use_onednn The flag deciding whether or not to set +/// 'use_onednn' attribute. /// /// @return Returns pointer to the created operator descriptor. /// @@ -55,7 +55,7 @@ OpDesc* CreateOp(ProgramDesc* prog, const std::string& op_type_name, const std::vector& inputs, const std::vector& outputs, - bool use_mkldnn = true); + bool use_onednn = true); /// /// @brief Check whether node 'to' is reachable from node 'from' in graph. diff --git a/paddle/fluid/framework/ir/pass_tester_helper.h b/paddle/fluid/framework/ir/pass_tester_helper.h index d9f108dd8edb8b..1915d922a14388 100644 --- a/paddle/fluid/framework/ir/pass_tester_helper.h +++ b/paddle/fluid/framework/ir/pass_tester_helper.h @@ -286,11 +286,11 @@ struct Layers { VarDesc* out = nullptr, int x_num_col_dims = 1, int y_num_col_dims = 1, - bool use_mkldnn = false) { + bool use_onednn = false) { AttributeMap attrs; attrs["x_num_col_dims"] = x_num_col_dims; attrs["y_num_col_dims"] = y_num_col_dims; - attrs["use_mkldnn"] = use_mkldnn; + attrs["use_onednn"] = use_onednn; return binary_op("mul", x, y, out, &attrs); } @@ -298,10 +298,10 @@ struct Layers { VarDesc* y, VarDesc* out = nullptr, int axis = -1, - bool use_mkldnn = false) { + bool use_onednn = false) { AttributeMap attrs; attrs["axis"] = axis; - attrs["use_mkldnn"] = use_mkldnn; + attrs["use_onednn"] = use_onednn; return binary_op("elementwise_add", x, y, out, &attrs); }