File tree Expand file tree Collapse file tree 5 files changed +20
-32
lines changed
third_party/intel/python/test Expand file tree Collapse file tree 5 files changed +20
-32
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,9 @@ def device(request):
1414
1515@pytest .fixture
1616def 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 )
Original file line number Diff line number Diff line change @@ -14,16 +14,12 @@ def device(request):
1414
1515@pytest .fixture
1616def 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
2925def pytest_configure (config ):
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -14,13 +14,9 @@ def device(request):
1414
1515@pytest .fixture
1616def 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 )
You can’t perform that action at this time.
0 commit comments