Skip to content

Commit

Permalink
Build binaries for PyTorch 2.4.1
Browse files Browse the repository at this point in the history
ghstack-source-id: 872cd3e587c1fd3a23e14a8682ba17f0274a0e6e
Pull Request resolved: fairinternal/xformers#1220

__original_commit__ = fairinternal/xformers@79d0b02
  • Loading branch information
danthe3rd authored and xFormers Bot committed Sep 12, 2024
1 parent 5d7aeb9 commit c909f0d
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/actions/setup-build-cuda/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ runs:
import sys
print(sys.version)
cushort = "${{ inputs.toolkit_short_version }}"
TORCH_CUDA_DEFAULT = "121" # pytorch 2.4.0
TORCH_CUDA_DEFAULT = "121" # pytorch 2.4.1
# https://github.com/Jimver/cuda-toolkit/blob/master/src/links/linux-links.ts
full_version, install_script = {
"124": ("12.4.1", "https://developer.download.nvidia.com/compute/cuda/12.4.1/local_installers/cuda_12.4.1_550.54.15_linux.run"),
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ jobs:
fail-fast: false
matrix:
python:
- "3.9"
- "3.10"
- "3.11"
config:
- torch_version: "2.4.0"
- torch_version: "2.4.1"
torch_channel: "pytorch"
cuda_version: "12.1.0"
cuda_dep_runtime: ">=12.0,<13.0"
cuda_short_version: "121"

- torch_version: "2.4.0"
- torch_version: "2.4.1"
torch_channel: "pytorch"
cuda_version: "11.8.0"
cuda_dep_runtime: ">=11.7,<11.9"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/rocm_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
matrix:
os: ['ubuntu-alola']
python: ['3.11']
torch_version: ['2.4.0']
torch_version: ['2.4.1']
toolkit_type: ['rocm']
toolkit_short_version: ['6.0', '6.1']

Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
include = []
for os in ['8-core-ubuntu', 'windows-8-core']:
for torch_version in ['2.4.0']:
for torch_version in ['2.4.1']:
# CUDA builds
for python, cuda_short_version in PY_CU:
if cuda_short_version != "124" and "windows" in os:
Expand Down Expand Up @@ -94,7 +94,7 @@ jobs:
uses: ./.github/workflows/wheels_upload_pip.yml
with:
twine_username: __token__
filter: "*torch2.4.0+cu121*"
filter: "*torch2.4.1+cu121*"
execute: ${{ github.repository == 'facebookresearch/xformers' && github.event_name != 'pull_request' }}
secrets:
twine_password: ${{ secrets.PYPI_TOKEN }}
Expand All @@ -106,7 +106,7 @@ jobs:
aws_role: "arn:aws:iam::749337293305:role/pytorch_bot_uploader_role"
s3_path: s3://pytorch/whl/cu118/
aws_s3_cp_extra_args: --acl public-read
filter: "*torch2.4.0+cu118*"
filter: "*torch2.4.1+cu118*"
execute: ${{ github.repository == 'facebookresearch/xformers' && github.ref_type == 'tag' }}

upload_pt_cu121:
Expand All @@ -116,7 +116,7 @@ jobs:
aws_role: "arn:aws:iam::749337293305:role/pytorch_bot_uploader_role"
s3_path: s3://pytorch/whl/cu121/
aws_s3_cp_extra_args: --acl public-read
filter: "*torch2.4.0+cu121*"
filter: "*torch2.4.1+cu121*"
execute: ${{ github.repository == 'facebookresearch/xformers' && github.ref_type == 'tag' }}

# upload_pt_rocm6_0:
Expand All @@ -126,7 +126,7 @@ jobs:
# aws_role: "arn:aws:iam::749337293305:role/pytorch_bot_uploader_role"
# s3_path: s3://pytorch/whl/rocm6.0/
# aws_s3_cp_extra_args: --acl public-read
# filter: "*torch2.4.0+rocm6.0*"
# filter: "*torch2.4.1+rocm6.0*"
# execute: ${{ github.repository == 'facebookresearch/xformers' && github.ref_type == 'tag' }}

upload_pt_rocm6_1:
Expand All @@ -136,6 +136,6 @@ jobs:
aws_role: "arn:aws:iam::749337293305:role/pytorch_bot_uploader_role"
s3_path: s3://pytorch/whl/rocm6.1/
aws_s3_cp_extra_args: --acl public-read
filter: "*torch2.4.0+rocm6.1*"
filter: "*torch2.4.1+rocm6.1*"
execute: ${{ github.repository == 'facebookresearch/xformers' && github.ref_type == 'tag' }}

2 changes: 1 addition & 1 deletion .github/workflows/win-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Install build dependencies
run: |
$PY -m pip install wheel setuptools ninja torch==2.4.0 -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu121
$PY -m pip install wheel setuptools ninja torch==2.4.1 -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)"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,11 @@ 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] - TBD
Pre-built binary wheels require PyTorch 2.4.1
### Added
- Added wheels for cuda 12.4
- Added conda builds for python 3.11
- Added wheels for rocm 6.1
### Improved
- Profiler: Fix computation of FLOPS for the attention when using xFormers
- Profiler: Fix MFU/HFU calculation when multiple dtypes are used
Expand All @@ -18,6 +21,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- fMHA: Removed `decoder` and `small_k` backends
- profiler: Removed `DetectSlowOpsProfiler` profiler
- Removed compatibility with PyTorch < 2.4
- Removed conda builds for python 3.11
- Removed windows pip wheels for cuda 12.1 and 11.8

## [0.0.27.post2] - 2024-07-26
Pre-built binary wheels require PyTorch 2.4.0
Expand Down
13 changes: 9 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,24 @@ xFormers is:

## Installing xFormers

* **(RECOMMENDED, linux) Install latest stable with conda**: Requires [PyTorch 2.4.0 installed with conda](https://pytorch.org/get-started/locally/)
* **(RECOMMENDED, linux) Install latest stable with conda**: Requires [PyTorch 2.4.1 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.0](https://pytorch.org/get-started/locally/)
* **(RECOMMENDED, linux & win) Install latest stable with pip**: Requires [PyTorch 2.4.1](https://pytorch.org/get-started/locally/)

```bash
# cuda 11.8 version
# [linux only] cuda 11.8 version
pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu118
# cuda 12.1 version
# [linux only] cuda 12.1 version
pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu121
# [linux & win] cuda 12.4 version
pip3 install -U xformers --index-url https://download.pytorch.org/whl/cu124
# [linux only] (EXPERIMENTAL) rocm 6.1 version
pip3 install -U xformers --index-url https://download.pytorch.org/whl/rocm6.1
```

* **Development binaries**:
Expand Down

0 comments on commit c909f0d

Please sign in to comment.