Skip to content

[DRAFT][DO NOT MERGE] Test tvm-ffi 0.1.10rc#2599

Draft
yongwww wants to merge 4 commits intoflashinfer-ai:mainfrom
yongwww:upg_tvm_ffi
Draft

[DRAFT][DO NOT MERGE] Test tvm-ffi 0.1.10rc#2599
yongwww wants to merge 4 commits intoflashinfer-ai:mainfrom
yongwww:upg_tvm_ffi

Conversation

@yongwww
Copy link
Copy Markdown
Member

@yongwww yongwww commented Feb 20, 2026

📌 Description

🔍 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

Summary by CodeRabbit

  • Chores
    • CI now explicitly pins TVM-FFI to v0.1.10-rc2.
    • Test scripts print TVM-FFI version before running tests (non-fatal) for quick verification.
    • Test environment initialization was adjusted to ensure overrides are applied earlier for more consistent test discovery.

@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @yongwww, 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 updates the project's continuous integration configuration to pin the tvm-ffi dependency to a specific release candidate version. This change is intended to standardize the build environment and facilitate testing against a known version of the library, which is essential for maintaining stability and compatibility.

Highlights

  • TVM-FFI Version Pinning: The TVM_FFI_REF environment variable in the CI setup script has been explicitly set to v0.1.9-rc0, ensuring a specific version of tvm-ffi is used for builds.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • ci/setup_python.env
    • Set TVM_FFI_REF to v0.1.9-rc0 to specify the tvm-ffi version.
Activity
  • The pull request is currently in a [DRAFT] state, indicating it is still under development or awaiting initial feedback.
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.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Feb 20, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 55fd39de-7b21-4e98-a0b1-183438b8e750

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

CI now pins TVM_FFI_REF to v0.1.10-rc2. Test scripts were augmented to print tvm_ffi.__version__ (failures suppressed) at key steps. The unit test runner sources setup_test_env.sh earlier and still re-sources it after install.

Changes

Cohort / File(s) Summary
Environment Configuration
ci/setup_python.env
Set TVM_FFI_REF from commented/unset to v0.1.10-rc2.
Test Script Diagnostics
scripts/task_jit_run_tests_part1.sh, scripts/task_test_jit_cache_package_build_import.sh
Added `python -c "import tvm_ffi; print(tvm_ffi.version)"
Unit Test Script Setup
scripts/task_run_unit_tests.sh
Now sources setup_test_env.sh earlier (immediately after test_utils.sh) and retains re-sourcing after install_and_verify; also prints tvm_ffi.__version__ before test execution (failure-tolerant).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • yzh119
  • nvmbreughe
  • jimmyzho
  • kahyunnam

Poem

🐰 I hopped to the CI, set a version so neat,
I whisper my number before tests take a beat.
I sourced the right env, then peeked with a grin,
A tiny carrot of data to tuck safely in. 🥕

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description contains only the template with unchecked checklist items and no actual implementation details, goals, or rationale for the changes. Fill in the Description section with what this PR does and why the tvm-ffi upgrade is needed, and explain the changes made to CI/test scripts.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title indicates testing of tvm-ffi 0.1.10rc and is marked [DRAFT][DO NOT MERGE], which aligns with the changeset that pins TVM_FFI_REF to v0.1.10-rc2 and adds pre-test version checks across multiple scripts.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
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

The pull request updates the TVM_FFI_REF version in ci/setup_python.env to v0.1.9-rc0. This change is straightforward and directly addresses the stated objective of upgrading tvm-ffi. The change is minimal and appears correct for its intended purpose.

@yongwww yongwww changed the title [DRAFT] Upgrade tvm-ffi [DRAFT][DO NOT MERGE] Test tvm-ffi 0.1.9rc Feb 20, 2026
@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 20, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

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

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #44462250: 14/20 passed

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 20, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #44479402 is currently running. I'll report back once the pipeline job completes.

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 20, 2026

/bot stop

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

The GitLab CI pipeline #44479402 has been cancelled.

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 20, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #44485328 is currently running. I'll report back once the pipeline job completes.

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 21, 2026

/bot stop

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

The GitLab CI pipeline #44485328 has been cancelled.

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 21, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #44487970 is currently running. I'll report back once the pipeline job completes.

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 21, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #44488356 is currently running. I'll report back once the pipeline job completes.

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #44488356: 14/20 passed

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 22, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #44569871 is currently running. I'll report back once the pipeline job completes.

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 22, 2026

@flashinfer-bot rerun failed

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #44569871: 14/20 passed

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 22, 2026

@flashinfer-bot run failed

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Feb 23, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

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

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #44644054: 14/20 passed

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Mar 23, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #46802453 is currently running. I'll report back once the pipeline job completes.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/task_jit_run_tests_part1.sh`:
- Around line 16-20: The current python import line uses "|| true", which
suppresses import errors even when an override is active; change the behavior so
import failures are allowed to fail fast when TVM_FFI_REF is set: detect the
TVM_FFI_REF env var and run the python -c "import tvm_ffi; ..." without "||
true" when TVM_FFI_REF is non-empty, otherwise keep the existing tolerant
behavior (retain "|| true") when no override is active; update the python import
invocation (the line containing python -c "import tvm_ffi; print(...)") and
remove or conditionally apply the "|| true" accordingly (apply same fix to the
other occurrences referenced).

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 2681cded-0e94-4b79-ac15-97f90183935e

