Skip to content

Commit fe852a9

Browse files
authored
test/cpp rename use_mkldnn (#74501)
1 parent 8f77fa2 commit fe852a9

14 files changed

+36
-36
lines changed

test/cpp/eager/performance_tests/benchmark_utils.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ void benchmark_fluid_scale(const std::shared_ptr<imperative::VarBase>& X,
228228
imperative::Tracer tracer;
229229
framework::AttributeMap attrs;
230230

231-
attrs["use_mkldnn"] = false;
231+
attrs["use_onednn"] = false;
232232
attrs["scale"] = 2;
233233
attrs["bias"] = 3;
234234
attrs["bias_after_scale"] = true;

test/cpp/fluid/elementwise/test_elementwise_add_grad_grad.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class TestElementwiseAddGradGradWithoutDDX
5959
this->op_type_,
6060
{{"Y", {"Y"}}, {"DOut", {"DOut"}}, {"DDY", {"DDY"}}},
6161
{{"DDOut", {"DDOut"}}},
62-
{{"use_mkldnn", false}, {"axis", 0}});
62+
{{"use_onednn", false}, {"axis", 0}});
6363
return op;
6464
}
6565
};

test/cpp/fluid/elementwise/test_elementwise_div_grad_grad.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class TestElementwiseDivGradGradWithDout : public TestElementwiseOpGradGrad<T> {
8787
{"DDY", {"DDY"}},
8888
{"DX", {"DX"}}},
8989
{{"Y@GRAD", {"Y@GRAD"}}, {"DDOut", {"DDOut"}}, {"DOut", {"DOut"}}},
90-
{{"use_mkldnn", false}, {"axis", 0}});
90+
{{"use_onednn", false}, {"axis", 0}});
9191
return op;
9292
}
9393
};

test/cpp/fluid/mkldnn/test_conv_onednn_nhwc.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ TEST(test_conv2d_output, fp32) {
6666
conv2d_op.SetAttr("paddings", paddings);
6767
conv2d_op.SetAttr("dilations", dilations);
6868
conv2d_op.SetAttr("groups", groups);
69-
conv2d_op.SetAttr("use_mkldnn", true);
69+
conv2d_op.SetAttr("use_onednn", true);
7070

7171
auto op = paddle::framework::OpRegistry::CreateOp(conv2d_op);
7272

@@ -95,7 +95,7 @@ TEST(test_conv2d_output, int8) {
9595
conv2d_op.SetAttr("paddings", paddings);
9696
conv2d_op.SetAttr("dilations", dilations);
9797
conv2d_op.SetAttr("groups", groups);
98-
conv2d_op.SetAttr("use_mkldnn", true);
98+
conv2d_op.SetAttr("use_onednn", true);
9999
conv2d_op.SetAttr("mkldnn_data_type", std::string("int8"));
100100
conv2d_op.SetAttr("force_fp32_output", false);
101101

@@ -126,7 +126,7 @@ TEST(test_conv2d_output, ic1) {
126126
conv2d_op.SetAttr("paddings", paddings);
127127
conv2d_op.SetAttr("dilations", dilations);
128128
conv2d_op.SetAttr("groups", groups);
129-
conv2d_op.SetAttr("use_mkldnn", true);
129+
conv2d_op.SetAttr("use_onednn", true);
130130

131131
auto op = paddle::framework::OpRegistry::CreateOp(conv2d_op);
132132

@@ -156,7 +156,7 @@ TEST(test_conv2d_output, ic2) {
156156
conv2d_op.SetAttr("paddings", paddings);
157157
conv2d_op.SetAttr("dilations", dilations);
158158
conv2d_op.SetAttr("groups", groups);
159-
conv2d_op.SetAttr("use_mkldnn", true);
159+
conv2d_op.SetAttr("use_onednn", true);
160160

161161
auto op = paddle::framework::OpRegistry::CreateOp(conv2d_op);
162162

@@ -186,7 +186,7 @@ TEST(test_conv2d_output, ic4) {
186186
conv2d_op.SetAttr("paddings", paddings);
187187
conv2d_op.SetAttr("dilations", dilations);
188188
conv2d_op.SetAttr("groups", groups);
189-
conv2d_op.SetAttr("use_mkldnn", true);
189+
conv2d_op.SetAttr("use_onednn", true);
190190

191191
auto op = paddle::framework::OpRegistry::CreateOp(conv2d_op);
192192

test/cpp/fluid/mkldnn/test_onednn_caching.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,12 @@ void RunOperator(const phi::Place &place,
115115
{{first_input_var_name, {first_input}},
116116
{second_input_var_name, {"x1"}}},
117117
{{output_var_name, {output_name}}},
118-
{{"use_mkldnn", {true}}})
118+
{{"use_onednn", {true}}})
119119
: framework::OpRegistry::CreateOp(
120120
op_type,
121121
{{first_input_var_name, {first_input}}},
122122
{{output_var_name, {output_name}}},
123-
{{"use_mkldnn", {true}}});
123+
{{"use_onednn", {true}}});
124124

125125
op->Run(scope, place);
126126
pool.Get(place)->Wait();

test/cpp/fluid/mkldnn/test_onednn_conv2d_transpose_bias.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ void test_conv2d_transpose_bias() {
6161
AddVarToScope<float>("convtranspose-Bias", &scope, {256});
6262
AddVarToScope<float>("convtranspose-Out", &scope, {1, 256, 27, 23});
6363

64-
desc.SetAttr("use_mkldnn", true);
64+
desc.SetAttr("use_onednn", true);
6565
desc.SetAttr("is_test", true);
6666

6767
auto op = paddle::framework::OpRegistry::CreateOp(desc);

test/cpp/fluid/mkldnn/test_onednn_op_inplace.cc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ bool TestMain(const phi::Place &place,
8787
? framework::OpRegistry::CreateOp(op_type,
8888
{{"X", {"x"}}, {"Y", {"x1"}}},
8989
{{"Out", {"y"}}},
90-
{{"use_mkldnn", {true}}})
90+
{{"use_onednn", {true}}})
9191
: framework::OpRegistry::CreateOp(op_type,
9292
{{"X", {"x"}}},
9393
{{"Out", {"y"}}},
94-
{{"use_mkldnn", {true}}});
94+
{{"use_onednn", {true}}});
9595

9696
op_ref->Run(scope, place);
9797
pool.Get(place)->Wait();
@@ -104,11 +104,11 @@ bool TestMain(const phi::Place &place,
104104
? framework::OpRegistry::CreateOp(op_type,
105105
{{"X", {"x"}}, {"Y", {"x1"}}},
106106
{{"Out", {"x"}}},
107-
{{"use_mkldnn", {true}}})
107+
{{"use_onednn", {true}}})
108108
: framework::OpRegistry::CreateOp(op_type,
109109
{{"X", {"x"}}},
110110
{{"Out", {"x"}}},
111-
{{"use_mkldnn", {true}}});
111+
{{"use_onednn", {true}}});
112112

113113
op->Run(scope, place);
114114
phi::DeviceContextPool::Instance().Get(place)->Wait();

test/cpp/fluid/mkldnn/test_onednn_op_nhwc.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void Test_Pool2d_Transpose_NHWC(const std::string &transpose_type) {
6767
{{"pooling_type", {std::string("max")}},
6868
{"ksize", {ksize}},
6969
{"data_format", {std::string("NHWC")}},
70-
{"use_mkldnn", {true}}});
70+
{"use_onednn", {true}}});
7171

