npx skills add ...
npx skills add nvidia/tensorrt-llm --skill trtllm-flashinfer-upgrade
Upgrade flashinfer-python version in TensorRT-LLM. Fetches the latest releases from GitHub (stable and nightly), compares with the current pinned version, lets the user pick a target version, and updates all version references across the repo. Use when the user wants to bump or upgrade flashinfer.
npx skills add nvidia/tensorrt-llm --skill trtllm-flashinfer-upgrade
Automates upgrading the flashinfer-python package version across TensorRT-LLM.
Query gh for the authenticated user's login:
If this fails, gh is not authenticated — resolve Step 0c first, then retry.
As a fallback, derive the username from the fork remote:
If neither works, ask the user via AskUserQuestion.
Check that a git remote pointing to the user's fork of TensorRT-LLM exists:
If no fork remote is found, stop and notify the user:
No GitHub fork remote detected. A fork of
NVIDIA/TensorRT-LLMis required to push branches and create PRs.
- Fork the repo at https://github.com/NVIDIA/TensorRT-LLM/fork
- Add it as a git remote:
- Re-run this skill.
gh CLI Is AuthenticatedThis skill uses the GitHub CLI (gh) to push branches and open PRs. Confirm it is
installed and authenticated:
Expected: Logged in to github.com with at least the repo scope. repo covers
pushing to the user's fork and opening PRs on NVIDIA/TensorRT-LLM, so no
separate fine-grained PATs are needed.
If gh reports "not logged in", instruct the user:
Choose: GitHub.com → HTTPS → authenticate with a web browser (or paste a PAT with
reposcope).
Note on GH_CONFIG_DIR: If the user keeps multiple gh accounts (e.g. a
personal account and a separate account for NVIDIA/TensorRT-LLM work), they may
point gh at a non-default config directory. Check CLAUDE.local.md /
AGENTS.md or the environment for GH_CONFIG_DIR; if unclear, ask the user.
When set, prefix every gh invocation: GH_CONFIG_DIR=<path> gh ....
Do not proceed with the upgrade workflow until gh auth status is clean and
the fork remote (Step 0b) is confirmed.
Execute these steps in order. Use AskUserQuestion for user choices and
WebFetch / GitHub API for release data.
Fetch the release list from https://github.com/flashinfer-ai/flashinfer/releases.
Use WebFetch with the URL https://github.com/flashinfer-ai/flashinfer/releases
and extract all release tag names and dates. Collect both stable releases
(e.g., v0.6.7) and pre-release / nightly tags (e.g., v0.7.0.dev20260401).
Alternatively, use the GitHub API via curl:
Read the current pinned version from requirements.txt:
Expected format: flashinfer-python==X.Y.Z
Ask the user three questions using AskUserQuestion:
"Prefer a latest nightly release version?"
"Which flashinfer-python version do you want to upgrade to?"
"Also update security_scanning/poetry.lock?"
metadata.content-hash values.security_scanning/poetry.lock
hashes" subsection below; otherwise skip it entirely (do not touch
security_scanning/poetry.lock).After the user selects a target version, update these files:
| File | What to change | Always |
|---|---|---|
requirements.txt | flashinfer-python==OLD → flashinfer-python==NEW | Yes |
security_scanning/pyproject.toml | "flashinfer-python (==OLD)" → "flashinfer-python (==NEW)" | Yes |
ATTRIBUTIONS-Python.md | ## flashinfer-python (OLD) → ## flashinfer-python (NEW) | Yes |
security_scanning/poetry.lock | Update version = "OLD" → version = "NEW" under [[package]] name = "flashinfer-python", and update the files list with new hashes | Only if user opted in at Step 3 question 3 |
security_scanning/poetry.lock hashesOnly perform this subsection if the user answered Yes to question 3 in Step 3. Otherwise skip it entirely.
The poetry.lock file contains SHA256 hashes for the wheel and sdist. Fetch them from PyPI:
Replace the old files = [...] block under [[package]] name = "flashinfer-python"
with the new filenames and hashes. Also update the [package.dependencies] section
if the new version has different dependencies (check PyPI JSON requires_dist).
Important: After manually editing both security_scanning/pyproject.toml and
security_scanning/poetry.lock, the lockfile's metadata.content-hash becomes stale.
Regenerate it by running:
This refreshes the hash without changing any other package versions. If poetry is
available, you can alternatively use poetry add flashinfer-python@NEW_VERSION in the
security_scanning/ directory to update both pyproject.toml and poetry.lock
automatically (including the content-hash).
If the user selects a nightly/dev version (e.g., 0.7.0.dev20260401):
curl -s "https://pypi.org/pypi/flashinfer-python/VERSION/json".security_scanning/poetry.lock hashes cannot be updated.
Warn the user and leave a # TODO: update hashes when published to PyPI comment.requirements.txt can pin to a git install instead:
flashinfer-python @ git+https://github.com/flashinfer-ai/flashinfer.git@TAG#egg=flashinfer-python
Ask the user which approach they prefer (PyPI pin vs git pin).After updating, check if any code has version-gated logic that needs adjusting:
Known locations with version checks:
tensorrt_llm/_torch/speculative/interface.py — flashinfer.__version__ >= "0.6.4"If the new version is still >= the gated version, no changes needed. Otherwise, flag to the user.
Print a summary of all changes made:
pip install -r requirements.txt to test locallyAfter all files are updated and verified:
If the user opted out of the
poetry.lockupdate at Step 3 question 3, dropsecurity_scanning/poetry.lockfrom thegit stash,git add, and commit message in the snippets below.
Where GITHUB_USERNAME comes from the fork remote (e.g., yihwang-nv) and
NEW_VERSION is the selected version (e.g., 0.6.7.post3).
Identify the fork remote (from Step 0b — commonly named fork), then push:
If the push is rejected for auth reasons, confirm gh auth status shows repo
scope — gh installs a git credential helper that reuses its token for HTTPS
pushes. Users on a non-default config dir must export GH_CONFIG_DIR in the
same shell.
NVIDIA/TensorRT-LLMgh pr create prints the new PR URL on success. Report it back to the user.
All files that contain flashinfer-python version pins:
| File | Pattern |
|---|---|
requirements.txt | flashinfer-python==X.Y.Z |
security_scanning/pyproject.toml | "flashinfer-python (==X.Y.Z)" |
security_scanning/poetry.lock | name = "flashinfer-python" block with version + hashes |
ATTRIBUTIONS-Python.md | ## flashinfer-python (X.Y.Z) |
setup.py has a comment about git+https install URLs — no version pin to update there..pre-commit-config.yaml and pyproject.toml reference flashinfer source files, not versions — no changes needed.flashinfer/ submodule (if present) is separate from the flashinfer-python PyPI package.git remote -v | grep -E 'github\.com/${GITHUB_USERNAME}/TensorRT-LLM'