-
Notifications
You must be signed in to change notification settings - Fork 584
CI: use libtorch in wheels via USE_PT_PYTHON_LIBS
#4720
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
CI: use libtorch in wheels via USE_PT_PYTHON_LIBS
#4720
Conversation
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.
Pull Request Overview
This PR updates the CI pipelines and installation documentation to switch from downloading a standalone libtorch package to using the pip‐installed torch (version 2.7 or higher).
- Updated installation instructions in the docs to remove the outdated ABI compatibility note.
- Modified several GitHub workflows (test_cuda, test_cc, codeql, build_cc) to pip install torch instead of downloading libtorch and to remove now-unnecessary environment variable settings.
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| doc/install/install-from-source.md | Removed warning about _GLIBCXX_USE_CXX11_ABI to reflect PyTorch 2.7's settings. |
| .github/workflows/test_cuda.yml | Removed libtorch download and environment variable settings; now uses pip-installed torch. |
| .github/workflows/test_cc.yml | Eliminated libtorch download and its related environment setup, replacing it with pip install of torch. |
| .github/workflows/codeql.yml | Removed libtorch download steps and the export of libtorch paths, now relying on pip install of torch. |
| .github/workflows/build_cc.yml | Updated to use pip installation of torch and removed outdated environment variable assignments referencing libtorch. |
Files not reviewed (2)
- source/install/build_cc.sh: Language not supported
- source/install/test_cc_local.sh: Language not supported
Comments suppressed due to low confidence (4)
.github/workflows/test_cuda.yml:82
- [nitpick] Consider adding a comment explaining the removal of libtorch from LD_LIBRARY_PATH to clarify the transition to using the pip-installed torch package.
export LD_LIBRARY_PATH=$CUDA_PATH/lib64:/usr/lib/x86_64-linux-gnu/:$GITHUB_WORKSPACE/dp_test/lib:$GITHUB_WORKSPACE/libtorch/lib:$LD_LIBRARY_PATH
.github/workflows/test_cc.yml:62
- [nitpick] Consider adding a comment to clarify that the removal of libtorch from LD_LIBRARY_PATH is intentional, given that the pip-installed torch manages library paths differently.
LD_LIBRARY_PATH: ${{ github.workspace }}/dp_test/lib:${{ github.workspace }}/libtorch/lib
.github/workflows/codeql.yml:54
- [nitpick] Consider including a comment to explain the removal of libtorch-related environment settings and to note the reliance on the pip-installed torch package.
export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/libtorch
.github/workflows/build_cc.yml:65
- [nitpick] Consider documenting the rationale for removing libtorch path assignments in favor of the pip-installed torch, to ease future maintenance.
export CMAKE_PREFIX_PATH=$GITHUB_WORKSPACE/libtorch
📝 Walkthrough""" WalkthroughThis update modifies the build, test, and analysis workflows as well as documentation and build scripts related to PyTorch integration. The workflows now install PyTorch via pip (version 2.7 or higher) instead of downloading and extracting the libtorch C++ distribution. Environment variables and steps referencing the local libtorch directory have been removed. Build scripts are updated to use the Changes
Sequence Diagram(s)sequenceDiagram
participant Workflow
participant pip
participant BuildScript
participant CMake
participant PyTorchPythonLibs
Workflow->>pip: Install torch>=2.7 from PyTorch CPU wheels
Workflow->>BuildScript: Run build_cc.sh/test_cc_local.sh
BuildScript->>CMake: Configure with -D USE_PT_PYTHON_LIBS=TRUE
CMake->>PyTorchPythonLibs: Use PyTorch Python libraries for build
Possibly related PRs
Suggested labels
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (3)
⏰ Context from checks skipped due to timeout of 90000ms (22)
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## devel #4720 +/- ##
=======================================
Coverage 84.80% 84.81%
=======================================
Files 696 696
Lines 67264 67263 -1
Branches 3541 3540 -1
=======================================
Hits 57046 57046
+ Misses 9085 9084 -1
Partials 1133 1133 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PyTorch 2.7 used
_GLIBCXX_USE_CXX11_ABI=1, so there is no block to enableUSE_PT_PYTHON_LIBS.Summary by CodeRabbit