Skip to content

Conversation

annanyapr
Copy link
Contributor

In this PR I have added support for caching the flash infer binaries during the JIT flow in TVM.

Copy link
Contributor

@MasterJH5574 MasterJH5574 left a 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

Comment on lines 68 to 73
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"))
Copy link
Contributor

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.

Copy link
Contributor Author

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 MasterJH5574 changed the title Added caching for flashinfer binaries during JIT [Attention] Added caching for flashinfer binaries during JIT Mar 10, 2025
@annanyapr
Copy link
Contributor Author

@MasterJH5574 I have addressed the PR reviews.

@annanyapr annanyapr requested a review from MasterJH5574 March 13, 2025 04:43
Copy link
Contributor

@MasterJH5574 MasterJH5574 left a 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!

@MasterJH5574 MasterJH5574 merged commit a7895a3 into apache:main Mar 13, 2025
10 checks passed
ShiboXing pushed a commit to ShiboXing/tvm that referenced this pull request Aug 10, 2025
…17730)

In this PR I have added support for caching the flashinfer binaries
during the JIT flow in TVM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants