Skip to content

Commit

Permalink
feat: invalidate cache if requirements change
Browse files Browse the repository at this point in the history
  • Loading branch information
meakbiyik committed Sep 1, 2023
1 parent 8264279 commit 18eb48e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions torchcache/torchcache.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ def wrap_module(
logger.error(f"Could not retrieve the module source: {e}")
# If the module source cannot be retrieved, we use the module name
hash_string = module.__class__.__name__ + repr(args) + repr(kwargs)
# Also add the crucial parameters of torchcache
hash_string += repr(self.subsample_count) + repr(self.zstd_compression)
logger.debug(f"Module hash string: {hash_string}")
self.module_hash = hashlib.blake2b(
hash_string.encode(),
Expand Down

0 comments on commit 18eb48e

Please sign in to comment.