[Bugfix] Fix 'InductorAdaptor object has no attribute 'cache_dir' (#15674)

Signed-off-by: Jee Jee Li <pandaleefree@gmail.com>
This commit is contained in:
Jee Jee Li 2025-03-28 17:10:40 +08:00 committed by GitHub
parent 280d074103
commit 70f2c2a709
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -144,6 +144,7 @@ class InductorAdaptor(CompilerInterface):
return hash_str
def initialize_cache(self, cache_dir: str, disable_cache: bool = False):
self.cache_dir = cache_dir
if disable_cache:
return
# redirect the cache directory to a sub-directory
@ -156,7 +157,6 @@ class InductorAdaptor(CompilerInterface):
triton_cache = os.path.join(cache_dir, "triton_cache")
os.makedirs(triton_cache, exist_ok=True)
os.environ["TRITON_CACHE_DIR"] = triton_cache
self.cache_dir = cache_dir
def compile(
self,