Skip to content

Commit

Permalink
On Windows use Triton cache dir per pytest worker (#3041)
Browse files Browse the repository at this point in the history
Fixes #2777.
  • Loading branch information
pbchekin authored Dec 20, 2024
1 parent 97ba60e commit 00858c3
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions python/test/unit/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ def fresh_triton_cache():
except OSError:
# Ignore errors, such as PermissionError, on Windows
pass


def pytest_configure(config):
worker_id = os.getenv("PYTEST_XDIST_WORKER")
# On Windows, use a dedicated Triton cache per pytest worker to avoid PermissionError.
if os.name == "nt" and worker_id:
os.environ["TRITON_CACHE_DIR"] = tempfile.mkdtemp(prefix="triton-")

0 comments on commit 00858c3

Please sign in to comment.