Skip to content

Commit

Permalink
Introduce support for PyTorch 2.1 (facebookresearch#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
cbalioglu authored Nov 3, 2023
1 parent a658d73 commit 3917e3c
Show file tree
Hide file tree
Showing 9 changed files with 47 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_build_doc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
inputs:
torch:
type: string
default: '2.0.1'
default: '2.1.0'
py:
type: string
default: '3.11'
Expand Down
27 changes: 14 additions & 13 deletions .github/workflows/_build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ on:
required: true

jobs:
build_pt121_wheel-linux:
build_pt131_wheel-linux:
name: Build wheels (pt${{ matrix.torch }}, py${{ matrix.py }}, linux-x86_64, ${{ matrix.variant }}, ${{ matrix.sanitizers }})
uses: ./.github/workflows/_build_wheel-linux.yaml
strategy:
fail-fast: false
matrix:
torch: ['1.12.1']
torch: ['1.13.1']
py: ['3.8', '3.9', '3.10']
variant: ['cpu', 'cu116']
sanitizers: ['nosan']
Expand All @@ -32,45 +32,46 @@ jobs:
sanitizers: ${{ matrix.sanitizers }}
version_override: ${{ inputs.version_override }}

build_pt131_wheel-linux:
build_pt20_wheel-linux:
name: Build wheels (pt${{ matrix.torch }}, py${{ matrix.py }}, linux-x86_64, ${{ matrix.variant }}, ${{ matrix.sanitizers }})
uses: ./.github/workflows/_build_wheel-linux.yaml
strategy:
fail-fast: false
matrix:
torch: ['1.13.1']
py: ['3.8', '3.9', '3.10']
variant: ['cpu', 'cu116']
torch: ['2.0.1']
py: ['3.8', '3.9', '3.10', '3.11']
variant: ['cpu', 'cu117', 'cu118']
sanitizers: ['nosan']
with:
torch: ${{ matrix.torch }}
py: ${{ matrix.py }}
variant: ${{ matrix.variant }}
sanitizers: ${{ matrix.sanitizers }}
version_override: ${{ inputs.version_override }}
run_integration_tests: ${{ matrix.run_integration_tests }}

build_pt20_wheel-linux:
build_pt21_wheel-linux:
name: Build wheels (pt${{ matrix.torch }}, py${{ matrix.py }}, linux-x86_64, ${{ matrix.variant }}, ${{ matrix.sanitizers }})
uses: ./.github/workflows/_build_wheel-linux.yaml
strategy:
fail-fast: false
matrix:
torch: ['2.0.1']
torch: ['2.1.0']
py: ['3.8', '3.9', '3.10', '3.11']
variant: ['cpu', 'cu117', 'cu118']
variant: ['cpu', 'cu118', 'cu121']
sanitizers: ['nosan']
include:
- run_integration_tests: false

# Integration Tests
- torch: '2.0.1'
- torch: '2.1.0'
py: '3.11'
variant: 'cpu'
sanitizers: 'nosan'
run_integration_tests: true

# ASAN/UBSAN
- torch: '2.0.1'
- torch: '2.1.0'
py: '3.11'
variant: 'cpu'
sanitizers: 'asan_ubsan'
Expand All @@ -90,9 +91,9 @@ jobs:
strategy:
fail-fast: false
matrix:
torch: ['2.0.1']
torch: ['2.1.0']
py: ['3.8', '3.9', '3.10', '3.11']
variant: ['cu117']
variant: ['cu118']
with:
torch: ${{ matrix.torch }}
py: ${{ matrix.py }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_lint_cc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
inputs:
torch:
type: string
default: '2.0.1'
default: '2.1.0'
py:
type: string
default: '3.11'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/_lint_py.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
inputs:
torch:
type: string
default: '2.0.1'
default: '2.1.0'
py:
type: string
default: '3.11'
Expand Down
22 changes: 11 additions & 11 deletions .github/workflows/_publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ on:
required: true

jobs:
publish_pt112_s3-linux:
publish_pt113_s3-linux:
name: Publish to S3 (pt${{ matrix.torch }}, py${{ matrix.py }}, linux-x86_64, ${{ matrix.variant }})
strategy:
matrix:
torch: ['1.12.1']
torch: ['1.13.1']
py: ['3.8', '3.9', '3.10']
variant: ['cpu', 'cu116']
max-parallel: 1
Expand All @@ -28,13 +28,13 @@ jobs:
variant: ${{ matrix.variant }}
release_type: ${{ inputs.release_type }}

publish_pt113_s3-linux:
publish_pt20_s3-linux:
name: Publish to S3 (pt${{ matrix.torch }}, py${{ matrix.py }}, linux-x86_64, ${{ matrix.variant }})
strategy:
matrix:
torch: ['1.13.1']
py: ['3.8', '3.9', '3.10']
variant: ['cpu', 'cu116']
torch: ['2.0.1']
py: ['3.8', '3.9', '3.10', '3.11']
variant: ['cpu', 'cu117', 'cu118']
max-parallel: 1
uses: ./.github/workflows/_publish_s3.yaml
with:
Expand All @@ -44,13 +44,13 @@ jobs:
variant: ${{ matrix.variant }}
release_type: ${{ inputs.release_type }}

publish_pt20_s3-linux:
publish_pt21_s3-linux:
name: Publish to S3 (pt${{ matrix.torch }}, py${{ matrix.py }}, linux-x86_64, ${{ matrix.variant }})
strategy:
matrix:
torch: ['2.0.1']
torch: ['2.1.0']
py: ['3.8', '3.9', '3.10', '3.11']
variant: ['cpu', 'cu117', 'cu118']
variant: ['cpu', 'cu118', 'cu121']
max-parallel: 1
uses: ./.github/workflows/_publish_s3.yaml
with:
Expand All @@ -70,9 +70,9 @@ jobs:
uses: ./.github/workflows/_publish_pypi.yaml
strategy:
matrix:
torch: ['2.0.1']
torch: ['2.1.0']
py: ['3.8', '3.9', '3.10', '3.11']
variant: ['cu117']
variant: ['cu118']
max-parallel: 1
with:
os: 'linux'
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/ci_build_wheels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,29 +20,29 @@ jobs:
strategy:
fail-fast: false
matrix:
torch: ['2.0.1']
torch: ['2.1.0']
py: ['3.11']
variant: ['cpu', 'cu117', 'cu118']
variant: ['cpu', 'cu118', 'cu121']
sanitizers: ['nosan']
include:
- run_integration_tests: false

# Integration Tests
- torch: '2.0.1'
- torch: '2.1.0'
py: '3.11'
variant: 'cpu'
sanitizers: 'nosan'
run_integration_tests: true

# ASAN/UBSAN
- torch: '2.0.1'
- torch: '2.1.0'
py: '3.11'
variant: 'cpu'
sanitizers: 'asan_ubsan'
run_integration_tests: false

# Lowest Supported Version
- torch: '1.12.1'
- torch: '1.13.1'
py: '3.8'
variant: 'cpu'
sanitizers: 'nosan'
Expand All @@ -61,11 +61,11 @@ jobs:
fail-fast: false
matrix:
include:
- torch: '2.0.1'
- torch: '2.1.0'
py: '3.11'

# Lowest Supported Version
- torch: '1.12.1'
- torch: '1.13.1'
py: '3.8'
with:
torch: ${{ matrix.torch }}
Expand Down
7 changes: 4 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ fairseq2n is not available as a pre-built package for your system, please follow
the installation instructions [here](INSTALL_FROM_SOURCE.md).

For an editable installation, first, install a nightly build of fairseq2n (shown
for PyTorch `2.0.1` and variant `cu118`):
for PyTorch `2.1.0` and variant `cu118`):

```sh
pip install fairseq2n\
--pre --upgrade --extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/nightly/pt2.0.1/cu118
--pre --upgrade --extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/nightly/pt2.1.0/cu118
```

> [!WARNING]
Expand Down Expand Up @@ -55,7 +55,8 @@ pip install -r requirements-devel.txt
> the fairseq2n installation command above to get the most up-to-date binary. If
> you observe runtime or test failures after the installation, it might be
> because the latest nightlies are not published yet. If the problem persists
> after about 12 hours, please create a GitHub issue.
> after about 12 hours, please create a
> [GitHub issue](https://github.com/facebookresearch/fairseq2/issues/new/choose).
## Testing Your Work

Expand Down
4 changes: 2 additions & 2 deletions INSTALL_FROM_SOURCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ brew install libsndfile

### 3.2 PyTorch
Follow the instructions on [pytorch.org](https://pytorch.org) to install the
desired PyTorch version.
greater.
desired PyTorch version. Make sure that the version you install is
[supported](.#variants) by fairseq2.

### 3.3 CUDA
If you plan to build fairseq2 in a CUDA environment, you first have to install
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,19 +83,19 @@ matrix shows the supported combinations.

| PyTorch | Python | Variant* | Arch |
| ---------------- | ----------------- | ---------------------- | -------- |
| `1.12.1` | `>=3.8`, `<=3.10` | `cpu`, `cu116` | `x86_64` |
| `1.13.1` | `>=3.8`, `<=3.10` | `cpu`, `cu116` | `x86_64` |
| `2.1.0` | `>=3.8`, `<=3.11` | `cpu`, `cu118` `cu121` | `x86_64` |
| `2.0.0`, `2.0.1` | `>=3.8`, `<=3.11` | `cpu`, `cu117` `cu118` | `x86_64` |
| `1.13.1` | `>=3.8`, `<=3.10` | `cpu`, `cu116` | `x86_64` |

*\* cuXYZ refers to CUDA XY.Z (e.g. cu118 means CUDA 11.8)*

To install a specific combination, first follow the installation instructions on
[pytorch.org](https://pytorch.org) for the desired PyTorch version, and then use
the following command (shown for PyTorch `2.0.1` and variant `cu118`):
the following command (shown for PyTorch `2.1.0` and variant `cu118`):

```sh
pip install fairseq2\
--extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/pt2.0.1/cu118
--extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/pt2.1.0/cu118
```


Expand All @@ -111,12 +111,12 @@ pip install fairseq2\
For Linux, we also host nightly builds on FAIR's package repository. The
supported variants are identical to the ones listed in *Variants* above. Once
you have installed the desired PyTorch version, you can use the following
command to install the corresponding nightly package (shown for PyTorch `2.0.1`
command to install the corresponding nightly package (shown for PyTorch `2.1.0`
and variant `cu118`):

```sh
pip install fairseq2\
--pre --extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/nightly/pt2.0.1/cu118
--pre --extra-index-url https://fair.pkg.atmeta.com/fairseq2/whl/nightly/pt2.1.0/cu118
```


Expand Down

0 comments on commit 3917e3c

Please sign in to comment.