Browse Source

fix(pytest/windows/impertive): fix windows wrong test skip

GitOrigin-RevId: ca0f04cfe7
release-1.1
Megvii Engine Team 4 years ago
parent
commit
dfc3935d06
3 changed files with 5 additions and 26 deletions
  1. +4
    -4
      imperative/python/test/unit/distributed/test_distributed.py
  2. +0
    -9
      imperative/python/test/unit/functional/test_tensor.py
  3. +1
    -13
      imperative/python/test/unit/module/test_batchnorm.py

+ 4
- 4
imperative/python/test/unit/distributed/test_distributed.py View File

@@ -41,7 +41,7 @@ def _assert_q_val(q, val):
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" platform.system() == "Darwin", reason="do not imp GPU mode at macos now"
) )
@pytest.mark.skipif( @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.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device")
@pytest.mark.isolated_distributed @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" platform.system() == "Darwin", reason="do not imp GPU mode at macos now"
) )
@pytest.mark.skipif( @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.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device")
@pytest.mark.isolated_distributed @pytest.mark.isolated_distributed
@@ -119,7 +119,7 @@ def test_new_group():
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" platform.system() == "Darwin", reason="do not imp GPU mode at macos now"
) )
@pytest.mark.skipif( @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.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device")
@pytest.mark.isolated_distributed @pytest.mark.isolated_distributed
@@ -155,7 +155,7 @@ def test_group_barrier():
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" platform.system() == "Darwin", reason="do not imp GPU mode at macos now"
) )
@pytest.mark.skipif( @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.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device")
@pytest.mark.isolated_distributed @pytest.mark.isolated_distributed


+ 0
- 9
imperative/python/test/unit/functional/test_tensor.py View File

@@ -338,9 +338,6 @@ def copy_test(dst, src):
@pytest.mark.skipif( @pytest.mark.skipif(
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" 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") @pytest.mark.skipif(get_device_count_by_fork("gpu") == 0, reason="CUDA is disabled")
def test_copy_h2d(): def test_copy_h2d():
copy_test("cpu0", "gpu0") copy_test("cpu0", "gpu0")
@@ -349,9 +346,6 @@ def test_copy_h2d():
@pytest.mark.skipif( @pytest.mark.skipif(
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" 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") @pytest.mark.skipif(get_device_count_by_fork("gpu") == 0, reason="CUDA is disabled")
def test_copy_d2h(): def test_copy_d2h():
copy_test("gpu0", "cpu0") copy_test("gpu0", "cpu0")
@@ -360,9 +354,6 @@ def test_copy_d2h():
@pytest.mark.skipif( @pytest.mark.skipif(
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" 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") @pytest.mark.skipif(get_device_count_by_fork("gpu") < 2, reason="need more gpu device")
def test_copy_d2d(): def test_copy_d2d():
copy_test("gpu0", "gpu1") copy_test("gpu0", "gpu1")


+ 1
- 13
imperative/python/test/unit/module/test_batchnorm.py View File

@@ -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" platform.system() == "Darwin", reason="do not imp GPU mode at macos now"
) )
@pytest.mark.skipif( @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 @pytest.mark.isolated_distributed
def test_syncbn(): def test_syncbn():
@@ -143,9 +143,6 @@ def test_batchnorm():
@pytest.mark.skipif( @pytest.mark.skipif(
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" 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 @pytest.mark.isolated_distributed
def test_syncbn1d(): def test_syncbn1d():
nr_chan = 8 nr_chan = 8
@@ -237,9 +234,6 @@ def test_batchnorm2d():
@pytest.mark.skipif( @pytest.mark.skipif(
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" 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 @pytest.mark.isolated_distributed
def test_syncbn2d(): def test_syncbn2d():
nr_chan = 8 nr_chan = 8
@@ -311,9 +305,6 @@ def test_batchnorm_no_stats():
@pytest.mark.skipif( @pytest.mark.skipif(
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" 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 @pytest.mark.isolated_distributed
def test_syncbn_no_stats(): def test_syncbn_no_stats():
nr_chan = 8 nr_chan = 8
@@ -363,9 +354,6 @@ def test_batchnorm2d_no_stats():
@pytest.mark.skipif( @pytest.mark.skipif(
platform.system() == "Darwin", reason="do not imp GPU mode at macos now" 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 @pytest.mark.isolated_distributed
def test_syncbn2d_no_stats(): def test_syncbn2d_no_stats():
nr_chan = 8 nr_chan = 8


Loading…
Cancel
Save