ci: make multi-GPU jit test hangs attributable from the CI log (#29925)
This commit is contained in:
@@ -168,6 +168,10 @@ def multigpu_launch(
|
|||||||
os.environ[pid_key] = str(os.getpid())
|
os.environ[pid_key] = str(os.getpid())
|
||||||
os.environ.setdefault("OMP_NUM_THREADS", "1")
|
os.environ.setdefault("OMP_NUM_THREADS", "1")
|
||||||
os.environ.setdefault("GLOO_SOCKET_IFNAME", "lo") # single-machine setup
|
os.environ.setdefault("GLOO_SOCKET_IFNAME", "lo") # single-machine setup
|
||||||
|
# Unbuffered child stdout: when a worker is killed on timeout, pytest's
|
||||||
|
# block-buffered progress output is otherwise lost or flushed out of
|
||||||
|
# order into the CI log, making it impossible to tell which test hung.
|
||||||
|
os.environ.setdefault("PYTHONUNBUFFERED", "1")
|
||||||
signal.signal(signal.SIGINT, signal.default_int_handler)
|
signal.signal(signal.SIGINT, signal.default_int_handler)
|
||||||
runnable: List[int] = []
|
runnable: List[int] = []
|
||||||
for N in sorted(num_gpus):
|
for N in sorted(num_gpus):
|
||||||
|
|||||||
@@ -43,7 +43,14 @@ def multigpu_pytest_main(
|
|||||||
# CI's run_unittest_files invokes `python3 <file> -f` (legacy
|
# CI's run_unittest_files invokes `python3 <file> -f` (legacy
|
||||||
# unittest failfast). Translate to pytest's `-x` so it survives.
|
# unittest failfast). Translate to pytest's `-x` so it survives.
|
||||||
pytest_args = ["-x" if a == "-f" else a for a in sys.argv[1:]]
|
pytest_args = ["-x" if a == "-f" else a for a in sys.argv[1:]]
|
||||||
return pytest.main([file] + pytest_args)
|
# Dump all thread stacks (every rank; stderr is not redirected) if a
|
||||||
|
# single test exceeds half the harness budget, so a hung collective
|
||||||
|
# is attributable from the CI log before the outer timeout kills the
|
||||||
|
# process group. Non-fatal: the test keeps running after the dump.
|
||||||
|
dump_after = (timeout // 2) if timeout else 300
|
||||||
|
return pytest.main(
|
||||||
|
[file, "-o", f"faulthandler_timeout={dump_after}"] + pytest_args
|
||||||
|
)
|
||||||
|
|
||||||
return multigpu_launch(
|
return multigpu_launch(
|
||||||
name,
|
name,
|
||||||
|
|||||||
Reference in New Issue
Block a user