Skip to content

Commit d17f843

Browse files
committed
DEBUG: revert cleaning cache changes on Windows
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent 9b7fbe1 commit d17f843

File tree

5 files changed

+20
-32
lines changed

5 files changed

+20
-32
lines changed

python/test/regression/conftest.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ def device(request):
1414

1515
@pytest.fixture
1616
def fresh_triton_cache():
17-
try:
18-
with tempfile.TemporaryDirectory() as tmpdir:
19-
try:
20-
os.environ["TRITON_CACHE_DIR"] = tmpdir
21-
yield tmpdir
22-
finally:
23-
os.environ.pop("TRITON_CACHE_DIR", None)
24-
except OSError:
25-
# Ignore errors, such as PermissionError, on Windows
26-
pass
17+
with tempfile.TemporaryDirectory() as tmpdir:
18+
try:
19+
os.environ["TRITON_CACHE_DIR"] = tmpdir
20+
yield tmpdir
21+
finally:
22+
os.environ.pop("TRITON_CACHE_DIR", None)

python/test/unit/conftest.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,12 @@ def device(request):
1414

1515
@pytest.fixture
1616
def fresh_triton_cache():
17-
try:
18-
with tempfile.TemporaryDirectory() as tmpdir:
19-
try:
20-
os.environ["TRITON_CACHE_DIR"] = tmpdir
21-
yield tmpdir
22-
finally:
23-
os.environ.pop("TRITON_CACHE_DIR", None)
24-
except OSError:
25-
# Ignore errors, such as PermissionError, on Windows
26-
pass
17+
with tempfile.TemporaryDirectory() as tmpdir:
18+
try:
19+
os.environ["TRITON_CACHE_DIR"] = tmpdir
20+
yield tmpdir
21+
finally:
22+
os.environ.pop("TRITON_CACHE_DIR", None)
2723

2824

2925
def pytest_configure(config):

python/test/unit/runtime/test_cache.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,7 +489,7 @@ def cache_hook(*args, **kwargs):
489489
assert specialization_data is not None
490490

491491
# clear the cache
492-
shutil.rmtree(fresh_triton_cache, ignore_errors=True)
492+
shutil.rmtree(fresh_triton_cache)
493493
kernel_add.device_caches[device][0].clear()
494494

495495
# preload the kernel

python/test/unit/runtime/test_subproc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_compile_in_forked_subproc_with_forced_gc(fresh_triton_cache) -> None:
8787
compile_empty_kernel_with_gc()
8888

8989
# stage 2.p
90-
shutil.rmtree(fresh_triton_cache, ignore_errors=True)
90+
shutil.rmtree(fresh_triton_cache)
9191
mp_ctx = multiprocessing.get_context(start_method)
9292
proc = mp_ctx.Process(target=compile_empty_kernel_with_gc)
9393

third_party/intel/python/test/conftest.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,9 @@ def device(request):
1414

1515
@pytest.fixture
1616
def fresh_triton_cache():
17-
try:
18-
with tempfile.TemporaryDirectory() as tmpdir:
19-
try:
20-
os.environ["TRITON_CACHE_DIR"] = tmpdir
21-
yield tmpdir
22-
finally:
23-
os.environ.pop("TRITON_CACHE_DIR", None)
24-
except OSError:
25-
# Ignore errors, such as PermissionError, on Windows
26-
pass
17+
with tempfile.TemporaryDirectory() as tmpdir:
18+
try:
19+
os.environ["TRITON_CACHE_DIR"] = tmpdir
20+
yield tmpdir
21+
finally:
22+
os.environ.pop("TRITON_CACHE_DIR", None)

0 commit comments

Comments
 (0)