-
Notifications
You must be signed in to change notification settings - Fork 529
[wip] ci: add release workflow for flashinfer-jit-cache
package
#1858
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
base: main
Are you sure you want to change the base?
Conversation
Summary of ChangesHello @yzh119, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request finalizes the continuous integration (CI) release workflow for the Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This pull request introduces a new script to update the wheel index for flashinfer-jit-cache
as part of a new release workflow. The script is functional but has a few areas for improvement regarding robustness and efficiency. I've identified a potential issue with how the index file is generated which could lead to duplicate entries, a memory inefficiency in hash calculation, and a fragile regular expression for version parsing. My review includes suggestions to address these points.
with (index_dir / "index.html").open("a") as f: | ||
f.write(f'<a href="{full_url}">{path.name}</a><br>\n') |
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.
Opening the index.html
file in append mode ("a"
) can lead to duplicate entries if the script is run multiple times on the same set of wheel files. This could result in a malformed package index. A more robust approach would be to collect all links for each CUDA version first, and then write the index.html
file once for each, overwriting any existing file. This ensures the index is always clean and correct.
with open(path, "rb") as f: | ||
sha256 = hashlib.sha256(f.read()).hexdigest() |
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.
Reading the entire file into memory to calculate the SHA256 hash can be inefficient and cause high memory usage for large wheel files. It's a better practice to read the file in chunks to avoid this.
with open(path, "rb") as f: | |
sha256 = hashlib.sha256(f.read()).hexdigest() | |
sha256_hash = hashlib.sha256() | |
with open(path, "rb") as f: | |
while chunk := f.read(4096): | |
sha256_hash.update(chunk) | |
sha256 = sha256_hash.hexdigest() |
# Example: flashinfer_jit_cache-1.2.3rc1+cu128-cp39-abi3-manylinux_2_28_x86_64.whl | ||
# Example: flashinfer_jit_cache-1.2.3.post1+cu128-cp39-abi3-manylinux_2_28_x86_64.whl | ||
match = re.search( | ||
r"flashinfer_jit_cache-([0-9]+\.[0-9]+\.[0-9]+[a-z0-9.]*)\+cu(\d+)-", |
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.
The regular expression for parsing the version string is quite specific and might break if the versioning scheme changes slightly (e.g., from 1.2.3
to 1.3
). Using a more general pattern would make the script more robust and less prone to breaking on future version format changes.
r"flashinfer_jit_cache-([0-9]+\.[0-9]+\.[0-9]+[a-z0-9.]*)\+cu(\d+)-", | |
r"flashinfer_jit_cache-([\w.]+)\+cu(\d+)-", |
flashinfer-jit-cache
packageflashinfer-jit-cache
package
📌 Description
This PR finalize the
.github/workflows/release-flashinfer-jit-cache-wheel.yml
workflow by adding release job following build-wheel job.🔍 Related Issues
#1726
🚀 Pull Request Checklist
Thank you for contributing to FlashInfer! Before we review your pull request, please make sure the following items are complete.
✅ Pre-commit Checks
pre-commit
by runningpip install pre-commit
(or used your preferred method).pre-commit install
.pre-commit run --all-files
and fixed any reported issues.🧪 Tests
unittest
, etc.).Reviewer Notes