pytorch/test/distributed/rpc/test_faulty_agent.py
Michael Suo c978b609f7 [ci] remove IN_CI env var
The conventional env var to set is CI. Both circle and GHA set it, so
IN_CI is unnecessary

Pull Request resolved: https://github.com/pytorch/pytorch/pull/79229

Approved by: https://github.com/janeyx99
2022-06-11 17:16:30 +00:00

38 lines
956 B
Python

#!/usr/bin/env python3
# Owner(s): ["oncall: distributed"]
import sys
import torch
import torch.distributed as dist
if not dist.is_available():
print("Distributed not available, skipping tests", file=sys.stderr)
sys.exit(0)
from torch.testing._internal.common_utils import IS_CI, run_tests
from torch.testing._internal.distributed.rpc.faulty_rpc_agent_test_fixture import (
FaultyRpcAgentTestFixture,
)
from torch.testing._internal.distributed.rpc_utils import (
FAULTY_AGENT_TESTS,
generate_tests,
)
# On CircleCI these tests are already run on CPU jobs, thus to save resources do
# not run them on GPU jobs, since thet wouldn't provide additional test signal.
if not (IS_CI and torch.cuda.is_available()):
globals().update(
generate_tests(
"Faulty",
FaultyRpcAgentTestFixture,
FAULTY_AGENT_TESTS,
__name__,
)
)
if __name__ == "__main__":
run_tests()