Browse Source

test(imperative): reopen special interpolate test and sync when test rng

GitOrigin-RevId: e3d03b4d1d
tags/v1.9.0
Megvii Engine Team 3 years ago
parent
commit
d919aaebc7
2 changed files with 4 additions and 4 deletions
  1. +1
    -1
      imperative/python/test/unit/functional/test_functional.py
  2. +3
    -3
      imperative/python/test/unit/random/test_rng.py

+ 1
- 1
imperative/python/test/unit/functional/test_functional.py View File

@@ -507,7 +507,7 @@ def test_interpolate_fastpath():
[(1, 1, 10, 10), (5, 5)], [(1, 1, 10, 10), (5, 5)],
[(1, 3, 10, 10), (20, 20)], [(1, 3, 10, 10), (20, 20)],
[(10, 1, 10, 10), (1, 1)], [(10, 1, 10, 10), (1, 1)],
# [(10, 10, 1, 1), (10, 10)], # FIXME, it causes random CI failure
[(10, 10, 1, 1), (10, 10)],
] ]
for inp_shape, target_shape in test_cases: for inp_shape, target_shape in test_cases:
x = tensor(np.random.randn(*inp_shape), dtype=np.float32) x = tensor(np.random.randn(*inp_shape), dtype=np.float32)


+ 3
- 3
imperative/python/test/unit/random/test_rng.py View File

@@ -39,6 +39,8 @@ from megengine.random import uniform
get_device_count("xpu") <= 2, reason="xpu counts need > 2", get_device_count("xpu") <= 2, reason="xpu counts need > 2",
) )
def test_gaussian_op(): def test_gaussian_op():
# FIXME: remove this sync
mge.core.set_option("async_level", 0)
set_global_seed(1024) set_global_seed(1024)
shape = ( shape = (
8, 8,
@@ -210,12 +212,9 @@ def test_permutation_op():
assert str(output.device) == str(cn) assert str(output.device) == str(cn)
assert output.dtype == dtype assert output.dtype == dtype


# FIXME: remove this sync
mge.core.set_option("async_level", 0)
test_permutation_op_dtype(np.float32) test_permutation_op_dtype(np.float32)
test_permutation_op_dtype(np.int32) test_permutation_op_dtype(np.int32)
test_permutation_op_dtype(np.int16) test_permutation_op_dtype(np.int16)
mge.core.set_option("async_level", 2)




@pytest.mark.skipif( @pytest.mark.skipif(
@@ -517,3 +516,4 @@ def test_rng_empty_tensor(is_symbolic):
np.testing.assert_equal(out.numpy().shape, (0,)) np.testing.assert_equal(out.numpy().shape, (0,))
if is_symbolic is None: if is_symbolic is None:
break break
mge.core.set_option("async_level", 2)

Loading…
Cancel
Save