Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion test/auto_parallel/custom_op/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def get_paddle_includes():
paddle_includes = []
paddle_includes.append(f"{env_dict.get('PADDLE_SOURCE_DIR')}")

# mkldnn
# onednn
if env_dict.get("WITH_ONEDNN") == 'ON':
paddle_includes.append(f"{env_dict.get('ONEDNN_INSTALL_DIR')}/include")
if env_dict.get("WITH_GPU") == 'ON' or env_dict.get("WITH_ROCM") == 'ON':
Expand Down
8 changes: 4 additions & 4 deletions test/dygraph_to_static/test_mnist.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,18 +173,18 @@ def test_mnist_to_static(self):
)

@test_default_mode_only
def test_mnist_declarative_cpu_vs_mkldnn(self):
def test_mnist_declarative_cpu_vs_onednn(self):
dygraph_loss_cpu = self.train_dygraph()
paddle.set_flags({'FLAGS_use_onednn': True})
try:
dygraph_loss_mkldnn = self.train_dygraph()
dygraph_loss_onednn = self.train_dygraph()
finally:
paddle.set_flags({'FLAGS_use_onednn': False})
np.testing.assert_allclose(
dygraph_loss_cpu,
dygraph_loss_mkldnn,
dygraph_loss_onednn,
rtol=1e-05,
err_msg=f'cpu dygraph is {dygraph_loss_cpu}\n mkldnn dygraph is \n{dygraph_loss_mkldnn}',
err_msg=f'cpu dygraph is {dygraph_loss_cpu}\n onednn dygraph is \n{dygraph_loss_onednn}',
)

def train(self, to_static=False):
Expand Down
2 changes: 1 addition & 1 deletion test/ir/inference/test_onednn_conv3d_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from program_config import OpConfig, ProgramConfig, TensorConfig


class TestMkldnnConv3dOp(OnednnAutoScanTest):
class TestOnednnConv3dOp(OnednnAutoScanTest):
def is_program_valid(self, program_config: ProgramConfig) -> bool:
return True

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def teller2(program_config, predictor_config):
self.add_ignore_check_case(
teller2,
IgnoreReasons.PASS_ACCURACY_ERROR,
"Currently mkldnn Output has diff with bias!",
"Currently onednn Output has diff with bias!",
)

def test(self):
Expand Down
2 changes: 1 addition & 1 deletion test/ir/inference/test_onednn_matmulv2_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from program_config import OpConfig, ProgramConfig, TensorConfig


class TestMkldnnMatmulv2Op(OnednnAutoScanTest):
class TestOnednnMatmulv2Op(OnednnAutoScanTest):
def is_program_valid(self, program_config: ProgramConfig) -> bool:
if len(program_config.inputs["input_data2"].shape) == 4:
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def product(input):


@OpTestTool.skip_if_not_cpu()
class TestShuffleChannelMKLDNNDetectPass(PassAutoScanTest):
class TestShuffleChannelOneDNNDetectPass(PassAutoScanTest):
def is_program_valid(self, program_config: ProgramConfig) -> bool:
input_shape = program_config.inputs['input_data'].shape
first_reshape2_shape = program_config.ops[0].attrs['shape']
Expand Down
2 changes: 1 addition & 1 deletion test/legacy_test/test_fill_constant_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ def init_data(self):
self.onednn_data_type = "bfloat16"

def test_check_output(self):
# no dynamic graph test for mkldnn
# no dynamic graph test for onednn
self.check_output_with_place(
core.CPUPlace(), check_dygraph=False, check_pir=False
)
Expand Down
6 changes: 3 additions & 3 deletions test/onednn/test_elementwise_mul_bf16_onednn_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@unittest.skipIf(
not core.supports_bfloat16(), "place does not support BF16 evaluation"
)
class TestElementwiseMulBf16MklDNNOp(OpTest):
class TestElementwiseMulBf16OneDNNOp(OpTest):
def setUp(self):
self.op_type = "elementwise_mul"
self.use_onednn = True
Expand Down Expand Up @@ -87,8 +87,8 @@ def test_check_grad_ignore_y(self):
)


