diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1c624654..b443142f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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__ @@ -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: @@ -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: @@ -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__ diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index eb94beff..8ed36d36 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -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: | diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index ac64044a..611913de 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 90bedada..2d1a126a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b537d9c..f20480a7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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). diff --git a/Dockerfile b/Dockerfile index 82434eed..d34eda03 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 diff --git a/README.md b/README.md index 3af9d667..be7497ac 100644 --- a/README.md +++ b/README.md @@ -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 for more information about installing PyTorch. diff --git a/conda-recipe.yaml b/conda-recipe.yaml index 374bae9d..0ebf0229 100644 --- a/conda-recipe.yaml +++ b/conda-recipe.yaml @@ -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 @@ -8,7 +23,6 @@ name: torchopt channels: - pytorch - defaults - - nvidia/label/cuda-11.6.2 - nvidia - conda-forge @@ -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 @@ -31,7 +44,7 @@ dependencies: - wandb # Device select - - nvidia::cudatoolkit = 11.6 + - pytorch::pytorch-cuda = 11.7 - cudnn # Build toolchain @@ -39,13 +52,13 @@ dependencies: - 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 diff --git a/docs/conda-recipe.yaml b/docs/conda-recipe.yaml index 476dc1a2..0ecce9b3 100644 --- a/docs/conda-recipe.yaml +++ b/docs/conda-recipe.yaml @@ -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 @@ -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 diff --git a/docs/requirements.txt b/docs/requirements.txt index 9060c0ec..9ac98898 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -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 diff --git a/docs/source/developer/contributing.rst b/docs/source/developer/contributing.rst index 13f7c30b..b4c4c825 100644 --- a/docs/source/developer/contributing.rst +++ b/docs/source/developer/contributing.rst @@ -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. diff --git a/examples/requirements.txt b/examples/requirements.txt index a36da3aa..76bed365 100644 --- a/examples/requirements.txt +++ b/examples/requirements.txt @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 5fb08617..97bf5ee7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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] @@ -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" }, @@ -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", @@ -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"] @@ -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" @@ -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 diff --git a/requirements.txt b/requirements.txt index a7aac2fa..72fbc9eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/tests/requirements.txt b/tests/requirements.txt index 4cebb171..56650cc8 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -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 diff --git a/tests/test_alias.py b/tests/test_alias.py index 1da08b35..50b42835 100644 --- a/tests/test_alias.py +++ b/tests/test_alias.py @@ -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, diff --git a/tests/test_clip.py b/tests/test_clip.py index 420cfdaa..f8d3b289 100644 --- a/tests/test_clip.py +++ b/tests/test_clip.py @@ -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, diff --git a/tests/test_optim.py b/tests/test_optim.py index f8fff9a3..fe1697c9 100644 --- a/tests/test_optim.py +++ b/tests/test_optim.py @@ -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, diff --git a/tutorials/requirements.txt b/tutorials/requirements.txt index 7531b8f8..026d23a5 100644 --- a/tutorials/requirements.txt +++ b/tutorials/requirements.txt @@ -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 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