Skip to content

Commit

Permalink
Fix for ruff
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Parnell <tpa@zurich.ibm.com>
  • Loading branch information
tdoublep committed May 29, 2024
1 parent d5910bb commit ed54561
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions triton_patch/custom_cache_manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import os
from triton.runtime.cache import FileCacheManager, default_dump_dir, default_override_dir, default_cache_dir
from triton.runtime.cache import (
FileCacheManager,
default_dump_dir,
default_override_dir,
default_cache_dir
)


class CustomCacheManager(FileCacheManager):

Expand All @@ -16,7 +22,8 @@ def __init__(self, key, override=False, dump=False):
self.cache_dir = os.path.join(self.cache_dir, self.key)
else:
# create cache directory if it doesn't exist
self.cache_dir = os.getenv("TRITON_CACHE_DIR", "").strip() or default_cache_dir()
self.cache_dir = os.getenv("TRITON_CACHE_DIR",
"").strip() or default_cache_dir()
self.cache_dir = self.cache_dir + "_" + str(os.getpid())
print(f"{self.cache_dir=}")
if self.cache_dir:
Expand Down

0 comments on commit ed54561

Please sign in to comment.