Skip to content

Commit

Permalink
deps: bump PyTorch CUDA requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
XuehaiPan committed Oct 28, 2022
1 parent 8a3feb7 commit 55d282d
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 21 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

env:
CUDA_VERSION: "11.6"
TEST_TORCH_SPECS: "cpu cu113 cu116"
CUDA_VERSION: "11.7"
TEST_TORCH_SPECS: "cpu cu116"

jobs:
build-sdist:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
uses: Jimver/cuda-toolkit@v0.2.7
id: cuda-toolkit
with:
cuda: "11.6.2"
cuda: "11.7.1"
method: network
sub-packages: '["nvcc"]'
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
uses: Jimver/cuda-toolkit@v0.2.7
id: cuda-toolkit
with:
cuda: "11.6.2"
cuda: "11.7.1"
method: network
sub-packages: '["nvcc"]'
- run: |
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# $ docker build --target devel --tag torchopt-devel:latest .
#

ARG cuda_docker_tag="11.6.2-cudnn8-devel-ubuntu20.04"
ARG cuda_docker_tag="11.7.1-cudnn8-devel-ubuntu22.04"
FROM nvidia/cuda:"${cuda_docker_tag}" AS builder

ENV DEBIAN_FRONTEND=noninteractive
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,10 @@ Requirements
pip3 install torchopt
```

If the minimum version of PyTorch is not satisfied, `pip` will install/upgrade it for you. Please be careful about the `torch` build for CPU / CUDA support (e.g. `cpu`, `cu102`, `cu113`). You may need to specify the extra index URL for the `torch` package:
If the minimum version of PyTorch is not satisfied, `pip` will install/upgrade it for you. Please be careful about the `torch` build for CPU / CUDA support (e.g. `cpu`, `cu116`, `cu117`). You may need to specify the extra index URL for the `torch` package:

```bash
pip3 install torchopt --extra-index-url https://download.pytorch.org/whl/cu116
pip3 install torchopt --extra-index-url https://download.pytorch.org/whl/cu117
```

See <https://pytorch.org> for more information about installing PyTorch.
Expand Down
22 changes: 18 additions & 4 deletions conda-recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
# Copyright 2022 MetaOPT Team. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
#
# Create virtual environment with command:
#
# $ CONDA_OVERRIDE_CUDA=11.7 conda env create --file conda-recipe.yaml
Expand All @@ -8,7 +23,6 @@ name: torchopt
channels:
- pytorch
- defaults
- nvidia/label/cuda-11.6.2
- nvidia
- conda-forge

Expand All @@ -30,16 +44,16 @@ dependencies:
- wandb

# Device select
- nvidia::cudatoolkit = 11.6
- pytorch::pytorch-cuda = 11.7
- cudnn

# Build toolchain
- cmake >= 3.4
- make
- cxx-compiler
- gxx = 10
- nvidia/label/cuda-11.6.2::cuda-nvcc
- nvidia/label/cuda-11.6.2::cuda-cudart-dev
- nvidia::cuda-nvcc
- nvidia::cuda-cudart-dev
- patchelf >= 0.9
- pybind11

Expand Down
6 changes: 3 additions & 3 deletions docs/conda-recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ dependencies:

# Learning
- pytorch::pytorch >= 1.13 # sync with project.dependencies
- pytorch::pytorch-mutex = *=*cpu*
- pytorch::cpuonly
- pip:
- torchviz
- sphinxcontrib-katex # for documentation
Expand All @@ -43,8 +43,8 @@ dependencies:
- make
- cxx-compiler
- gxx = 10
- nvidia/label/cuda-11.6.2::cuda-nvcc
- nvidia/label/cuda-11.6.2::cuda-cudart-dev
- nvidia/label/cuda-11.7.1::cuda-nvcc
- nvidia/label/cuda-11.7.1::cuda-cudart-dev
- pybind11

# Misc
Expand Down
4 changes: 2 additions & 2 deletions docs/source/developer/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ To build compatible **manylinux2014** (:pep:`599`) wheels for distribution, you
pip3 install --upgrade cibuildwheel
export TEST_TORCH_SPECS="cpu cu113 cu116" # `torch` builds for testing
export CUDA_VERSION="11.6" # version of `nvcc` for compilation
export TEST_TORCH_SPECS="cpu cu116" # `torch` builds for testing
export CUDA_VERSION="11.7" # version of `nvcc` for compilation
python3 -m cibuildwheel --platform=linux --output-dir=wheelhouse --config-file=pyproject.toml
It will install the CUDA compiler with ``CUDA_VERSION`` in the build container. Then build wheel binaries for all supported CPython versions. The outputs will be placed in the ``wheelhouse`` directory.
Expand Down
2 changes: 1 addition & 1 deletion examples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cu116
--extra-index-url https://download.pytorch.org/whl/cu117
torch >= 1.13
torchvision

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ build-verbosity = 3
environment.USE_FP16 = "ON"
environment.CUDACXX = "/usr/local/cuda/bin/nvcc"
environment.TORCH_CUDA_ARCH_LIST = "Common"
environment.DEFAULT_CUDA_VERSION = "11.6"
environment.DEFAULT_TEST_TORCH_SPECS = "cpu cu113 cu116"
environment.DEFAULT_CUDA_VERSION = "11.7"
environment.DEFAULT_TEST_TORCH_SPECS = "cpu cu116"
environment-pass = ["CUDA_VERSION", "TEST_TORCH_SPECS"]
container-engine = "docker"

Expand Down
2 changes: 1 addition & 1 deletion tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cu116
--extra-index-url https://download.pytorch.org/whl/cu117
torch >= 1.13

--requirement ../requirements.txt
Expand Down
2 changes: 1 addition & 1 deletion tutorials/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
--extra-index-url https://download.pytorch.org/whl/cu116
--extra-index-url https://download.pytorch.org/whl/cu117
# Sync with project.dependencies
torch >= 1.13
torchvision
Expand Down

0 comments on commit 55d282d

Please # to comment.