-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[Attention] Added caching for flashinfer binaries during JIT #17730
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
Conversation
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.
Thank you so much @annanyapr! I left a few comments
if hash_file.exists(): | ||
with open(hash_file, "r") as f: | ||
cached_hash = f.read().strip() | ||
if cached_hash == system_lib_hash_value: | ||
# Cache hit: return all object files in build_directory | ||
return list(build_directory.glob("*.o")) |
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.
For cache hit, we also need to make sure all .o files exist and are not modified. If any of the .o files is missing or is modified since the latest_object_mtime
, we also need to recompile. So let's add this into the hash key as well.
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 think its good to check for existance of the object file, but wouldn't the second condition will be never true(because of the definition of the latest_object_mtime). I think we should be pretty safe after the deletion check.
@MasterJH5574 I have addressed the PR reviews. |
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.
LGTM. Thank you @annanyapr!
…17730) In this PR I have added support for caching the flashinfer binaries during the JIT flow in TVM.
In this PR I have added support for caching the flash infer binaries during the JIT flow in TVM.