7272
auto axis = std::vector<int>(4, 0);
7373
axis[1] = 2;
@@ -77,7 +77,7 @@ void Test_Pool2d_Transpose_NHWC(const std::string &transpose_type) {
7777
transpose_type,
7878
{{"X", {"y"}}},
7979
{{"Out", {"z"}}},
80-
{{"axis", {axis}}, {"use_mkldnn", {true}}});
80+
{{"axis", {axis}}, {"use_onednn", {true}}});
8181

8282
op_pool->Run(scope, p);
8383
op_transpose->Run(scope, p);
@@ -130,7 +130,7 @@ TEST(test_pool2d_relu_relu_nhwc, cpu_place) {
130130
{{"pooling_type", {std::string("max")}},
131131
{"ksize", {ksize}},
132132
{"data_format", {std::string("NHWC")}},
133-
{"use_mkldnn", {true}}});
133+
{"use_onednn", {true}}});
134134

135135
auto axis = std::vector<int>(4, 0);
136136
axis[1] = 2;
@@ -140,10 +140,10 @@ TEST(test_pool2d_relu_relu_nhwc, cpu_place) {
140140
"relu",
141141
{{"X", {"y"}}},
142142
{{"Out", {"u"}}},
143-
{{"axis", {axis}}, {"use_mkldnn", {false}}});
143+
{{"axis", {axis}}, {"use_onednn", {false}}});
144144

145145
auto op_relu2 = framework::OpRegistry::CreateOp(
146-
"relu", {{"X", {"u"}}}, {{"Out", {"z"}}}, {{"use_mkldnn", {true}}});
146+
"relu", {{"X", {"u"}}}, {{"Out", {"z"}}}, {{"use_onednn", {true}}});
147147

148148
op_pool->Run(scope, p);
149149
op_relu1->Run(scope, p);
@@ -192,10 +192,10 @@ TEST(test_pool2d_shape_nhwc, cpu_place) {
192192
{{"pooling_type", {std::string("max")}},
193193
{"ksize", {ksize}},
194194
{"data_format", {std::string("NHWC")}},
195-
{"use_mkldnn", {true}}});
195+
{"use_onednn", {true}}});
196196

197197
auto op_shape = framework::OpRegistry::CreateOp(
198-
"shape", {{"Input", {"y"}}}, {{"Out", {"z"}}}, {{"use_mkldnn", {true}}});
198+
"shape", {{"Input", {"y"}}}, {{"Out", {"z"}}}, {{"use_onednn", {true}}});
199199

200200
op_pool->Run(scope, p);
201201
op_shape->Run(scope, p);

test/cpp/fluid/mkldnn/test_onednn_pool_adaptive_op.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ void test_pool2d(bool adaptive, bool ceil_mode, std::string pool_type = "max") {
6767
desc.SetAttr("paddings", paddings);
6868
desc.SetAttr("adaptive", adaptive);
6969
desc.SetAttr("ceil_mode", ceil_mode);
70-
desc.SetAttr("use_mkldnn", true);
70+
desc.SetAttr("use_onednn", true);
7171

7272
auto op = paddle::framework::OpRegistry::CreateOp(desc);
7373

test/cpp/fluid/mkldnn/test_onednn_squeeze.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void test_squeeze() {
6262
std::vector<int> axes({-2});
6363

6464
desc.SetAttr("axes", axes);
65-
desc.SetAttr("use_mkldnn", true);
65+
desc.SetAttr("use_onednn", true);
6666

6767
auto op = paddle::framework::OpRegistry::CreateOp(desc);
6868

@@ -86,7 +86,7 @@ void test_squeeze2() {
8686
std::vector<int> axes({-1});
8787

8888
desc.SetAttr("axes", axes);
89-
desc.SetAttr("use_mkldnn", true);
89+
desc.SetAttr("use_onednn", true);
9090

9191
auto op = paddle::framework::OpRegistry::CreateOp(desc);
9292

0 commit comments

Comments
 (0)