Skip to content

Commit 27fadad

Browse files
committed
Fix
1 parent e342884 commit 27fadad

File tree

151 files changed

+378
-381
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+378
-381
lines changed

python/paddle/static/quantization/quant_int8_onednn_pass.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def _transform_to_conv_onednn(self, graph, op_node):
177177
conv_op_node.set_attr("Scale_weights", scale_w)
178178
conv_op_node.set_attr("Scale_in", scale_in)
179179
conv_op_node.set_attr("Scale_out", 1.0)
180-
conv_op_node.set_attr("use_mkldnn", 1)
180+
conv_op_node.set_attr("use_onednn", 1)
181181
conv_op_node.set_attr("force_fp32_output", 1)
182182
graph.link_to(input_var_node, conv_op_node)
183183
graph.link_to(weight_var_node, conv_op_node)
@@ -223,7 +223,7 @@ def _transform_to_mul_onednn(self, graph, op_node):
223223
mul_op_node.set_attr("scale_y", scale_w)
224224
mul_op_node.set_attr("scale_x", scale_in)
225225
mul_op_node.set_attr("scale_out", 1.0)
226-
mul_op_node.set_attr("use_mkldnn", 1)
226+
mul_op_node.set_attr("use_onednn", 1)
227227
mul_op_node.set_attr("force_fp32_output", 1)
228228
graph.link_to(input_var_node, mul_op_node)
229229
graph.link_to(weight_var_node, mul_op_node)
@@ -248,7 +248,7 @@ def _transform_to_quantize_onednn(self, graph, op_node):
248248
op_type='quantize',
249249
attrs={
250250
'data_format': 'ONEDNNLAYOUT',
251-
'use_mkldnn': 1,
251+
'use_onednn': 1,
252252
'Scale': scale_in,
253253
'is_negative_input': 1,
254254
},

