Skip to content

Support specifying a torch range #8936

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

Merged
merged 3 commits into from
Feb 26, 2025
Merged

Support specifying a torch range #8936

merged 3 commits into from
Feb 26, 2025

Conversation

oraluben
Copy link
Contributor

@oraluben oraluben commented Feb 25, 2025

Motivation: we're using a custom pytorch build and have patch release more recently than upstream. While those updates do not change any abi, we want to allow torchvision/torchaudio (pytorch/audio#3886) to tolerance the changed pytorch version when we update pytorch, otherwise pip will raise a warning.

In this PR, we add two new envionment variable to generate a version range for pytorch.

Copy link

pytorch-bot bot commented Feb 25, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/8936

Note: Links to docs will display an error until the docs builds have been completed.

❌ 4 New Failures, 8 Pending, 1 Unrelated Failure

As of commit 72b8fc4 with merge base d28001e (image):

NEW FAILURES - The following jobs have failed:

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@NicolasHug
Copy link
Member

Hi @oraluben , is it an option for you to just disable / ignore the pip warning?

I sympathize with the release challenges, I wouldn't be able to guarantee that the PYTORCH_VERSION_GE and PYTORCH_VERSION_LT survive future refacftorings

@oraluben
Copy link
Contributor Author

@NicolasHug Thanks for your reply!

For us we want to keep pip dependency resolving working (for example, torchvision==0.21 -> torch>=2.6,<2.7 -> torch==2.6.0.x where x is our minor version. If we want to live with pip warning, the only way to install torchvision with latest torch is to install torchvision (with torch 2.6) first, than install torch 2.6.0.x with a second pip install, which is not we want.

I wouldn't be able to guarantee that the PYTORCH_VERSION_GE and PYTORCH_VERSION_LT survive future refacftorings

Ofc it would be best to get this merged in upstream, I think our scenerio would also be a common use case for some other users/companies. Otherwise we might have to maintain a small patch locally...

Copy link
Member

@NicolasHug NicolasHug left a comment

Choose a reason for hiding this comment

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

Alright. I'll merge this because maintenance cost is hopefully minimal, but as I wrote in c8b2ccf, we won't necessarily be able to support this forever - this is only on a best-effort basis. Thanks for the PR @oraluben

@NicolasHug NicolasHug merged commit 7b2addf into pytorch:main Feb 26, 2025
58 of 63 checks passed
@oraluben oraluben deleted the patch-1 branch February 26, 2025 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants