[test] refactored with the new rerun decorator (#763)

* [test] refactored with the new rerun decorator

* polish test case
This commit is contained in:
Frank Lee
2022-04-15 00:33:04 +08:00
committed by GitHub
parent deaf99f4c9
commit 5a1a095b92
34 changed files with 80 additions and 75 deletions

View File

@@ -9,7 +9,7 @@ from colossalai.context import ParallelMode
from colossalai.core import global_context as gpc
from colossalai.initialize import launch
from colossalai.utils import free_port, get_current_device
from colossalai.testing import rerun_on_exception
from colossalai.testing import rerun_if_address_is_in_use
CONFIG = dict(parallel=dict(data=8, pipeline=1, tensor=dict(mode=None, size=1)))
@@ -64,7 +64,7 @@ def check_layer(rank, world_size, port):
@pytest.mark.dist
@rerun_on_exception(exception_type=mp.ProcessRaisedException, pattern=".*Address already in use.*")
@rerun_if_address_is_in_use()
def test_comm():
world_size = 4
run_func = partial(check_layer, world_size=world_size, port=free_port())