Skip to content

Commit 564b693

Browse files
authored
auto_mixed_precision_pass.cc modify use_mkldnn [fluid_ops] (#74549)
1 parent a5082be commit 564b693

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

paddle/fluid/framework/ir/auto_mixed_precision_pass.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void DoInsertCastOp(Graph* graph,
137137
desc.SetAttr("in_dtype", in_dtype);
138138
desc.SetAttr("out_dtype", out_dtype);
139139
}
140-
desc.SetAttr("use_mkldnn", false);
140+
desc.SetAttr("use_onednn", false);
141141
desc.SetAttr("with_quant_attr", false);
142142
desc.Flush();
143143
};

paddle/fluid/framework/ir/pass_test_util.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ OpDesc* CreateOp(ProgramDesc* prog,
3434
const std::string& op_type_name,
3535
const std::vector<InOutVarNamePair>& inputs,
3636
const std::vector<InOutVarNamePair>& outputs,
37-
bool use_mkldnn) {
37+
bool use_onednn) {
3838
auto* op = prog->MutableBlock(0)->AppendOp();
3939
op->SetType(op_type_name);
40-
op->SetAttr("use_mkldnn", use_mkldnn);
40+
op->SetAttr("use_onednn", use_onednn);
4141

4242
for (const auto& input : inputs) {
4343
op->SetInput(input.first, {input.second});

paddle/fluid/framework/ir/pass_test_util.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,16 @@ using OpTypeCountPair = std::pair<std::string, int>;
4646
/// @param[in] inputs The vector of input pairs: {input_name, variable
4747
/// name}
4848
/// @param[in] outputs The vector of output pairs {output_name, variable}
49-
/// @param[in] use_mkldnn The flag deciding whether or not to set
50-
/// 'use_mkldnn' attribute.
49+
/// @param[in] use_onednn The flag deciding whether or not to set
50+
/// 'use_onednn' attribute.
5151
///
5252
/// @return Returns pointer to the created operator descriptor.
5353
///
5454
OpDesc* CreateOp(ProgramDesc* prog,
5555
const std::string& op_type_name,
5656
const std::vector<InOutVarNamePair>& inputs,
5757
const std::vector<InOutVarNamePair>& outputs,
58-
bool use_mkldnn = true);
58+
bool use_onednn = true);
5959

6060
///
6161
/// @brief Check whether node 'to' is reachable from node 'from' in graph.

paddle/fluid/framework/ir/pass_tester_helper.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,22 +286,22 @@ struct Layers {
286286
VarDesc* out = nullptr,
287287
int x_num_col_dims = 1,
288288
int y_num_col_dims = 1,
289-
bool use_mkldnn = false) {
289+
bool use_onednn = false) {
290290
AttributeMap attrs;
291291
attrs["x_num_col_dims"] = x_num_col_dims;
292292
attrs["y_num_col_dims"] = y_num_col_dims;
293-
attrs["use_mkldnn"] = use_mkldnn;
293+
attrs["use_onednn"] = use_onednn;
294294
return binary_op("mul", x, y, out, &attrs);
295295
}
296296

297297
VarDesc* elementwise_add(VarDesc* x,
298298
VarDesc* y,
299299
VarDesc* out = nullptr,
300300
int axis = -1,
301-
bool use_mkldnn = false) {
301+
bool use_onednn = false) {
302302
AttributeMap attrs;
303303
attrs["axis"] = axis;
304-
attrs["use_mkldnn"] = use_mkldnn;
304+
attrs["use_onednn"] = use_onednn;
305305
return binary_op("elementwise_add", x, y, out, &attrs);
306306
}
307307

0 commit comments

Comments
 (0)