Skip to content

deps: bump PyTorch version to 1.13 #104

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 7 commits into from
Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 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 All @@ -55,7 +55,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7 - 3.10" # sync with requires-python in pyproject.toml
python-version: "3.7 - 3.11" # sync with requires-python in pyproject.toml
update-environment: true

- name: Set __release__
Expand Down Expand Up @@ -117,7 +117,7 @@ jobs:
run: python .github/workflows/set_cibw_build.py

- name: Build wheels
uses: pypa/cibuildwheel@v2.11.1
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
with:
Expand Down Expand Up @@ -167,7 +167,7 @@ jobs:
run: python .github/workflows/set_cibw_build.py

- name: Build wheels
uses: pypa/cibuildwheel@v2.11.1
uses: pypa/cibuildwheel@v2.11.2
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
with:
Expand Down Expand Up @@ -200,7 +200,7 @@ jobs:
uses: actions/setup-python@v4
if: startsWith(github.ref, 'refs/tags/')
with:
python-version: "3.7 - 3.10" # sync with requires-python in pyproject.toml
python-version: "3.7 - 3.11" # sync with requires-python in pyproject.toml
update-environment: true

- name: Set __release__
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
update-environment: true

- name: Setup CUDA Toolkit
uses: Jimver/cuda-toolkit@v0.2.7
uses: Jimver/cuda-toolkit@v0.2.8
id: cuda-toolkit
with:
cuda: "11.6.2"
cuda: "11.7.0"
method: network
sub-packages: '["nvcc"]'
- run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ jobs:
update-environment: true

