Skip to content

packaging: Always strip +.* for torch dependency #1120

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

Conversation

seemethere
Copy link
Member

@seemethere seemethere commented Jan 13, 2021

Packages were getting unfairly pinned as needing the +cpu version of
pytorch when all versions of pytorch should be ABI compatible when
running cpu-only operations.

This eliminates any suffixed version we may have for torch and makes it
so that torchtext can be installed with any version of torch

Tested with the following script:

$ cat <<"EOF" | docker run --rm -i -v $(pwd):/v -w /v python:3.8 bash
#!/usr/bin/env bash

source packaging/pkg_helpers.bash

CU_VERSION=cpu

setup_cuda
setup_pip_pytorch_version
echo "PYTORCH_VERSION=${PYTORCH_VERSION}"
EOF
Looking in links: https://download.pytorch.org/whl/nightly/cpu/torch_nightly.html
Collecting torch
  Downloading https://download.pytorch.org/whl/nightly/cpu/torch-1.8.0.dev20210113%2Bcpu-cp38-cp38-linux_x86_64.whl (166.7 MB)
Collecting numpy
  Downloading numpy-1.20.0rc2-cp38-cp38-manylinux2010_x86_64.whl (15.3 MB)
Collecting typing-extensions
  Downloading typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Installing collected packages: typing-extensions, numpy, torch
Successfully installed numpy-1.20.0rc2 torch-1.8.0.dev20210113+cpu typing-extensions-3.7.4.3
PYTORCH_VERSION=1.8.0.dev20210113

Signed-off-by: Eli Uriegas [email protected]

Packages were getting unfairly pinned as needing the `+cpu` version of
pytorch when all versions of pytorch should be ABI compatible when
running cpu-only operations.

This eliminates any suffixed version we may have for torch and makes it
so that torchtext can be installed with any version of torch

Signed-off-by: Eli Uriegas <[email protected]>
Copy link
Contributor

@xuzhao9 xuzhao9 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the fix!

@seemethere seemethere merged commit fc6d715 into pytorch:master Jan 13, 2021
@seemethere seemethere deleted the remove_suffix_on_torch_dependency branch January 13, 2021 19:52
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.

4 participants