From 0ce6d7fa77a4c19e6da33b8afcef265641f2e291 Mon Sep 17 00:00:00 2001 From: "joanna.wozna.intel" Date: Fri, 11 Dec 2020 02:53:57 +0100 Subject: [PATCH] Fix bf16 activations test for softmax and gelu (#29502) * Fix bf16 activations test for softmax and gelu * Resolve conflict --- paddle/scripts/paddle_build.bat | 1 - .../tests/unittests/mkldnn/test_activation_mkldnn_op.py | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/paddle/scripts/paddle_build.bat b/paddle/scripts/paddle_build.bat index 3f06a573def..7fd4a5aee10 100644 --- a/paddle/scripts/paddle_build.bat +++ b/paddle/scripts/paddle_build.bat @@ -447,7 +447,6 @@ test_imperative_static_runner_while^|^ test_optimizer_in_control_flow^|^ test_fuse_bn_act_pass^|^ test_fuse_bn_add_act_pass^|^ -test_activation_mkldnn_op^|^ test_tsm^|^ test_gru_rnn_op^|^ test_rnn_op^|^ diff --git a/python/paddle/fluid/tests/unittests/mkldnn/test_activation_mkldnn_op.py b/python/paddle/fluid/tests/unittests/mkldnn/test_activation_mkldnn_op.py index 63db1b1475d..611f5a9d6d1 100644 --- a/python/paddle/fluid/tests/unittests/mkldnn/test_activation_mkldnn_op.py +++ b/python/paddle/fluid/tests/unittests/mkldnn/test_activation_mkldnn_op.py @@ -79,6 +79,8 @@ class TestMKLDNNGeluDim2Approx(TestActivation): self.attrs = {"use_mkldnn": True, "approximate": True} +@unittest.skipIf(not core.supports_bfloat16(), + "place does not support BF16 evaluation") class TestMKLDNNGeluBf16Dim2(TestActivation): def setUp(self): self.op_type = "gelu" @@ -98,6 +100,8 @@ class TestMKLDNNGeluBf16Dim2(TestActivation): pass +@unittest.skipIf(not core.supports_bfloat16(), + "place does not support BF16 evaluation") class TestMKLDNNGeluBf16Dim2Approx(TestActivation): def setUp(self): self.op_type = "gelu" @@ -225,6 +229,8 @@ class TestMKLDNNGeluDim4Approx(TestActivation): self.attrs = {"use_mkldnn": True, "approximate": True} +@unittest.skipIf(not core.supports_bfloat16(), + "place does not support BF16 evaluation") class TestMKLDNNGeluBf16Dim4(TestActivation): def setUp(self): self.op_type = "gelu" @@ -244,6 +250,8 @@ class TestMKLDNNGeluBf16Dim4(TestActivation): pass +@unittest.skipIf(not core.supports_bfloat16(), + "place does not support BF16 evaluation") class TestMKLDNNGeluBf16Dim4Approx(TestActivation): def setUp(self): self.op_type = "gelu" -- GitLab