📥 Commits

Reviewing files that changed from the base of the PR and between 625c1c6 and c0b15f2.

📒 Files selected for processing (4)
  • ci/setup_python.env
  • scripts/task_jit_run_tests_part1.sh
  • scripts/task_run_unit_tests.sh
  • scripts/task_test_jit_cache_package_build_import.sh

Comment on lines +16 to +20
# Print TVM-FFI version just before running tests
echo "Checking TVM-FFI version before tests..."
python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
echo ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify remaining non-fatal TVM-FFI diagnostics in CI scripts
rg -nP --type=sh 'import tvm_ffi;.*\|\|\s*true'

Repository: flashinfer-ai/flashinfer

Length of output: 595


🏁 Script executed:

cat -n scripts/task_jit_run_tests_part1.sh | head -50

Repository: flashinfer-ai/flashinfer

Length of output: 1102


🏁 Script executed:

rg -nP 'TVM_FFI_REF' --type=sh

Repository: flashinfer-ai/flashinfer

Length of output: 333


🏁 Script executed:

cat -n scripts/setup_test_env.sh | head -100

Repository: flashinfer-ai/flashinfer

Length of output: 1192


🏁 Script executed:

cat -n scripts/task_test_jit_cache_package_build_import.sh | sed -n '70,125p'

Repository: flashinfer-ai/flashinfer

Length of output: 2084


🏁 Script executed:

cat -n scripts/task_run_unit_tests.sh | sed -n '85,100p'

Repository: flashinfer-ai/flashinfer

Length of output: 693


Fail the TVM-FFI version check when dependency override is active.

The || true on line 18 suppresses import errors that should block the test when TVM_FFI_REF is set. Testing a custom dependency ref should fail fast if the override is broken, not silently continue.

Suggested fix
 # Print TVM-FFI version just before running tests
 echo "Checking TVM-FFI version before tests..."
-python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
+if [ -n "${TVM_FFI_REF:-}" ]; then
+  python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')"
+else
+  python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
+fi
 echo ""

