-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't write atime file if JAX_COMPILATION_CACHE_MAX_SIZE == -1 #26529
base: main
Are you sure you want to change the base?
Conversation
The atime file is only needed to implement the LRU eviction policy, which is only needed if a max persistence compilation cache size is set. Writing this file can cause network filesystem performace and other issues, so only write it if users are opted-in.
@@ -94,7 +94,6 @@ def get(self, key: str) -> bytes | None: | |||
raise ValueError("key cannot be empty") | |||
|
|||
cache_path = self.path / f"{key}{_CACHE_SUFFIX}" | |||
atime_path = self.path / f"{key}{_ATIME_SUFFIX}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep the atime_path
definition here because it's clearer and it will not actually write the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disagree! I think variables only used in a conditional scope should be defined in the conditional scope. See the one true style guide: https://google.github.io/styleguide/cppguide.html#Local_Variables ("Place a function's variables in the narrowest scope possible")
Co-authored-by: Ayaka <[email protected]>
Co-authored-by: Ayaka <[email protected]>
Co-authored-by: Ayaka <[email protected]>
The atime file is only needed to implement the LRU eviction policy, which is only needed if a max persistence compilation cache size is set. Writing this file can cause network filesystem performace and other issues, so only write it if users are opted-in.