Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust tpu timeout #3246

Merged
merged 1 commit into from
May 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions tests/ignite/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,16 @@ def distributed(request, local_rank, world_size):

@pytest.hookimpl
def pytest_pyfunc_call(pyfuncitem: pytest.Function) -> None:
if any(fx in pyfuncitem.fixturenames for fx in ["distributed", "multinode_distributed"]):
# Run distributed tests on a single worker to avoid RACE conditions
# This requires that the --dist=loadgroup option be passed to pytest.
pyfuncitem.add_marker(pytest.mark.xdist_group("distributed"))
# Add timeouts to prevent hanging
if "tpu" in pyfuncitem.fixturenames:
pyfuncitem.add_marker(pytest.mark.timeout(60))
else:
pyfuncitem.add_marker(pytest.mark.timeout(45))

if pyfuncitem.stash.get(is_horovod_stash_key, False):

def testfunc_wrapper(test_func, **kwargs):
Expand Down Expand Up @@ -498,14 +508,3 @@ def xla_worker(index, fn):
assert ex_.code == 0, "Didn't successfully exit in XLA test"

pyfuncitem.obj = functools.partial(testfunc_wrapper, pyfuncitem.obj)


def pytest_collection_modifyitems(items):
for item in items:
if "distributed" in item.fixturenames:
# Run distributed tests on a single worker to avoid RACE conditions
# This requires that the --dist=loadgroup option be passed to pytest.
item.add_marker(pytest.mark.xdist_group("distributed"))
item.add_marker(pytest.mark.timeout(45))
if "multinode_distributed" in item.fixturenames:
item.add_marker(pytest.mark.timeout(45))
Loading