Note: The same issue exists at scripts/task_test_jit_cache_package_build_import.sh:77,118 and scripts/task_run_unit_tests.sh:92.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# Print TVM-FFI version just before running tests
echo "Checking TVM-FFI version before tests..."
python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
echo ""
# Print TVM-FFI version just before running tests
echo "Checking TVM-FFI version before tests..."
if [ -n "${TVM_FFI_REF:-}" ]; then
python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')"
else
python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
fi
echo ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/task_jit_run_tests_part1.sh` around lines 16 - 20, The current python
import line uses "|| true", which suppresses import errors even when an override
is active; change the behavior so import failures are allowed to fail fast when
TVM_FFI_REF is set: detect the TVM_FFI_REF env var and run the python -c "import
tvm_ffi; ..." without "|| true" when TVM_FFI_REF is non-empty, otherwise keep
the existing tolerant behavior (retain "|| true") when no override is active;
update the python import invocation (the line containing python -c "import
tvm_ffi; print(...)") and remove or conditionally apply the "|| true"
accordingly (apply same fix to the other occurrences referenced).

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #46802453: 13/20 passed

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Apr 2, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #47560590 is currently running. I'll report back once the pipeline job completes.

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[CANCELING] Pipeline #47560590: canceled

@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Apr 3, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #47602277 is currently running. I'll report back once the pipeline job completes.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
scripts/task_run_unit_tests.sh (1)

14-16: Remove the early sourcing of setup_test_env.sh to avoid redundant pip operations.

The early source at lines 14–15 executes before any code that depends on its package overrides. All subsequent functions (through line 70) are definitions only, and the main execution block doesn't reach setup_test_env.sh again until line 85. This means when TVM_FFI_REF is set, pip install/uninstall operations run twice in a single job, adding churn and complicating debugging.

Proposed simplification
-# Source test environment setup (handles package overrides like TVM-FFI)
-source "${SCRIPT_DIR}/setup_test_env.sh"
+# Defer package override application to the post-install source at Line 85
+# to avoid duplicate pip operations in the same run.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/task_run_unit_tests.sh` around lines 14 - 16, Remove the early
sourcing of setup_test_env.sh at the top of task_run_unit_tests.sh (the `source
"${SCRIPT_DIR}/setup_test_env.sh"` call) to prevent duplicate pip
install/uninstall when TVM_FFI_REF is set; instead, source setup_test_env.sh
only once inside the main execution block immediately before any code that
depends on the environment overrides (where the script currently performs
runtime actions), leaving all function definitions (the earlier block)
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/task_test_jit_cache_package_build_import.sh`:
- Around line 75-79: Update the echo message that precedes the TVM-FFI import to
accurately reflect when it runs: change the string "Checking TVM-FFI version
before verification tests..." to something like "Checking TVM-FFI version before
package installation..." so the log matches the execution point just before the
python -c "import tvm_ffi; ..." check; adjust only the echo text near the python
invocation to avoid confusing CI logs.

---

Nitpick comments:
In `@scripts/task_run_unit_tests.sh`:
- Around line 14-16: Remove the early sourcing of setup_test_env.sh at the top
of task_run_unit_tests.sh (the `source "${SCRIPT_DIR}/setup_test_env.sh"` call)
to prevent duplicate pip install/uninstall when TVM_FFI_REF is set; instead,
source setup_test_env.sh only once inside the main execution block immediately
before any code that depends on the environment overrides (where the script
currently performs runtime actions), leaving all function definitions (the
earlier block) unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a21cc0ba-8d8a-457c-85c6-e6ca55b7c5e8

📥 Commits

Reviewing files that changed from the base of the PR and between fb0f6db and 47b8ca9.

📒 Files selected for processing (4)
  • ci/setup_python.env
  • scripts/task_jit_run_tests_part1.sh
  • scripts/task_run_unit_tests.sh
  • scripts/task_test_jit_cache_package_build_import.sh
🚧 Files skipped from review as they are similar to previous changes (2)
  • scripts/task_jit_run_tests_part1.sh
  • ci/setup_python.env

Comment on lines +75 to +79
echo ""
echo "Checking TVM-FFI version before verification tests..."
python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
echo ""

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Fix the first TVM-FFI log label to match execution point.

On Line 76, the message says “before verification tests,” but this block runs before package installation. That can mislead CI debugging.

Proposed wording fix
-echo "Checking TVM-FFI version before verification tests..."
+echo "Checking TVM-FFI version before package installation..."
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
echo ""
echo "Checking TVM-FFI version before verification tests..."
python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
echo ""
echo ""
echo "Checking TVM-FFI version before package installation..."
python -c "import tvm_ffi; print(f'TVM-FFI version: {tvm_ffi.__version__}')" || true
echo ""
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/task_test_jit_cache_package_build_import.sh` around lines 75 - 79,
Update the echo message that precedes the TVM-FFI import to accurately reflect
when it runs: change the string "Checking TVM-FFI version before verification
tests..." to something like "Checking TVM-FFI version before package
installation..." so the log matches the execution point just before the python
-c "import tvm_ffi; ..." check; adjust only the echo text near the python
invocation to avoid confusing CI logs.

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #47602277: 7/20 passed

@yongwww yongwww marked this pull request as draft April 3, 2026 20:33
@yongwww
Copy link
Copy Markdown
Member Author

yongwww commented Apr 3, 2026

/bot run

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

GitLab MR !333 has been updated with latest changes, and the CI pipeline #47660310 is currently running. I'll report back once the pipeline job completes.

@flashinfer-bot
Copy link
Copy Markdown
Collaborator

[FAILED] Pipeline #47660310: 9/20 passed

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