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 0521c300ae1..4277eb09f8d 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 @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ +import pytest import numpy as np import mindspore.context as context import mindspore.nn as nn @@ -58,6 +59,10 @@ 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 4de75ebd2b4..20097098c43 100644 --- a/tests/st/ops/graph_kernel/test_cse.py +++ b/tests/st/ops/graph_kernel/test_cse.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -54,6 +54,10 @@ 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 b376055e834..99b4a157efa 100644 --- a/tests/st/ops/graph_kernel/test_fuse.py +++ b/tests/st/ops/graph_kernel/test_fuse.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -69,6 +69,10 @@ 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_maximum_grad.py b/tests/st/ops/graph_kernel/test_maximum_grad.py index 8194002e6da..f93aa3978da 100644 --- a/tests/st/ops/graph_kernel/test_maximum_grad.py +++ b/tests/st/ops/graph_kernel/test_maximum_grad.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -51,6 +51,10 @@ 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 c89fae4ba58..80957ac27b6 100644 --- a/tests/st/ops/graph_kernel/test_minimum_grad.py +++ b/tests/st/ops/graph_kernel/test_minimum_grad.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -51,6 +51,10 @@ 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 fad46cfdafe..0a367f69495 100644 --- a/tests/st/ops/graph_kernel/test_reduce_mean.py +++ b/tests/st/ops/graph_kernel/test_reduce_mean.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -48,6 +48,10 @@ 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_relu.py b/tests/st/ops/graph_kernel/test_relu.py index 9b0dc43bf38..41462d370b0 100644 --- a/tests/st/ops/graph_kernel/test_relu.py +++ b/tests/st/ops/graph_kernel/test_relu.py @@ -46,6 +46,7 @@ def test_relu(shape, dtype): assert np.allclose(expect_np, output_np, 0.0001, 0.0001) + @pytest.mark.level0 @pytest.mark.platform_x86_gpu_training @pytest.mark.env_onecard @@ -54,6 +55,11 @@ def test_relu_gpu(): test_relu((4, 3), np.int32) test_relu((12, 1), np.float16) + +@pytest.mark.level0 +@pytest.mark.platform_arm_ascend_training +@pytest.mark.platform_x86_ascend_training +@pytest.mark.env_onecard def test_relu_ascend(): context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") test_relu((4, 3), np.int32) diff --git a/tests/st/ops/graph_kernel/test_relu_grad.py b/tests/st/ops/graph_kernel/test_relu_grad.py index 3d21087f87f..1468771e4a5 100644 --- a/tests/st/ops/graph_kernel/test_relu_grad.py +++ b/tests/st/ops/graph_kernel/test_relu_grad.py @@ -47,6 +47,7 @@ def test_relu_grad(shape1, shape2, dtype): assert np.allclose(expect_np, output_np, 0.0001, 0.0001) + @pytest.mark.level0 @pytest.mark.platform_x86_gpu_training @pytest.mark.env_onecard @@ -55,6 +56,11 @@ def test_relu_grad_gpu(): test_relu_grad((4, 3), (4, 3), np.int32) test_relu_grad((12, 1), (12, 1), np.float16) + +@pytest.mark.level0 +@pytest.mark.platform_arm_ascend_training +@pytest.mark.platform_x86_ascend_training +@pytest.mark.env_onecard def test_relu_grad_ascend(): context.set_context(mode=context.GRAPH_MODE, device_target="Ascend") test_relu_grad((4, 3), (4, 3), np.int32) diff --git a/tests/st/ops/graph_kernel/test_simplify.py b/tests/st/ops/graph_kernel/test_simplify.py index f2864285154..87fef46e547 100644 --- a/tests/st/ops/graph_kernel/test_simplify.py +++ b/tests/st/ops/graph_kernel/test_simplify.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -76,6 +76,10 @@ 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 c5a16806a9a..6c48b444bec 100644 --- a/tests/st/ops/graph_kernel/test_sqrt_grad.py +++ b/tests/st/ops/graph_kernel/test_sqrt_grad.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ +import pytest import numpy as np import mindspore.context as context import mindspore.nn as nn @@ -54,6 +55,10 @@ 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 484bee22605..808637cee19 100644 --- a/tests/st/ops/graph_kernel/test_tanh_grad.py +++ b/tests/st/ops/graph_kernel/test_tanh_grad.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -49,6 +49,10 @@ 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 4ab57faa600..9afc2ab237f 100644 --- a/tests/st/ops/graph_kernel/test_tile.py +++ b/tests/st/ops/graph_kernel/test_tile.py @@ -1,4 +1,4 @@ -# Copyright 2020 Huawei Technologies Co., Ltd +# Copyright 2020-2021 Huawei Technologies Co., Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. # ============================================================================ +import pytest import numpy as np import mindspore.context as context import mindspore.nn as nn @@ -47,6 +48,10 @@ 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))