未验证 提交 2b2be85f 编写于 作者: M Michael Wyatt 提交者: GitHub

Prevent hangs in CI during parallel run compilation (#2844)

上级 1b888399
......@@ -14,7 +14,7 @@ concurrency:
jobs:
unit-tests:
runs-on: ubuntu-20.04
runs-on: [self-hosted, cpu]
steps:
- uses: actions/checkout@v3
......
......@@ -39,6 +39,14 @@ def validate_version(expected, found):
return found == expected
# This fixture prevents hangs when 2+ pytest processes try to compile the same
# code at once and causes deadlocks / hangs
@pytest.fixture(scope="session", autouse=True)
def set_torch_ext_dir(worker_id):
torch_ext_dir = os.environ["TORCH_EXTENSIONS_DIR"]
os.environ["TORCH_EXTENSIONS_DIR"] = os.path.join(torch_ext_dir, worker_id)
@pytest.fixture(scope="session", autouse=True)
def check_environment(pytestconfig):
expected_torch_version = pytestconfig.getoption("torch_ver")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册