From af76c989eb4799b015f8b288ccd8421558772e56 Mon Sep 17 00:00:00 2001 From: Philippe Tillet Date: Tue, 11 Oct 2022 13:24:30 -0700 Subject: [PATCH] [RUNTIME] Make entry point cache key depend on triton version hash (#765) --- python/triton/compiler.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/triton/compiler.py b/python/triton/compiler.py index 9c74cd896..1332f2c76 100644 --- a/python/triton/compiler.py +++ b/python/triton/compiler.py @@ -1197,10 +1197,10 @@ def _build(name, src, srcdir): return so -def make_so_cache_key(signature, constants): +def make_so_cache_key(version_hash, signature, constants): # Get unique key for the compiled code signature = {k: 'ptr' if v[0] == '*' else v for k, v in signature.items()} - key = f"{''.join(signature.values())}{constants}" + key = f"{version_hash}-{''.join(signature.values())}{constants}" key = hashlib.md5(key.encode("utf-8")).hexdigest() return key @@ -1221,7 +1221,7 @@ def compile(fn, signature: str, device: int = -1, constants=dict(), num_warps: i # cache manager name = fn.__name__ # name of files that are cached - so_cache_key = make_so_cache_key(signature, constants) + so_cache_key = make_so_cache_key(triton.runtime.jit.version_key(), signature, constants) so_cache_manager = CacheManager(so_cache_key) so_name = f"{name}.so" # retrieve stub from cache if it exists