test/deprecated/cpp/inference/api/analysis_predictor_tester.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ TEST(AnalysisPredictor, bf16_gpu_pass_strategy) {
317317
config.SetModel(FLAGS_dirname);
318318
config.SwitchIrOptim(true);
319319
config.EnableUseGpu(100, 0);
320-
config.EnableMkldnnBfloat16();
320+
config.EnableOnednnBfloat16();
321321
#ifdef PADDLE_WITH_DNNL
322322
if (phi::backends::cpu::MayIUse(phi::backends::cpu::cpu_isa_t::avx512_core))
323323
ASSERT_EQ(config.onednn_bfloat16_enabled(), true);
@@ -332,7 +332,7 @@ TEST(AnalysisPredictor, bf16_gpu_pass_strategy) {
332332
TEST(AnalysisPredictor, bf16_pass_strategy) {
333333
std::vector<std::string> passes;
334334
PassStrategy passStrategy(passes);
335-
passStrategy.EnableMkldnnBfloat16();
335+
passStrategy.EnableOnednnBfloat16();
336336
}
337337

338338
TEST(AnalysisPredictor, onednn_fc_pass_strategy) {

test/deprecated/cpp/inference/api/analyzer_bert_tester_deprecated.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ AnalysisConfig SetConfig(bool use_onednn, bool use_bfloat16) {
210210
config.EnableONEDNN();
211211
}
212212

213-
if (use_bfloat16) config.EnableMkldnnBfloat16();
213+
if (use_bfloat16) config.EnableOnednnBfloat16();
214214

215215
return config;
216216
}

test/deprecated/cpp/inference/api/analyzer_image_classification_tester.cc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ void SetInput(std::vector<std::vector<PaddleTensor>> *inputs) {
3737
}
3838

3939
// Easy for profiling independently.
40-
void profile(bool use_mkldnn = false) {
40+
void profile(bool use_onednn = false) {
4141
AnalysisConfig cfg;
4242
SetConfig(&cfg);
4343

44-
if (use_mkldnn) {
44+
if (use_onednn) {
4545
cfg.EnableONEDNN();
4646
if (FLAGS_disable_onednn_fc) {
4747
cfg.DisableOnednnFcPasses();
@@ -59,14 +59,14 @@ void profile(bool use_mkldnn = false) {
5959

6060
TEST(Analyzer_resnet50, profile) { profile(); }
6161
#ifdef PADDLE_WITH_DNNL
62-
TEST(Analyzer_resnet50, profile_mkldnn) { profile(true /* use_mkldnn */); }
62+
TEST(Analyzer_resnet50, profile_mkldnn) { profile(true /* use_onednn */); }
6363
#endif
6464

6565
// Compare result of NativeConfig and AnalysisConfig
66-
void compare(bool use_mkldnn = false) {
66+
void compare(bool use_onednn = false) {
6767
AnalysisConfig cfg;
6868
SetConfig(&cfg);
69-
if (use_mkldnn) {
69+
if (use_onednn) {
7070
cfg.EnableONEDNN();
7171
if (FLAGS_disable_onednn_fc) {
7272
cfg.DisableOnednnFcPasses();
@@ -81,7 +81,7 @@ void compare(bool use_mkldnn = false) {
8181

8282
TEST(Analyzer_resnet50, compare) { compare(); }
8383
#ifdef PADDLE_WITH_DNNL
84-
TEST(Analyzer_resnet50, compare_mkldnn) { compare(true /* use_mkldnn */); }
84+
TEST(Analyzer_resnet50, compare_mkldnn) { compare(true /* use_onednn */); }
8585
#endif
8686

8787
// Compare Deterministic result

test/deprecated/cpp/inference/api/analyzer_transformer_compare_tester.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ namespace inference {
1919
namespace analysis {
2020
namespace transformer_tester {
2121

22-
void compare(bool use_mkldnn = false) {
22+
void compare(bool use_onednn = false) {
2323
AnalysisConfig cfg;
2424
SetConfig(&cfg);
25-
if (!use_mkldnn) {
25+
if (!use_onednn) {
2626
cfg.DisableONEDNN();
2727
}
2828

@@ -34,7 +34,7 @@ void compare(bool use_mkldnn = false) {
3434

3535
TEST(Analyzer_Transformer, compare) { compare(); }
3636
#ifdef PADDLE_WITH_DNNL
37-
TEST(Analyzer_Transformer, compare_mkldnn) { compare(true /* use_mkldnn */); }
37+
TEST(Analyzer_Transformer, compare_mkldnn) { compare(true /* use_onednn */); }
3838
#endif
3939

4040
} // namespace transformer_tester

test/deprecated/cpp/inference/api/analyzer_transformer_profile_tester.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ namespace inference {
1919
namespace analysis {
2020
namespace transformer_tester {
2121

22-
void profile(bool use_mkldnn = false) {
22+
void profile(bool use_onednn = false) {
2323
AnalysisConfig cfg;
2424
SetConfig(&cfg);
2525
std::vector<std::vector<PaddleTensor>> outputs;
26-
if (use_mkldnn) {
26+
if (use_onednn) {
2727
cfg.EnableONEDNN();
2828
}
2929

test/deprecated/ir/inference/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if(WIN32)
5656

5757
endif()
5858

59-
if(NOT WITH_MKLDNN
59+
if(NOT WITH_ONEDNN
6060
AND NOT TENSORRT_FOUND
6161
AND NOT WITH_GPU)
6262
foreach(target ${TEST_INFERENCE_CPU_UT})

test/deprecated/ir/inference/auto_scan_test.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def create_inference_config(
226226
self,
227227
passes: list[str] | None = None,
228228
use_gpu: bool = False,
229-
use_mkldnn: bool = False,
229+
use_onednn: bool = False,
230230
use_xpu: bool = False,
231231
ir_optim: bool | None = None,
232232
):
@@ -238,7 +238,7 @@ def create_inference_config(
238238
config.switch_ir_optim(ir_optim)
239239
if use_gpu:
240240
config.enable_use_gpu(100, 0)
241-
if not use_mkldnn:
241+
if not use_onednn:
242242
config.disable_onednn()
243243
if use_xpu:
244244
config.enable_xpu()
@@ -337,7 +337,7 @@ def run_test(self, quant=False, *args, **kwargs):
337337
def inference_config_str(self, config) -> str:
338338
dic = {}
339339
enable_onednn = config.onednn_enabled()
340-
dic["use_mkldnn"] = enable_onednn
340+
dic["use_onednn"] = enable_onednn
341341
enable_gpu = config.use_gpu()
342342
dic["use_gpu"] = enable_gpu
343343
return str(dic)
@@ -573,7 +573,7 @@ def run_test(self, quant=False, prog_configs=None):
573573
def inference_config_str(self, config) -> str:
574574
dic = {}
575575
enable_onednn = config.onednn_enabled()
576-
dic["use_mkldnn"] = enable_onednn
576+
dic["use_onednn"] = enable_onednn
577577
enable_gpu = config.use_gpu()
578578
dic['use_gpu'] = enable_gpu
579579
enable_xpu = config.use_xpu()

test/deprecated/ir/inference/inference_pass_test.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _get_inference_outs(self, config):
129129
return outs
130130

131131
def _get_analysis_config(
132-
self, use_gpu=False, use_trt=False, use_mkldnn=False
132+
self, use_gpu=False, use_trt=False, use_onednn=False
133133
):
134134
'''
135135
Return a new object of AnalysisConfig.
@@ -177,7 +177,7 @@ def _get_analysis_config(
177177
if self.enable_tensorrt_varseqlen:
178178
config.enable_tensorrt_varseqlen()
179179

180-
elif use_mkldnn:
180+
elif use_onednn:
181181
config.enable_onednn()
182182
if self.enable_onednn_bfloat16:
183183
config.enable_onednn_bfloat16()
@@ -186,7 +186,7 @@ def _get_analysis_config(
186186
def check_output(self, atol=1e-3):
187187
'''
188188
Check whether calculating on CPU and GPU, enable TensorRT
189-
or disable TensorRT, enable MKLDNN or disable MKLDNN
189+
or disable TensorRT, enable ONEDNN or disable ONEDNN
190190
are all the same.
191191
'''
192192
self.assertFalse(
@@ -201,7 +201,7 @@ def check_output_with_option(
201201
):
202202
'''
203203
Check whether calculating on CPU and GPU, enable TensorRT
204-
or disable TensorRT, enable MKLDNN or disable MKLDNN
204+
or disable TensorRT, enable ONEDNN or disable ONEDNN
205205
are all the same.
206206
'''
207207
place = base.CUDAPlace(0) if use_gpu else base.CPUPlace()
@@ -287,13 +287,13 @@ def check_output_with_option(
287287
if (not use_gpu) and self.enable_mkldnn:
288288
onednn_outputs = self._get_inference_outs(
289289
self._get_analysis_config(
290-
use_gpu=use_gpu, use_mkldnn=self.enable_mkldnn
290+
use_gpu=use_gpu, use_onednn=self.enable_mkldnn
291291
)
292292
)
293293

294294
self.assertTrue(
295295
len(paddle_outs) == len(onednn_outputs),
296-
"The number of outputs is different between CPU and MKLDNN. ",
296+
"The number of outputs is different between CPU and ONEDNN. ",
297297
)
298298

299299
if self.enable_onednn_bfloat16:
@@ -304,7 +304,7 @@ def check_output_with_option(
304304
onednn_output,
305305
rtol=1e-05,
306306
atol=atol,
307-
err_msg='Output has diff between CPU and MKLDNN. ',
307+
err_msg='Output has diff between CPU and ONEDNN. ',
308308
)
309309

310310
class TensorRTParam:

test/deprecated/ir/inference/quant_dequant_test.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def _get_inference_outs(self, config):
190190
return outs
191191

192192
def _get_analysis_config(
193-
self, use_gpu=False, use_trt=False, use_mkldnn=False
193+
self, use_gpu=False, use_trt=False, use_onednn=False
194194
):
195195
'''
196196
Return a new object of AnalysisConfig.
@@ -230,7 +230,7 @@ def _get_analysis_config(
230230
if self.enable_tensorrt_varseqlen:
231231
config.enable_tensorrt_varseqlen()
232232

233-
elif use_mkldnn:
233+
elif use_onednn:
234234
config.enable_onednn()
235235
if self.enable_onednn_bfloat16:
236236
config.enable_onednn_bfloat16()
@@ -241,7 +241,7 @@ def check_output_with_option(
241241
):
242242
'''
243243
Check whether calculating on CPU and GPU, enable TensorRT
244-
or disable TensorRT, enable MKLDNN or disable MKLDNN
244+
or disable TensorRT, enable ONEDNN or disable ONEDNN
245245
are all the same.
246246
'''
247247
place = paddle.CUDAPlace(0) if use_gpu else paddle.CPUPlace()
@@ -390,13 +390,13 @@ def check_output_with_option(
390390
if (not use_gpu) and self.enable_mkldnn:
391391
onednn_outputs = self._get_inference_outs(
392392
self._get_analysis_config(
393-
use_gpu=use_gpu, use_mkldnn=self.enable_mkldnn
393+
use_gpu=use_gpu, use_onednn=self.enable_mkldnn
394394
)
395395
)
396396

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

402402
if self.enable_onednn_bfloat16:
@@ -407,7 +407,7 @@ def check_output_with_option(
407407
onednn_output,
408408
rtol=1e-05,
409409
atol=atol,
410-
err_msg='Output has diff between CPU and MKLDNN. ',
410+
err_msg='Output has diff between CPU and ONEDNN. ',
411411
)
412412

413413
class TensorRTParam:

0 commit comments

Comments
 (0)