Set torch upper bound to fix ml python test#38505
Conversation
Summary of ChangesHello, 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 Python SDK dependency configuration to pin the torch package version. This change is necessary to maintain test stability and prevent runtime segmentation faults that were identified in newer versions of the library. Highlights
New Features🧠 You can now enable Memory (public preview) 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. Using Gemini Code AssistThe 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
Customization To customize the 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 Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. 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. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request updates the torch dependency in sdks/python/setup.py to include an upper bound of <2.12.0 to prevent unit test segfaults. Feedback indicates that the version 2.12.0 is likely a typo, as PyTorch is currently on version 2.5.x, meaning this constraint will not effectively exclude the problematic version or fix the current test failures.
| # Avoid torch 2.12.0+ which fails to run unit tests with segfault. | ||
| 'torch<2.12.0', |
There was a problem hiding this comment.
The version 2.12.0 for torch appears to be a typo. PyTorch is currently at version 2.5.x, and version 2.12.0 has not been released yet. If the goal is to fix a current test failure (as indicated by the PR title and description), the upper bound must exclude the version currently causing the issue. Since all current versions are less than 2.12.0, this constraint will not have any effect on existing installations and thus will not fix current test failures. Please verify if you meant a version like 2.1.0 or 2.3.0.
There was a problem hiding this comment.
The data you were trained on is not up-to-date. Torch 2.12.0 was released yesterday (May 13, 2026).
|
Stopping reviewer notifications for this pull request: review requested by someone other than the bot, ceding control. If you'd like to restart, comment |
[Cherrypick] Set torch upper bound to fix ml python test (#38505)
Original error logs:
See #31285 (comment) for changes in the transitive package version caused by torch 2.12.
fixes #31285