Skip to content

Conversation

yzh119
Copy link
Collaborator

@yzh119 yzh119 commented Oct 4, 2025

📌 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

  • I have installed pre-commit by running pip install pre-commit (or used your preferred method).
  • I have installed the hooks with pre-commit install.
  • I have run the hooks manually with pre-commit run --all-files and fixed any reported issues.

If you are unsure about how to set up pre-commit, see the pre-commit documentation.

🧪 Tests

  • Tests have been added or updated as needed.
  • All tests are passing (unittest, etc.).

Reviewer Notes

Copy link
Contributor

Summary of Changes

Hello @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 flashinfer-jit-cache package by introducing a new script. This script is designed to automate the creation of a discoverable and verifiable index for the package's wheel files, ensuring that releases are properly organized and accessible to users based on their CUDA versions.

Highlights

  • New Wheel Indexing Script: A new Python script, scripts/update_flashinfer_jit_cache_whl_index.py, has been added to automate the generation of an HTML index for flashinfer-jit-cache wheel files.
  • Automated Metadata Extraction: The script automatically parses wheel filenames to extract package version and associated CUDA version, which are crucial for organizing the release artifacts.
  • SHA256 Checksum Generation: For each wheel file, the script calculates and includes its SHA256 checksum in the generated index, enhancing integrity verification for users.
  • Structured Wheel Index: The script creates a structured directory (flashinfer-whl/cu{cuda_version}/flashinfer-jit-cache) and populates an index.html file within it, linking to the wheel files hosted on GitHub releases.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/release-flashinfer-jit-cache-wheel.yml
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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.

Comment on lines +30 to +31
with (index_dir / "index.html").open("a") as f:
f.write(f'<a href="{full_url}">{path.name}</a><br>\n')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Comment on lines +6 to +7
with open(path, "rb") as f:
sha256 = hashlib.sha256(f.read()).hexdigest()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
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+)-",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
r"flashinfer_jit_cache-([0-9]+\.[0-9]+\.[0-9]+[a-z0-9.]*)\+cu(\d+)-",
r"flashinfer_jit_cache-([\w.]+)\+cu(\d+)-",

@yzh119 yzh119 changed the title ci: add release workflow for flashinfer-jit-cache package [wip] ci: add release workflow for flashinfer-jit-cache package Oct 4, 2025
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.

1 participant