Skip to content

Commit

Permalink
Add platform markers for linux only extra_install_requires (#88826)
Browse files Browse the repository at this point in the history
Fixes #88049

#85097 added new extra dependencies on `nvidia-*`. They are linux (GPU) only packages, but were not marked as such, causing issues installing pytorch 1.13 via Poetry (and possibly other tools that follow PyPI's metadata API) on non-Linux systems. This "fixes" the issue by adding the `; platform_system = 'Linux'` marker on these dependencies, but the main problem of different metadata for different wheels is a [somewhat larger issue](#88049 (comment)).

#85097 used `;` as a delimiter for splitting the different deps, but that is the delimiter used in markers, so I changed to split on `|`.

Pull Request resolved: #88826
Approved by: https://github.com/neersighted, https://github.com/lalmei, https://github.com/malfet
  • Loading branch information
JacobHayes authored and atalman committed Nov 30, 2022
1 parent 7c98e70 commit 3942981
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions .github/scripts/generate_binary_build_matrix.py
Expand Up @@ -219,9 +219,9 @@ def generate_wheels_matrix(os: str,
"container_image": WHEEL_CONTAINER_IMAGES[arch_version],
"package_type": package_type,
"pytorch_extra_install_requirements":
"nvidia-cuda-runtime-cu11;"
"nvidia-cudnn-cu11==8.5.0.96;"
"nvidia-cublas-cu11==11.10.3.66",
"nvidia-cuda-runtime-cu11; platform_system == 'Linux' | "
"nvidia-cudnn-cu11==8.5.0.96; platform_system == 'Linux' | "
"nvidia-cublas-cu11==11.10.3.66; platform_system == 'Linux'",
"build_name":
f"{package_type}-py{python_version}-{gpu_arch_type}{gpu_arch_version}-with-pypi-cudnn"
.replace(
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/generated-linux-binary-manywheel-nightly.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -848,7 +848,7 @@ def configure_extension_build():
pytorch_extra_install_requirements = os.getenv("PYTORCH_EXTRA_INSTALL_REQUIREMENTS", "")
if pytorch_extra_install_requirements:
report(f"pytorch_extra_install_requirements: {pytorch_extra_install_requirements}")
extra_install_requires += pytorch_extra_install_requirements.split(";")
extra_install_requires += pytorch_extra_install_requirements.split("|")


# Cross-compile for M1
Expand Down

0 comments on commit 3942981

Please sign in to comment.