- name: Setup CUDA Toolkit
uses: Jimver/cuda-toolkit@v0.2.7
uses: Jimver/cuda-toolkit@v0.2.8
id: cuda-toolkit
with:
cuda: "11.6.2"
cuda: "11.7.0"
method: network
sub-packages: '["nvcc"]'
- run: |
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ repos:
- id: isort
stages: [commit, push, manual]
- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.10.0
hooks:
- id: black-jupyter
stages: [commit, push, manual]
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Bump PyTorch version to 1.13.0 by [@XuehaiPan](https://github.com/XuehaiPan) in [#104](https://github.com/metaopt/torchopt/pull/104).
- Add zero-order gradient estimation by [@JieRen98](https://github.com/JieRen98) in [#93](https://github.com/metaopt/torchopt/pull/93).
- Add RPC-based distributed training support and add distributed MAML example by [@XuehaiPan](https://github.com/XuehaiPan) in [#83](https://github.com/metaopt/torchopt/pull/83).
- Add full type hints by [@XuehaiPan](https://github.com/XuehaiPan) in [#92](https://github.com/metaopt/torchopt/pull/92).
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
27 changes: 20 additions & 7 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 @@ -17,11 +31,10 @@ dependencies:
- pip

# Learning
- pytorch::pytorch >= 1.12 # sync with project.dependencies
- pytorch::pytorch >= 1.13 # sync with project.dependencies
- pytorch::torchvision
- pytorch::pytorch-mutex = *=*cuda*
- pip:
- functorch >= 0.2 # sync with project.dependencies
- torchviz
- sphinxcontrib-katex # for documentation
- jax # for tutorials
Expand All @@ -31,21 +44,21 @@ 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

# Misc
- typing-extensions
- typing-extensions >= 4.0.0
- numpy
- matplotlib-base
- seaborn
Expand Down
11 changes: 5 additions & 6 deletions docs/conda-recipe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,9 @@ dependencies:
- pip

# Learning
- pytorch::pytorch >= 1.12 # sync with project.dependencies
- pytorch::pytorch-mutex = *=*cpu*
- pytorch::pytorch >= 1.13 # sync with project.dependencies
- pytorch::cpuonly
- pip:
- functorch >= 0.2 # sync with project.dependencies
- torchviz
- sphinxcontrib-katex # for documentation
- tensorboard
Expand All @@ -44,12 +43,12 @@ 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
- typing-extensions
- typing-extensions >= 4.0.0
- numpy
- matplotlib-base
- seaborn
Expand Down
3 changes: 1 addition & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
--extra-index-url https://download.pytorch.org/whl/cpu
# Sync with project.dependencies
torch >= 1.12
functorch >= 0.2
torch >= 1.13

--requirement ../requirements.txt

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
5 changes: 2 additions & 3 deletions examples/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
--extra-index-url https://download.pytorch.org/whl/cu116
torch >= 1.12
--extra-index-url https://download.pytorch.org/whl/cu117
torch >= 1.13
torchvision
functorch >= 0.2

--requirement ../requirements.txt

Expand Down
16 changes: 8 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[build-system]
# Sync with project.dependencies
requires = ["setuptools", "torch >= 1.12", "numpy", "pybind11"]
requires = ["setuptools", "torch >= 1.13", "numpy", "pybind11"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -11,7 +11,7 @@ description = "A Jax-style optimizer for PyTorch."
readme = "README.md"
# Change this if wheels for `torch` is available
# Search "requires-python" and update all corresponding items
requires-python = ">= 3.7, < 3.11.0a0"
requires-python = ">= 3.7"
authors = [
{ name = "TorchOpt Contributors" },
{ name = "Jie Ren", email = "jieren9806@gmail.com" },
Expand All @@ -38,6 +38,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Operating System :: POSIX :: Linux",
"Environment :: GPU",
"Environment :: GPU :: NVIDIA CUDA",
Expand All @@ -48,12 +49,11 @@ classifiers = [
"Topic :: Scientific/Engineering :: Artificial Intelligence",
]
dependencies = [
"torch >= 1.12", # see also build-system.requires and project.requires-python
"functorch >= 0.2",
"torch >= 1.13", # see also build-system.requires and project.requires-python
"optree >= 0.3.0",
"numpy",
"graphviz",
"typing-extensions",
"typing-extensions >= 4.0.0",
]
dynamic = ["version"]

Expand Down 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 Expand Up @@ -168,7 +168,7 @@ safe = true
line-length = 100
skip-string-normalization = true
# Sync with requires-python
target-version = ["py37", "py38", "py39", "py310"]
target-version = ["py37", "py38", "py39", "py310", "py311"]

[tool.isort]
atomic = true
Expand Down
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Sync with project.dependencies
torch >= 1.12
functorch >= 0.2
torch >= 1.13
optree >= 0.3.0
numpy
graphviz
typing-extensions
typing-extensions >= 4.0.0
5 changes: 2 additions & 3 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
--extra-index-url https://download.pytorch.org/whl/cu116
torch >= 1.12
functorch >= 0.2
--extra-index-url https://download.pytorch.org/whl/cu117
torch >= 1.13

--requirement ../requirements.txt

Expand Down
2 changes: 1 addition & 1 deletion tests/test_alias.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
nesterov=[False, True],
inplace=[True, False],
weight_decay=[0.0, 1e-2],
maximize=[False], # TODO: test maximize after PyTorch 1.13
maximize=[False, True],
)
def test_sgd(
dtype: torch.dtype,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
dampening=[0.0, 0.5],
nesterov=[False, True],
weight_decay=[0.0, 1e-2],
maximize=[False], # TODO: test maximize after PyTorch 1.13
maximize=[False, True],
)
def test_sgd(
dtype: torch.dtype,
Expand Down
2 changes: 1 addition & 1 deletion tests/test_optim.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
dampening=[0.0, 0.5],
nesterov=[False, True],
weight_decay=[0.0, 1e-2],
maximize=[False], # TODO: test maximize after PyTorch 1.13
maximize=[False, True],
)
def test_SGD(
dtype: torch.dtype,
Expand Down
5 changes: 2 additions & 3 deletions tutorials/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
--extra-index-url https://download.pytorch.org/whl/cu116
--extra-index-url https://download.pytorch.org/whl/cu117
# Sync with project.dependencies
torch >= 1.12
torch >= 1.13
torchvision
functorch >= 0.2

--requirement ../requirements.txt

Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy