-
Notifications
You must be signed in to change notification settings - Fork 527
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
breaking(pt): drop PyTorch 2.0 support #4383
Conversation
Fix deepmodeling#4382. See kulinseth/pytorch@241f586. Signed-off-by: Jinzhe Zeng <[email protected]>
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no suggestions.
📝 Walkthrough📝 WalkthroughWalkthroughThe pull request introduces updates to the Changes
Possibly related PRs
Suggested reviewers
Warning Rate limit exceeded@njzjz has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 5 minutes and 22 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 (
|
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.
Actionable comments posted: 2
🧹 Outside diff range and nitpick comments (1)
doc/backend.md (1)
23-23
: LGTM! Consider adding migration notes.The version requirement update aligns with the PR objective to drop PyTorch 2.0 support. Since this is a breaking change, consider adding migration instructions for users currently on PyTorch 2.0.
Add a note like:
[PyTorch](https://pytorch.org/) 2.1 or above is required. +> **Note**: Support for PyTorch 2.0 has been dropped. If you're using PyTorch 2.0, please upgrade to PyTorch 2.1 or above. While `.pth` and `.pt` are the same in the PyTorch package...
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.
Actionable comments posted: 1
🧹 Outside diff range and nitpick comments (2)
doc/backend.md (1)
23-23
: LGTM! Consider adding migration notes.The version requirement update from PyTorch 2.0 to 2.1 is clearly documented. However, since this is a breaking change, consider adding migration notes to help users currently using PyTorch 2.0.
Add a note explaining:
- Why PyTorch 2.0 support was dropped
- Steps for users to upgrade their environment
- Any potential compatibility issues to watch out for
backend/find_pytorch.py (1)
136-137
: Consider enhancing the commit reference commentThe comment references a PyTorch commit but doesn't explain its significance. Consider adding a brief explanation of why this commit necessitates dropping PyTorch 2.0 support.
-# https://github.com/pytorch/pytorch/commit/7e0c26d4d80d6602aed95cb680dfc09c9ce533bc +# PyTorch 2.1+ required due to [brief explanation] +# See: https://github.com/pytorch/pytorch/commit/7e0c26d4d80d6602aed95cb680dfc09c9ce533bc
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (2)
backend/find_pytorch.py
(1 hunks)doc/backend.md
(1 hunks)
🔇 Additional comments (2)
backend/find_pytorch.py (2)
Line range hint 89-138
: Implementation looks good!
The get_pt_requirement
function:
- Handles CI builds with different CUDA versions appropriately
- Uses PEP 440 version matching correctly
- Has proper error handling and version parsing
137-137
: Verify the impact of dropping PyTorch 2.0 support
The change from torch>=2a
to torch>=2.1.0
is a breaking change that drops support for PyTorch 2.0. Let's verify the impact on the codebase.
✅ Verification successful
Let me analyze the PyTorch usage in the codebase further to understand version-specific dependencies.
PyTorch 2.1+ requirement is compatible with codebase
Based on the analysis of the codebase:
- The code primarily uses PyTorch 2.x features, with version checks like
if torch.__version__.startswith("2")
for importingtorch._dynamo
- No specific PyTorch 2.0-only APIs or features are used
- The codebase is already tested with PyTorch 2.2.0 as seen in third-party dependencies
- Version-specific code is properly guarded with version checks
The change to require PyTorch 2.1+ is safe and aligns with the codebase's existing PyTorch usage patterns.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Check for PyTorch version-specific code and imports that might need updates
# Search for PyTorch version checks or conditionals
echo "Searching for PyTorch version checks..."
rg -l "torch\.(version|__version__|cuda|backends)"
# Search for PyTorch imports and usage
echo "Searching for PyTorch imports and usage..."
ast-grep --pattern 'import torch'
ast-grep --pattern 'from torch import'
# Search for any PyTorch version specifications in requirements or setup files
echo "Searching for PyTorch version specifications in requirements..."
fd -e txt -e cfg -e ini -e toml -e yaml -e yml -g "*require*" | xargs rg "torch"
Length of output: 9942
Script:
#!/bin/bash
# Check for PyTorch version-specific features or APIs
echo "Checking PyTorch version-specific features..."
rg -A 5 "torch\.__version__"
# Check for any version-specific imports or features in PyTorch files
echo "Checking version-specific imports in PyTorch files..."
rg -A 3 "if torch\."
# Check setup files and requirements for any PyTorch version constraints
echo "Checking setup files for PyTorch version..."
fd "setup.py|pyproject.toml" | xargs rg "torch"
# Check for any PyTorch version-specific documentation
echo "Checking documentation for PyTorch version requirements..."
fd -e md -e rst | xargs rg "torch.*[0-9]+\.[0-9]+\.[0-9]+"
Length of output: 6090
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #4383 +/- ##
=======================================
Coverage 84.50% 84.50%
=======================================
Files 604 604
Lines 56944 56945 +1
Branches 3486 3487 +1
=======================================
+ Hits 48120 48121 +1
- Misses 7697 7698 +1
+ Partials 1127 1126 -1 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
Fix #4382. See pytorch/pytorch@7e0c26d.
Summary by CodeRabbit
New Features
Documentation