From dfc3935d06b2a0b9791c04eb7902e5d78e1f298d Mon Sep 17 00:00:00 2001 From: Megvii Engine Team Date: Sat, 17 Oct 2020 21:30:24 +0800 Subject: [PATCH] fix(pytest/windows/impertive): fix windows wrong test skip GitOrigin-RevId: ca0f04cfe7b069af1358cf06fb60eaa09eadb1c9 --- .../test/unit/distributed/test_distributed.py | 8 ++++---- .../python/test/unit/functional/test_tensor.py | 9 --------- .../python/test/unit/module/test_batchnorm.py | 14 +------------- 3 files changed, 5 insertions(+), 26 deletions(-) diff --git a/imperative/python/test/unit/distributed/test_distributed.py b/imperative/python/test/unit/distributed/test_distributed.py index 29eed7ef8..26c732b8d 100644 --- a/imperative/python/test/unit/distributed/test_distributed.py +++ b/imperative/python/test/unit/distributed/test_distributed.py @@ -41,7 +41,7 @@ def _assert_q_val(q, val): platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) @pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" + platform.system() == "Windows", reason="windows disable MGB_ENABLE_OPR_MM" ) @pytest.mark.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device") @pytest.mark.isolated_distributed @@ -85,7 +85,7 @@ def test_init_process_group(): platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) @pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" + platform.system() == "Windows", reason="windows disable MGB_ENABLE_OPR_MM" ) @pytest.mark.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device") @pytest.mark.isolated_distributed @@ -119,7 +119,7 @@ def test_new_group(): platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) @pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" + platform.system() == "Windows", reason="windows disable MGB_ENABLE_OPR_MM" ) @pytest.mark.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device") @pytest.mark.isolated_distributed @@ -155,7 +155,7 @@ def test_group_barrier(): platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) @pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" + platform.system() == "Windows", reason="windows disable MGB_ENABLE_OPR_MM" ) @pytest.mark.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device") @pytest.mark.isolated_distributed diff --git a/imperative/python/test/unit/functional/test_tensor.py b/imperative/python/test/unit/functional/test_tensor.py index 9fc847b0f..1e8fbc558 100644 --- a/imperative/python/test/unit/functional/test_tensor.py +++ b/imperative/python/test/unit/functional/test_tensor.py @@ -338,9 +338,6 @@ def copy_test(dst, src): @pytest.mark.skipif( platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) -@pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" -) @pytest.mark.skipif(get_device_count_by_fork("gpu") == 0, reason="CUDA is disabled") def test_copy_h2d(): copy_test("cpu0", "gpu0") @@ -349,9 +346,6 @@ def test_copy_h2d(): @pytest.mark.skipif( platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) -@pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" -) @pytest.mark.skipif(get_device_count_by_fork("gpu") == 0, reason="CUDA is disabled") def test_copy_d2h(): copy_test("gpu0", "cpu0") @@ -360,9 +354,6 @@ def test_copy_d2h(): @pytest.mark.skipif( platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) -@pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" -) @pytest.mark.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device") def test_copy_d2d(): copy_test("gpu0", "gpu1") diff --git a/imperative/python/test/unit/module/test_batchnorm.py b/imperative/python/test/unit/module/test_batchnorm.py index fe1e2cbb9..f9bef4d25 100644 --- a/imperative/python/test/unit/module/test_batchnorm.py +++ b/imperative/python/test/unit/module/test_batchnorm.py @@ -26,7 +26,7 @@ _assert_allclose = functools.partial(np.testing.assert_allclose, atol=5e-6, rtol platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) @pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" + platform.system() == "Windows", reason="windows disable MGB_ENABLE_OPR_MM" ) @pytest.mark.isolated_distributed def test_syncbn(): @@ -143,9 +143,6 @@ def test_batchnorm(): @pytest.mark.skipif( platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) -@pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" -) @pytest.mark.isolated_distributed def test_syncbn1d(): nr_chan = 8 @@ -237,9 +234,6 @@ def test_batchnorm2d(): @pytest.mark.skipif( platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) -@pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" -) @pytest.mark.isolated_distributed def test_syncbn2d(): nr_chan = 8 @@ -311,9 +305,6 @@ def test_batchnorm_no_stats(): @pytest.mark.skipif( platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) -@pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" -) @pytest.mark.isolated_distributed def test_syncbn_no_stats(): nr_chan = 8 @@ -363,9 +354,6 @@ def test_batchnorm2d_no_stats(): @pytest.mark.skipif( platform.system() == "Darwin", reason="do not imp GPU mode at macos now" ) -@pytest.mark.skipif( - platform.system() == "Windows", reason="do not imp GPU mode at Windows now" -) @pytest.mark.isolated_distributed def test_syncbn2d_no_stats(): nr_chan = 8 -- GitLab