jax icon indicating copy to clipboard operation
jax copied to clipboard

[`LRUCache`] Storing the last access time of a cache entry in a separate file

Open ayaka14732 opened this issue 1 year ago • 2 comments

This PR is a follow-up of https://github.com/google/jax/pull/21394. It stores the last access time of a cache entry in a separate file for LRUCache. Previously, the information was stored in the file metadata (mtime).

This PR is part of the process to add LRU cache eviction policy for the JAX persistent compilation cache. This change is necessary because we want to support GCS and potentially other cloud storage providers, where the mtime attribute may be either not available or very complicated to modify.

I am planning to get this PR merged before https://github.com/google/jax/pull/21893, because this one is more complicated and merging this PR first will make it easier to resolve merge conflicts.

Details

Previous behavior:

If cache entries: ['a', 'b'] Then cache files: ['cache_dir/a', 'cache_dir/b']

Modified behavior:

If cache entries: ['a', 'b'] Then cache files: ['cache_dir/a-cache.bin', 'cache_dir/b-cache.bin', 'cache_dir/a-atime.txt', 'cache_dir/b-atime.txt']

ayaka14732 avatar Jun 17 '24 20:06 ayaka14732

Blocked by the failed CompilationCacheTest above

ayaka14732 avatar Jun 19 '24 12:06 ayaka14732

Need https://github.com/google/jax/pull/21982 to be merged first

ayaka14732 avatar Jun 19 '24 17:06 ayaka14732