From 03bd3b02dc40d77fa94ab867e4ab07ca82e7298d Mon Sep 17 00:00:00 2001 From: looop5 Date: Fri, 5 Feb 2021 10:48:21 +0800 Subject: [PATCH] close graph kernel ci ascend testcases --- .../bert_precision/test_bert_tdt_lossscale.py | 19 +++++++------------ .../test_clip_by_norm_no_div_sum.py | 5 ----- tests/st/ops/graph_kernel/test_cse.py | 4 ---- tests/st/ops/graph_kernel/test_fuse.py | 4 ---- tests/st/ops/graph_kernel/test_fused_adam.py | 8 -------- tests/st/ops/graph_kernel/test_gelu.py | 8 -------- tests/st/ops/graph_kernel/test_lamb.py | 5 ----- tests/st/ops/graph_kernel/test_layernorm.py | 8 -------- tests/st/ops/graph_kernel/test_logsoftmax.py | 8 -------- .../st/ops/graph_kernel/test_maximum_grad.py | 4 ---- .../st/ops/graph_kernel/test_minimum_grad.py | 4 ---- tests/st/ops/graph_kernel/test_reduce_mean.py | 4 ---- tests/st/ops/graph_kernel/test_simplify.py | 4 ---- tests/st/ops/graph_kernel/test_sqrt_grad.py | 5 ----- tests/st/ops/graph_kernel/test_tanh_grad.py | 4 ---- tests/st/ops/graph_kernel/test_tile.py | 5 ----- 16 files changed, 7 insertions(+), 92 deletions(-) diff --git a/tests/st/networks/models/bert/bert_precision/test_bert_tdt_lossscale.py b/tests/st/networks/models/bert/bert_precision/test_bert_tdt_lossscale.py index 3f6d9e72c5..4ed4d4cfbf 100644 --- a/tests/st/networks/models/bert/bert_precision/test_bert_tdt_lossscale.py +++ b/tests/st/networks/models/bert/bert_precision/test_bert_tdt_lossscale.py @@ -174,8 +174,8 @@ class TimeMonitor(Callback): self.per_step_mseconds_list.append(epoch_mseconds / self.data_size) -def test_bert_percision(enable_graph_kernel=False): - """test bert percision""" +def test_bert_precision(enable_graph_kernel=False): + """test bert precision""" context.set_context(mode=context.GRAPH_MODE, device_target="Ascend", reserve_class_name_in_scope=False) if enable_graph_kernel: context.set_context(enable_graph_kernel=True) @@ -245,18 +245,13 @@ def test_bert_percision(enable_graph_kernel=False): @pytest.mark.platform_arm_ascend_training @pytest.mark.platform_x86_ascend_training @pytest.mark.env_onecard -def test_bert_percision_graph_kernel_off(): - test_bert_percision(enable_graph_kernel=False) +def test_bert_precision_graph_kernel_off(): + test_bert_precision(enable_graph_kernel=False) -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard -def test_bert_percision_graph_kernel_on(): - test_bert_percision(enable_graph_kernel=True) +def test_bert_precision_graph_kernel_on(): + test_bert_precision(enable_graph_kernel=True) if __name__ == '__main__': - test_bert_percision(enable_graph_kernel=False) - test_bert_percision(enable_graph_kernel=True) + test_bert_precision(enable_graph_kernel=False) diff --git a/tests/st/ops/graph_kernel/test_clip_by_norm_no_div_sum.py b/tests/st/ops/graph_kernel/test_clip_by_norm_no_div_sum.py index 2143374a8f..9af6bce4bd 100644 --- a/tests/st/ops/graph_kernel/test_clip_by_norm_no_div_sum.py +++ b/tests/st/ops/graph_kernel/test_clip_by_norm_no_div_sum.py @@ -13,7 +13,6 @@ # limitations under the License. # ============================================================================ import numpy as np -import pytest import mindspore.context as context import mindspore.nn as nn from mindspore import Tensor @@ -60,10 +59,6 @@ def test_clip_by_norm_no_div_sum(shape0, shape1, shape2, shape3, dtype): assert np.allclose(expect_np, output_np, 0.0001, 0.0001) -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_clip_by_norm_no_div_sum_ascend(): context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") test_clip_by_norm_no_div_sum((1, 1), (1,), (1, 1), (1,), np.float32) diff --git a/tests/st/ops/graph_kernel/test_cse.py b/tests/st/ops/graph_kernel/test_cse.py index 3c64e092cc..4de75ebd2b 100644 --- a/tests/st/ops/graph_kernel/test_cse.py +++ b/tests/st/ops/graph_kernel/test_cse.py @@ -54,10 +54,6 @@ def test_basic_gpu(): test_basic() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_basic_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_basic() diff --git a/tests/st/ops/graph_kernel/test_fuse.py b/tests/st/ops/graph_kernel/test_fuse.py index a317b2dc5c..46fa141c85 100644 --- a/tests/st/ops/graph_kernel/test_fuse.py +++ b/tests/st/ops/graph_kernel/test_fuse.py @@ -70,10 +70,6 @@ def test_basic_gpu(): test_basic() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_basic_ascend(): context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") test_basic() diff --git a/tests/st/ops/graph_kernel/test_fused_adam.py b/tests/st/ops/graph_kernel/test_fused_adam.py index b0a9604939..851d523dad 100644 --- a/tests/st/ops/graph_kernel/test_fused_adam.py +++ b/tests/st/ops/graph_kernel/test_fused_adam.py @@ -135,10 +135,6 @@ def test_adam_gpu(): test_adam() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_adam_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_adam() @@ -152,10 +148,6 @@ def test_adam_weight_decay_gpu(): test_adam_weight_decay() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_adam_weight_decay_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_adam_weight_decay() diff --git a/tests/st/ops/graph_kernel/test_gelu.py b/tests/st/ops/graph_kernel/test_gelu.py index 4497d945e3..54c10a8533 100644 --- a/tests/st/ops/graph_kernel/test_gelu.py +++ b/tests/st/ops/graph_kernel/test_gelu.py @@ -85,10 +85,6 @@ def test_gelu_gpu(): test_gelu() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_gelu_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_gelu() @@ -102,10 +98,6 @@ def test_gelu_grad_gpu(): test_gelu_grad() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_gelu_grad_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_gelu_grad() diff --git a/tests/st/ops/graph_kernel/test_lamb.py b/tests/st/ops/graph_kernel/test_lamb.py index 6d146553c0..be2f0620c1 100644 --- a/tests/st/ops/graph_kernel/test_lamb.py +++ b/tests/st/ops/graph_kernel/test_lamb.py @@ -13,7 +13,6 @@ # limitations under the License. # ============================================================================ -import pytest import numpy as np import mindspore.context as context from mindspore import Tensor, Parameter @@ -135,10 +134,6 @@ def test_graph_kernel_lamb_gpu(): test_graph_kernel_lamb() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_graph_kernel_lamb_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_graph_kernel_lamb() diff --git a/tests/st/ops/graph_kernel/test_layernorm.py b/tests/st/ops/graph_kernel/test_layernorm.py index 3ecf758d97..bc18bda9e5 100644 --- a/tests/st/ops/graph_kernel/test_layernorm.py +++ b/tests/st/ops/graph_kernel/test_layernorm.py @@ -144,10 +144,6 @@ def test_basic_gpu(): test_basic() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_basic_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_basic() @@ -161,10 +157,6 @@ def test_layernormgrad_gpu(): test_layernormgrad() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_layernormgrad_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_layernormgrad() diff --git a/tests/st/ops/graph_kernel/test_logsoftmax.py b/tests/st/ops/graph_kernel/test_logsoftmax.py index 7981bce1e9..31d9dfb0e6 100644 --- a/tests/st/ops/graph_kernel/test_logsoftmax.py +++ b/tests/st/ops/graph_kernel/test_logsoftmax.py @@ -107,19 +107,11 @@ def test_logsoftmaxgrad_gpu(): test_logsoftmaxgrad() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_logsoftmax_asend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_logsoftmax() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_logsoftmaxgrad_asend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_logsoftmaxgrad() diff --git a/tests/st/ops/graph_kernel/test_maximum_grad.py b/tests/st/ops/graph_kernel/test_maximum_grad.py index 46cb8df93a..8194002e6d 100644 --- a/tests/st/ops/graph_kernel/test_maximum_grad.py +++ b/tests/st/ops/graph_kernel/test_maximum_grad.py @@ -51,10 +51,6 @@ def test_maximum_grad_gpu(): test_maximum_grad() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_maximum_grad_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_maximum_grad() diff --git a/tests/st/ops/graph_kernel/test_minimum_grad.py b/tests/st/ops/graph_kernel/test_minimum_grad.py index a2a01014ce..c89fae4ba5 100644 --- a/tests/st/ops/graph_kernel/test_minimum_grad.py +++ b/tests/st/ops/graph_kernel/test_minimum_grad.py @@ -51,10 +51,6 @@ def test_basic_gpu(): test_minimum_grad() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_basic_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_minimum_grad() diff --git a/tests/st/ops/graph_kernel/test_reduce_mean.py b/tests/st/ops/graph_kernel/test_reduce_mean.py index 1e823a00c6..fad46cfdaf 100644 --- a/tests/st/ops/graph_kernel/test_reduce_mean.py +++ b/tests/st/ops/graph_kernel/test_reduce_mean.py @@ -48,10 +48,6 @@ def test_reduce_mean_gpu(): test_reduce_mean() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_reduce_mean_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_reduce_mean() diff --git a/tests/st/ops/graph_kernel/test_simplify.py b/tests/st/ops/graph_kernel/test_simplify.py index 9742ac49db..f286428515 100644 --- a/tests/st/ops/graph_kernel/test_simplify.py +++ b/tests/st/ops/graph_kernel/test_simplify.py @@ -76,10 +76,6 @@ def test_basic_gpu(): test_basic() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_basic_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_basic() diff --git a/tests/st/ops/graph_kernel/test_sqrt_grad.py b/tests/st/ops/graph_kernel/test_sqrt_grad.py index 65342920fd..7cff2c4451 100644 --- a/tests/st/ops/graph_kernel/test_sqrt_grad.py +++ b/tests/st/ops/graph_kernel/test_sqrt_grad.py @@ -13,7 +13,6 @@ # limitations under the License. # ============================================================================ import numpy as np -import pytest import mindspore.context as context import mindspore.nn as nn from mindspore import Tensor @@ -56,10 +55,6 @@ def test_sqrt_grad(shape_x, shape_dout, dtype): assert np.allclose(expect_np, output_np, rtol, atol) -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_sqrt_grad_ascend(): context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") test_sqrt_grad((16, 16), (16, 16), np.float16) diff --git a/tests/st/ops/graph_kernel/test_tanh_grad.py b/tests/st/ops/graph_kernel/test_tanh_grad.py index f2446f150b..484bee2260 100644 --- a/tests/st/ops/graph_kernel/test_tanh_grad.py +++ b/tests/st/ops/graph_kernel/test_tanh_grad.py @@ -49,10 +49,6 @@ def test_tanh_grad_gpu(): test_tanh_grad() -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_tanh_grad_ascend(): context.set_context(mode=context.GRAPH_MODE, enable_graph_kernel=True, device_target="Ascend") test_tanh_grad() diff --git a/tests/st/ops/graph_kernel/test_tile.py b/tests/st/ops/graph_kernel/test_tile.py index 7ca00b42b7..16f3e92654 100644 --- a/tests/st/ops/graph_kernel/test_tile.py +++ b/tests/st/ops/graph_kernel/test_tile.py @@ -13,7 +13,6 @@ # limitations under the License. # ============================================================================ import numpy as np -import pytest import mindspore.context as context import mindspore.nn as nn from mindspore import Tensor @@ -49,10 +48,6 @@ def test_tile(shape, dtype, multiples): assert np.allclose(expect_np, output_np, 0.0001, 0.0001) -@pytest.mark.level0 -@pytest.mark.platform_arm_ascend_training -@pytest.mark.platform_x86_ascend_training -@pytest.mark.env_onecard def test_tile_ascend(): context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") test_tile((24, 1), np.float16, (2, 2, 2))