From 68b7fd14df5eb1d2558c52842b4206a14d2d20e9 Mon Sep 17 00:00:00 2001 From: Luca Wehrstedt Date: Mon, 21 Oct 2024 16:35:11 +0000 Subject: [PATCH] Build for PyTorch 2.5.0 This commit will be tagged as 0.0.28.post2, which will trigger CI jobs to build a new release which depends on the newly-released PyTorch 2.5.0. ghstack-source-id: 2d08aac54157145d0fed78ddf4589379ea9e0d99 Pull Request resolved: https://github.com/fairinternal/xformers/pull/1244 __original_commit__ = fairinternal/xformers@94d6d0e661f98adb328327c9c8c87ad14d0ec25d --- .github/workflows/conda.yml | 4 +- .github/workflows/gh-pages.yml | 2 +- .github/workflows/linters_reusable.yml | 2 +- .github/workflows/rocm_build.yml | 4 +- .github/workflows/wheels.yml | 8 +-- .github/workflows/win-build.yml | 4 +- .pyre_configuration | 2 +- CHANGELOG.md | 3 + README.md | 4 +- packaging/pkg_helpers.bash | 77 -------------------------- setup.py | 6 +- 11 files changed, 21 insertions(+), 95 deletions(-) delete mode 100644 packaging/pkg_helpers.bash diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 8011487519..425dae5cba 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -33,13 +33,13 @@ jobs: - "3.10" - "3.11" config: - - torch_version: "2.4.1" + - torch_version: "2.5.0" torch_channel: "pytorch" cuda_version: "12.1.0" cuda_dep_runtime: ">=12.0,<13.0" cuda_short_version: "121" - - torch_version: "2.4.1" + - torch_version: "2.5.0" torch_channel: "pytorch" cuda_version: "11.8.0" cuda_dep_runtime: ">=11.7,<11.9" diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml index 95401c2768..078367b4bd 100644 --- a/.github/workflows/gh-pages.yml +++ b/.github/workflows/gh-pages.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: '3.8' + python-version: '3.9' - name: Upgrade pip run: | diff --git a/.github/workflows/linters_reusable.yml b/.github/workflows/linters_reusable.yml index 16e8f8e685..f10dc15f54 100644 --- a/.github/workflows/linters_reusable.yml +++ b/.github/workflows/linters_reusable.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Python uses: actions/setup-python@v2 with: - python-version: '3.8' + python-version: '3.9' - name: Run pre-script if: ${{ inputs.pre-script }} run: ${{ inputs.pre-script }} diff --git a/.github/workflows/rocm_build.yml b/.github/workflows/rocm_build.yml index 56cf585677..3303f3569d 100644 --- a/.github/workflows/rocm_build.yml +++ b/.github/workflows/rocm_build.yml @@ -19,10 +19,10 @@ jobs: build: strategy: fail-fast: false - matrix: + matrix: os: ['ubuntu-alola'] python: ['3.11'] - torch_version: ['2.4.1'] + torch_version: ['2.5.0'] toolkit_type: ['rocm'] toolkit_short_version: ['6.0', '6.1'] diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index 989ac62b56..ad4ab62896 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -28,7 +28,7 @@ jobs: import itertools environ = os.environ - PY_VERSIONS = ['3.8', '3.9', '3.10', '3.11', '3.12'] + PY_VERSIONS = ['3.9', '3.10', '3.11', '3.12'] # NOTE: Don't forget to update `upload_pt`'s matrix # when changing the CUDA/ROCM versions below! CU_VERSIONS = ['118', '121', '124'] @@ -46,7 +46,7 @@ jobs: include = [] for os in ['8-core-ubuntu', 'windows-8-core']: - for torch_version in ['2.4.1']: + for torch_version in ['2.5.0']: # CUDA builds for python, cuda_short_version in PY_CU: if cuda_short_version != "124" and "windows" in os: @@ -96,7 +96,7 @@ jobs: uses: ./.github/workflows/wheels_upload_pip.yml with: twine_username: __token__ - filter: "*torch2.4.1+cu121*" + filter: "*torch2.5.0+cu121*" execute: ${{ github.repository == 'facebookresearch/xformers' && github.event_name != 'pull_request' }} secrets: twine_password: ${{ secrets.PYPI_TOKEN }} @@ -116,6 +116,6 @@ jobs: aws_role: "arn:aws:iam::749337293305:role/pytorch_bot_uploader_role" s3_path: s3://pytorch/whl/${{ matrix.suffix }}/ aws_s3_cp_extra_args: --acl public-read - filter: "*torch2.4.1+${{ matrix.suffix }}*" + filter: "*torch2.5.0+${{ matrix.suffix }}*" execute: ${{ github.repository == 'facebookresearch/xformers' && github.ref_type == 'tag' }} diff --git a/.github/workflows/win-build.yml b/.github/workflows/win-build.yml index 12716cfa22..2729ad5084 100644 --- a/.github/workflows/win-build.yml +++ b/.github/workflows/win-build.yml @@ -48,11 +48,11 @@ jobs: with: toolkit_type: "cuda" toolkit_short_version: "124" - python: "3.8" + python: "3.9" - name: Install build dependencies run: | - $PY -m pip install wheel setuptools ninja torch==2.4.1 -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu121 + $PY -m pip install wheel setuptools ninja torch==2.5.0 -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu121 git config --global --add safe.directory "*" $PY -c "import torch; print('torch', torch.__version__)" $PY -c "import torch; print('torch.cuda', torch.version.cuda)" diff --git a/.pyre_configuration b/.pyre_configuration index a8609b984b..e43188dfbd 100644 --- a/.pyre_configuration +++ b/.pyre_configuration @@ -1,6 +1,6 @@ { "ignore_all_errors": ["xformers/benchmarks/", "xformers/_flash_attn"], - "python_version": "3.7", + "python_version": "3.9", "source_directories": [ "stubs", {"import_root": ".", "source": "xformers"} diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ae122dec9..ef9c2755cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,9 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.0.28.post2] - 2024-10-18 +Pre-built binary wheels require PyTorch 2.5.0 + ## [0.0.28.post1] - 2024-09-13 Properly upload wheels for cuda 12.4 diff --git a/README.md b/README.md index ac55fd7604..1dcee56b22 100644 --- a/README.md +++ b/README.md @@ -28,14 +28,14 @@ xFormers is: ## Installing xFormers -* **(RECOMMENDED, linux) Install latest stable with conda**: Requires [PyTorch 2.4.1 installed with conda](https://pytorch.org/get-started/locally/) +* **(RECOMMENDED, linux) Install latest stable with conda**: Requires [PyTorch 2.5.0 installed with conda](https://pytorch.org/get-started/locally/) ```bash # (python 3.10/3.11 only) conda install xformers -c xformers ``` -* **(RECOMMENDED, linux & win) Install latest stable with pip**: Requires [PyTorch 2.4.1](https://pytorch.org/get-started/locally/) +* **(RECOMMENDED, linux & win) Install latest stable with pip**: Requires [PyTorch 2.5.0](https://pytorch.org/get-started/locally/) ```bash # [linux only] cuda 11.8 version diff --git a/packaging/pkg_helpers.bash b/packaging/pkg_helpers.bash deleted file mode 100644 index 01cec6f953..0000000000 --- a/packaging/pkg_helpers.bash +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/bash -e -# Copyright (c) Facebook, Inc. and its affiliates. -# Taken from https://github.com/facebookresearch/detectron2/blob/main/dev/packaging/pkg_helpers.bash - -# Function to retry functions that sometimes timeout or have flaky failures -retry () { - $* || (sleep 1 && $*) || (sleep 2 && $*) || (sleep 4 && $*) || (sleep 8 && $*) -} -# Install with pip a bit more robustly than the default -pip_install() { - retry pip install --progress-bar off "$@" -} - - -setup_cuda() { - # Now work out the CUDA settings - # Like other torch domain libraries, we choose common GPU architectures only. - # See https://github.com/pytorch/pytorch/blob/master/torch/utils/cpp_extension.py - # and https://github.com/pytorch/vision/blob/main/packaging/pkg_helpers.bash for reference. - export FORCE_CUDA=1 - case "$CU_VERSION" in - cu113) - export CUDA_HOME=/usr/local/cuda-11.3/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX;8.0;8.6+PTX" - ;; - cu112) - export CUDA_HOME=/usr/local/cuda-11.2/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX;8.0;8.6+PTX" - ;; - cu111) - export CUDA_HOME=/usr/local/cuda-11.1/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX;8.0;8.6+PTX" - ;; - cu110) - export CUDA_HOME=/usr/local/cuda-11.0/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX;8.0+PTX" - ;; - cu102) - export CUDA_HOME=/usr/local/cuda-10.2/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX" - ;; - cu101) - export CUDA_HOME=/usr/local/cuda-10.1/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX" - ;; - cu100) - export CUDA_HOME=/usr/local/cuda-10.0/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0;7.5+PTX" - ;; - cu92) - export CUDA_HOME=/usr/local/cuda-9.2/ - export TORCH_CUDA_ARCH_LIST="3.7;5.0;5.2;6.0;6.1+PTX;7.0+PTX" - ;; - cpu) - unset FORCE_CUDA - export CUDA_VISIBLE_DEVICES= - ;; - *) - echo "Unrecognized CU_VERSION=$CU_VERSION" - exit 1 - ;; - esac -} - -setup_wheel_python() { - case "$PYTHON_VERSION" in - 3.6) python_abi=cp36-cp36m ;; - 3.7) python_abi=cp37-cp37m ;; - 3.8) python_abi=cp38-cp38 ;; - 3.9) python_abi=cp39-cp39 ;; - *) - echo "Unrecognized PYTHON_VERSION=$PYTHON_VERSION" - exit 1 - ;; - esac - export PATH="/opt/python/$python_abi/bin:$PATH" -} diff --git a/setup.py b/setup.py index 4f0da97fb0..6eaa509043 100644 --- a/setup.py +++ b/setup.py @@ -695,7 +695,7 @@ def copy_extensions_to_source(self) -> None: "clean": clean, }, url="https://facebookresearch.github.io/xformers/", - python_requires=">=3.7", + python_requires=">=3.9", author="Facebook AI Research", author_email="oncall+xformers@xmail.facebook.com", long_description="XFormers: A collection of composable Transformer building blocks." @@ -703,10 +703,10 @@ def copy_extensions_to_source(self) -> None: + "defined as compatible and combined building blocks as opposed to monolithic models", long_description_content_type="text/markdown", classifiers=[ - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "License :: OSI Approved :: BSD License", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Operating System :: OS Independent",