class TestElementwiseMulBroadcastingBf16MklDNNOp(
TestElementwiseMulBf16MklDNNOp
class TestElementwiseMulBroadcastingBf16OneDNNOp(
TestElementwiseMulBf16OneDNNOp
):
def generate_data(self):
self.x = np.random.uniform(1, 2, [1, 2, 3, 100]).astype(np.float32)
Expand Down
12 changes: 6 additions & 6 deletions test/onednn/test_matmul_bf16_onednn_op.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
@unittest.skipIf(
not core.supports_bfloat16(), "place does not support BF16 evaluation"
)
class TestMatmulBf16MklDNNOp(OpTest):
class TestMatmulBf16OneDNNOp(OpTest):
def generate_data(self):
self.x_fp32 = np.random.random((25, 2, 2)).astype(np.float32)
self.y_fp32 = np.random.random((25, 2, 2)).astype(np.float32)
Expand Down Expand Up @@ -123,22 +123,22 @@ def calculate_grads(self):
self.dout = dout


class TestDnnlMatMulOpAlpha(TestMatmulBf16MklDNNOp):
class TestDnnlMatMulOpAlpha(TestMatmulBf16OneDNNOp):
def generate_data(self):
self.x_fp32 = np.random.random((17, 2, 3)).astype(np.float32)
self.y_fp32 = np.random.random((17, 3, 2)).astype(np.float32)
self.alpha = 2.0
self.out = self.alpha * np.matmul(self.x_fp32, self.y_fp32)


class TestDnnlMatMulOp2D(TestMatmulBf16MklDNNOp):
class TestDnnlMatMulOp2D(TestMatmulBf16OneDNNOp):
def generate_data(self):
self.x_fp32 = np.random.random((12, 9)).astype(np.float32)
self.y_fp32 = np.random.random((9, 12)).astype(np.float32)
self.out = np.matmul(self.x_fp32, self.y_fp32)


class TestDnnlMatMulOpTransposeX(TestMatmulBf16MklDNNOp):
class TestDnnlMatMulOpTransposeX(TestMatmulBf16OneDNNOp):
def generate_data(self):
self.x_fp32 = np.random.random((12, 9)).astype(np.float32)
self.y_fp32 = np.random.random((12, 9)).astype(np.float32)
Expand All @@ -153,7 +153,7 @@ def set_attributes(self):
}


class TestDnnlMatMulOpTransposeY(TestMatmulBf16MklDNNOp):
class TestDnnlMatMulOpTransposeY(TestMatmulBf16OneDNNOp):
def generate_data(self):
self.x_fp32 = np.random.random((12, 9)).astype(np.float32)
self.y_fp32 = np.random.random((12, 9)).astype(np.float32)
Expand All @@ -168,7 +168,7 @@ def set_attributes(self):
}


class TestMatmulBf16MklDNNForceFp32Output(TestMatmulBf16MklDNNOp):
class TestMatmulBf16OneDNNForceFp32Output(TestMatmulBf16OneDNNOp):
def generate_data(self):
self.x_fp32 = np.random.random((12, 9)).astype(np.float32)
self.y_fp32 = np.random.random((9, 12)).astype(np.float32)
Expand Down
2 changes: 1 addition & 1 deletion test/quantization/quant2_int8_lstm_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def parse_args():
'--onednn_cache_capacity',
type=int,
default=0,
help='Mkldnn cache capacity. The default value in Python API is 15, which can slow down int8 models. Default 0 means unlimited cache.',
help='Onednn cache capacity. The default value in Python API is 15, which can slow down int8 models. Default 0 means unlimited cache.',
)

test_args, args = parser.parse_known_args(namespace=unittest)
Expand Down
Loading