Skip to content

Conversation

yzh119
Copy link
Collaborator

@yzh119 yzh119 commented Oct 6, 2025

📌 Description

Duplicate of #1867, created from flashinfer/nightly to get write permission.

🔍 Related Issues

🚀 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 significantly upgrades the CI/CD infrastructure for FlashInfer's Python, JIT cache, and Cubin packages, primarily to support robust nightly builds. Key improvements include a more granular versioning system that incorporates Git commit hashes and development suffixes, a sophisticated wheel index generation script capable of handling various package types and CUDA versions, and a streamlined approach to managing cubin artifacts. These changes ensure better traceability, clearer release identification, and a more efficient distribution pipeline for FlashInfer components.

Highlights

  • Enhanced Versioning: Implemented a mechanism to embed the Git commit hash (git_version) into the _build_meta.py files for flashinfer-python, flashinfer-jit-cache, and flashinfer-cubin packages, providing more precise version tracking.
  • Development Release Support: Added support for a FLASHINFER_DEV_RELEASE_SUFFIX environment variable, allowing for clear identification of development builds in package versions.
  • Refactored Wheel Indexing: Overhauled the update_whl_index.py script to intelligently process and index wheels for flashinfer-python, flashinfer-cubin, and flashinfer-jit-cache, including CUDA-specific indexing for JIT cache packages.
  • Streamlined Cubin Handling: Removed the standalone flashinfer-cubin/download_cubins.py script, suggesting integration or simplification of cubin artifact management within the build process.
  • Build Script Improvements: Updated build_flashinfer_jit_cache_whl.sh to include detailed logging of build parameters and post-build verification of package versions and Git hashes.
Ignored Files
  • Ignored by pattern: .github/workflows/** (1)
    • .github/workflows/nightly-release.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 adds nightly build and CI capabilities, including embedding git version information into the packages. The changes are generally good, but there are a few important issues to address.

Most critically, there's a leftover line of debugging code in flashinfer/aot.py that will break the AOT build. I've also identified a high-severity issue in scripts/update_whl_index.py where the generated HTML for the wheel index is not valid according to PEP 503. Additionally, there's an opportunity to improve maintainability by refactoring a duplicated _get_git_version function used across several build scripts.

Please see the detailed comments for suggestions on how to fix these issues.

@yzh119
Copy link
Collaborator Author

yzh119 commented Oct 7, 2025

The binary bloat issue is fixed in 06ffe13 (introduced in #1659)

The cubloaty tool helps identifying that most of the binary size comes from debug info

Before the commit:

        Non-Code Sections (Debug Info, Metadata, etc.)        
╭───────────────────────────┬─────────────────┬──────────────╮
│ Section Type              │      Total Size │   % of Total │
├───────────────────────────┼─────────────────┼──────────────┤
│ debug info                │         159.4MB │        82.9% │
│ metadata                  │           3.5MB │         1.8% │
│ data sections             │         798.6KB │         0.4% │
├───────────────────────────┼─────────────────┼──────────────┤
│ SUBTOTAL                  │         163.7MB │        85.1% │
╰───────────────────────────┴─────────────────┴──────────────╯

After the commit, the ratio of non-code sections drops from 85% to 21%.

@yongwww
Copy link
Collaborator

yongwww commented Oct 7, 2025

/bot run

@flashinfer-bot
Copy link
Collaborator

GitLab MR !66 has been created, and the CI pipeline #36172190 is currently running. I'll report back once the pipeline job completes.

@flashinfer-ai flashinfer-ai deleted a comment from flashinfer-bot Oct 7, 2025
os.makedirs(jit_env.FLASHINFER_CSRC_DIR, exist_ok=True)


class MissingJITCacheError(RuntimeError):
Copy link
Contributor

Choose a reason for hiding this comment

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

Move to utils where other errors are declared?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It introduce some annoying circular dependencies, maybe we can refactor the structure that after this PR?

Copy link
Contributor

@nvmbreughe nvmbreughe left a comment

Choose a reason for hiding this comment

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

LGTM!

@nvmbreughe nvmbreughe merged commit 68826ac into main Oct 8, 2025
3 checks passed
@nvmbreughe nvmbreughe deleted the nightly branch October 8, 2025 19:11
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.

4 participants