Skip to content
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

Fix broken pytorch version constraint #9

Merged
merged 3 commits into from
May 1, 2024

Conversation

yit-b
Copy link
Contributor

@yit-b yit-b commented Apr 30, 2024

When trying to install pytorch3d alongside a precise version of pytorch, the constraint on pytorch's build fails erroneously due to a missing leading asterisk in the run requirements/constraints. Builds that should be allowed are blocked.

Example repro using micromamba (also repros with bare conda, but it's so slow):

CONDA_OVERRIDE_CUDA is required since the meta.yaml places a requirement that the host has cuda installed, which is not necessary, but that's a different issue.

micromamba env create -n foobar
conda activate /home/$USER/micromamba/envs/foobar
CONDA_OVERRIDE_CUDA=12.1 \
    micromamba/bin/micromamba install \
    -c conda-forge \
    -c pytorch  \
    -c nvidia \
    -c pytorch3d \
    pytorch=2.2.0=py3.11_cuda12.1_cudnn8.9.2_0 \
    pytorch3d=0.7.6=cuda120py311*

Result:

error    libmamba Could not solve for environment specs
    The following packages are incompatible
    ├─ pytorch 2.2.0 py3.11_cuda12.1_cudnn8.9.2_0 is requested and can be installed;
    └─ pytorch3d 0.7.6 cuda120py311* is not installable because it requires
       └─ pytorch * cuda*, which conflicts with any installable versions previously reported.

There is a constraint that the build begins with the string literal cuda. However, in reality pytorch builds are prefixed with the python version, followed by the cuda version. So the constraint should be pytorch * *cuda*. This change is suggested in this PR.

@yit-b yit-b requested a review from Tobias-Fischer as a code owner April 30, 2024 17:35
@conda-forge-webservices
Copy link

Hi! This is the friendly automated conda-forge-linting service.

I just wanted to let you know that I linted all conda-recipes in your PR (recipe) and found it was in an excellent condition.

@Tobias-Fischer
Copy link
Contributor

Thank you @yit-b! Would you like to become a maintainer here?

@Tobias-Fischer
Copy link
Contributor

@conda-forge-admin please rerender

@Tobias-Fischer Tobias-Fischer merged commit 8d37361 into conda-forge:main May 1, 2024
27 checks passed
@@ -66,7 +66,7 @@ requirements:
- cudnn # [cuda_compiler_version != "None"]
- numpy
- pytorch
- pytorch =*={{ torch_proc_type }}*
- pytorch =*=*{{ torch_proc_type }}*
Copy link
Member

@weiji14 weiji14 May 6, 2024

Choose a reason for hiding this comment

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

@Tobias-Fischer, we might actually want to revert this change as it would allow users to install pytorch from the pytorch channel as mentioned at conda-forge/mmcv-recipe-feedstock#31 (comment). I think @yit-b was trying to pull in a newer version of Pytorch according to #10, and wanted to relax this constraint to allow installing from the pytorch channel, but we should actually be pushing for conda-forge to have a newer version of Pytorch 2.2 rather than allowing channel mixing.

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmm, good point, thanks for making me aware of this, I should have looked more carefully. Are you happy to open a PR?

Copy link
Member

Choose a reason for hiding this comment

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

Yep, opened at #11.

weiji14 added a commit to weiji14/pytorch3d-feedstock that referenced this pull request May 6, 2024
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.

3 participants