Skip to content

Commit

Permalink
Upgrade CI to PyTorch 1.13 (#15403)
Browse files Browse the repository at this point in the history
Co-authored-by: Jirka Borovec <Borda@users.noreply.github.com>
Co-authored-by: Akihiro Nitta <nitta@akihironitta.com>
Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
Co-authored-by: Adrian Wälchli <aedu.waelchli@gmail.com>
  • Loading branch information
5 people committed Nov 12, 2022
1 parent f9d906c commit 57ac548
Show file tree
Hide file tree
Showing 11 changed files with 82 additions and 82 deletions.
54 changes: 26 additions & 28 deletions .github/checkgroup.yml
@@ -1,7 +1,4 @@
custom_service_name: "Lightning CI required checker"
# For security reasons, configuration is only loaded from the repository's default branch,
# changes made in pull requests from different branches or forks are ignored. This means that changes to this file
# will only be used after they are merged.
subprojects:

# SECTION: pytorch_lightning
Expand All @@ -18,26 +15,25 @@ subprojects:
- "setup.cfg" # includes pytest config
- ".actions/**"
checks:
# Note: updates here should be applied to the lightning_lite group
- "pl-cpu (macOS-11, pytorch, 3.8, 1.10)"
- "pl-cpu (macOS-11, pytorch, 3.9, 1.11)"
- "pl-cpu (macOS-11, pytorch, 3.10, 1.12)"
- "pl-cpu (macOS-11, pytorch, 3.10, 1.13, pre)"
- "pl-cpu (macOS-11, pytorch, 3.8, 1.11)"
- "pl-cpu (macOS-11, pytorch, 3.9, 1.12)"
- "pl-cpu (macOS-11, pytorch, 3.10, 1.13)"
- "pl-cpu (macOS-11, pytorch, 3.8, 1.10, oldest)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.8, 1.10)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.9, 1.11)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.10, 1.11)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.10, 1.12)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.9, 1.13, pre)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.10, 1.13)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.7, 1.10, oldest)"
- "pl-cpu (windows-2022, pytorch, 3.9, 1.11)"
- "pl-cpu (windows-2022, pytorch, 3.10, 1.11)"
- "pl-cpu (windows-2022, pytorch, 3.10, 1.12)"
- "pl-cpu (windows-2022, pytorch, 3.8, 1.13, pre)"
- "pl-cpu (macOS-11, lightning, 3.10, 1.12)"
- "pl-cpu (ubuntu-20.04, lightning, 3.10, 1.12)"
- "pl-cpu (windows-2022, lightning, 3.10, 1.12)"
- "pl-cpu (windows-2022, pytorch, 3.10, 1.13)"
- "pl-cpu (windows-2022, pytorch, 3.7, 1.10, oldest)"
- "pl-cpu (slow, macOS-11, pytorch, 3.7, 1.11)"
- "pl-cpu (slow, ubuntu-20.04, pytorch, 3.7, 1.11)"
- "pl-cpu (slow, windows-2022, pytorch, 3.7, 1.11)"
- "pl-cpu (macOS-11, lightning, 3.8, 1.13)"
- "pl-cpu (ubuntu-20.04, lightning, 3.8, 1.13)"
- "pl-cpu (windows-2022, lightning, 3.8, 1.13)"

- id: "pytorch_lightning: Azure GPU"
paths:
Expand Down Expand Up @@ -145,7 +141,7 @@ subprojects:
- "build-pl (3.9, 1.10, 11.3.1)"
- "build-pl (3.9, 1.11, 11.3.1)"
- "build-pl (3.9, 1.12, 11.6.1)"
# TODO: add 1.13
- "build-pl (3.9, 1.13, 11.6.1)"
- "build-xla (3.7, 1.12)"

# SECTION: lightning_lite
Expand All @@ -159,20 +155,22 @@ subprojects:
- ".github/workflows/ci-lite-tests.yml"
- ".actions/**"
checks:
- "lite-cpu (macOS-11, lite, 3.9, 1.11)"
- "lite-cpu (macOS-11, lite, 3.8, 1.10)"
- "lite-cpu (macOS-11, lite, 3.10, 1.12)"
- "lite-cpu (macOS-11, lite, 3.10, 1.13, pre)"
- "lite-cpu (ubuntu-20.04, lite, 3.8, 1.11)"
- "lite-cpu (macOS-11, lite, 3.8, 1.11)"
- "lite-cpu (macOS-11, lite, 3.9, 1.12)"
- "lite-cpu (macOS-11, lite, 3.10, 1.13)"
- "lite-cpu (macOS-11, lite, 3.7, 1.10, oldest)"
- "lite-cpu (ubuntu-20.04, lite, 3.8, 1.10)"
- "lite-cpu (ubuntu-20.04, lite, 3.9, 1.11)"
- "lite-cpu (ubuntu-20.04, lite, 3.10, 1.12)"
- "lite-cpu (ubuntu-20.04, lite, 3.9, 1.13, pre)"
- "lite-cpu (windows-2022, lite, 3.9, 1.10)"
- "lite-cpu (windows-2022, lite, 3.10, 1.11)"
- "lite-cpu (ubuntu-20.04, lite, 3.10, 1.13)"
- "lite-cpu (ubuntu-20.04, lite, 3.7, 1.10, oldest)"
- "lite-cpu (windows-2022, lite, 3.9, 1.11)"
- "lite-cpu (windows-2022, lite, 3.10, 1.12)"
- "lite-cpu (windows-2022, lite, 3.8, 1.13, pre)"
- "lite-cpu (macOS-11, lightning, 3.8, 1.12)"
- "lite-cpu (ubuntu-20.04, lightning, 3.8, 1.12)"
- "lite-cpu (windows-2022, lightning, 3.8, 1.12)"
- "lite-cpu (windows-2022, lite, 3.10, 1.13)"
- "lite-cpu (windows-2022, lite, 3.7, 1.10, oldest)"
- "lite-cpu (macOS-11, lightning, 3.8, 1.13)"
- "lite-cpu (ubuntu-20.04, lightning, 3.8, 1.13)"
- "lite-cpu (windows-2022, lightning, 3.8, 1.13)"

- id: "lightning_lite: Azure GPU"
paths:
Expand Down
30 changes: 15 additions & 15 deletions .github/workflows/ci-lite-tests.yml
Expand Up @@ -36,25 +36,25 @@ jobs:
include:
# assign python and pytorch version combinations to operating systems (arbitrarily)
# note: there's no distribution of torch==1.10 for Python>=3.10
- {os: "macOS-11", pkg-name: "lite", python-version: "3.9", pytorch-version: "1.11"}
- {os: "macOS-11", pkg-name: "lite", python-version: "3.8", pytorch-version: "1.10"}
- {os: "windows-2022", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.11"}
- {os: "windows-2022", pkg-name: "lite", python-version: "3.9", pytorch-version: "1.10"}
- {os: "ubuntu-20.04", pkg-name: "lite", python-version: "3.8", pytorch-version: "1.11"}
# only run PyTorch latest with Python latest
- {os: "macOS-11", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.12"}
- {os: "macOS-11", pkg-name: "lite", python-version: "3.8", pytorch-version: "1.11"}
- {os: "macOS-11", pkg-name: "lite", python-version: "3.9", pytorch-version: "1.12"}
- {os: "ubuntu-20.04", pkg-name: "lite", python-version: "3.8", pytorch-version: "1.10"}
- {os: "ubuntu-20.04", pkg-name: "lite", python-version: "3.9", pytorch-version: "1.11"}
- {os: "ubuntu-20.04", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.12"}
- {os: "windows-2022", pkg-name: "lite", python-version: "3.9", pytorch-version: "1.11"}
- {os: "windows-2022", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.12"}
# only run PyTorch latest with Python latest
- {os: "macOS-11", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.13"}
- {os: "ubuntu-20.04", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.13"}
- {os: "windows-2022", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.13"}
# "oldest" versions tests, only on minimum Python
# TODO: add back with 1.13
# release-candidate tests, mixed Python versions
- {os: "macOS-11", pkg-name: "lite", python-version: "3.10", pytorch-version: "1.13", release: "pre"}
- {os: "ubuntu-20.04", pkg-name: "lite", python-version: "3.9", pytorch-version: "1.13", release: "pre"}
- {os: "windows-2022", pkg-name: "lite", python-version: "3.8", pytorch-version: "1.13", release: "pre"}
- {os: "macOS-11", pkg-name: "lite", python-version: "3.7", pytorch-version: "1.10", requires: "oldest"}
- {os: "ubuntu-20.04", pkg-name: "lite", python-version: "3.7", pytorch-version: "1.10", requires: "oldest"}
- {os: "windows-2022", pkg-name: "lite", python-version: "3.7", pytorch-version: "1.10", requires: "oldest"}
# "lightning" installs the monolithic package
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.12"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.12"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.12"}
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.13"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.13"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.13"}

timeout-minutes: 15

Expand Down
32 changes: 15 additions & 17 deletions .github/workflows/ci-pytorch-tests.yml
Expand Up @@ -40,33 +40,31 @@ jobs:
include:
# assign python and pytorch version combinations to operating systems (arbitrarily)
# note: there's no distribution of torch==1.10 for Python>=3.10
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "1.11"}
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "1.10"}
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "1.11"}
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "1.12"}
- {os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "1.10"}
- {os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "1.11"}
- {os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.11"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "1.10"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "1.11"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.11"}
# only run PyTorch latest with Python latest
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.12"}
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.12"}
- {os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.12"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.12"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "1.11"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.12"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.12"}
# only run PyTorch latest with Python latest
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.13"}
- {os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.13"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.13"}
# "oldest" versions tests, only on minimum Python
# TODO: add back with 1.13
# release-candidate tests, mixed Python versions
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.10", pytorch-version: "1.13", release: "pre"}
- {os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.9", pytorch-version: "1.13", release: "pre"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "1.13", release: "pre"}
- {os: "macOS-11", pkg-name: "pytorch", python-version: "3.8", pytorch-version: "1.10", requires: "oldest"} # 3.7 hangs
- {os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.7", pytorch-version: "1.10", requires: "oldest"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.7", pytorch-version: "1.10", requires: "oldest"}
# run test under SLOW label
- {type: "slow", os: "macOS-11", pkg-name: "pytorch", python-version: "3.7", pytorch-version: "1.11"}
- {type: "slow", os: "ubuntu-20.04", pkg-name: "pytorch", python-version: "3.7", pytorch-version: "1.11"}
- {type: "slow", os: "windows-2022", pkg-name: "pytorch", python-version: "3.7", pytorch-version: "1.11"}
# "lightning" installs the monolithic package
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.13"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.13"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.13"}

timeout-minutes: 60
timeout-minutes: 70 # tests with macOS-11, py3.7 oldest takes much longer then expected

steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion requirements/lite/base.txt
Expand Up @@ -2,7 +2,7 @@
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment

numpy>=1.17.2, <1.23.1
torch>=1.10.*, <1.13.0
torch>=1.10.*, <=1.13.0
fsspec[http]>2021.06.0, <2022.6.0
packaging>=17.0, <=21.3
typing-extensions>=4.0.0, <=4.4.0
Expand Down
4 changes: 2 additions & 2 deletions requirements/pytorch/adjust-versions.py
Expand Up @@ -5,8 +5,8 @@

# IMPORTANT: this list needs to be sorted in reverse
VERSIONS = [
dict(torch="1.13.0", torchvision="0.14.0"), # RC
dict(torch="1.12.1", torchvision="0.13.1"), # stable
dict(torch="1.13.0", torchvision="0.14.0"), # stable
dict(torch="1.12.1", torchvision="0.13.1"),
dict(torch="1.12.0", torchvision="0.13.0"),
dict(torch="1.11.0", torchvision="0.12.0"),
dict(torch="1.10.2", torchvision="0.11.3"),
Expand Down
2 changes: 1 addition & 1 deletion requirements/pytorch/base.txt
Expand Up @@ -2,7 +2,7 @@
# in case you want to preserve/enforce restrictions on the latest compatible version, add "strict" as an in-line comment

numpy>=1.17.2, <1.23.1
torch>=1.10.*, <1.13.0
torch>=1.10.*, <=1.13.0
tqdm>=4.57.0, <4.65.0
PyYAML>=5.4, <=6.0
fsspec[http]>2021.06.0, <2022.8.0
Expand Down
11 changes: 6 additions & 5 deletions requirements/pytorch/check-avail-extras.py
@@ -1,5 +1,6 @@
import hydra # noqa: F401
import jsonargparse # noqa: F401
import matplotlib # noqa: F401
import omegaconf # noqa: F401
import rich # noqa: F401
if __name__ == "__main__":
import hydra # noqa: F401
import jsonargparse # noqa: F401
import matplotlib # noqa: F401
import omegaconf # noqa: F401
import rich # noqa: F401
13 changes: 7 additions & 6 deletions requirements/pytorch/check-avail-strategies.py
@@ -1,7 +1,8 @@
import bagua # noqa: F401
import deepspeed # noqa: F401
import fairscale # noqa: F401
import horovod.torch
if __name__ == "__main__":
import bagua # noqa: F401
import deepspeed # noqa: F401
import fairscale # noqa: F401
import horovod.torch

# returns an error code
assert horovod.torch.nccl_built()
# returns an error code
assert horovod.torch.nccl_built()
4 changes: 2 additions & 2 deletions src/lightning_app/cli/app-template/tests/requirements.txt
@@ -1,8 +1,8 @@
coverage
codecov>=2.1
pytest>=3.0.5
pytest>=5.0.0
pytest-cov
pytest-flake8
flake8
check-manifest
twine==1.13.0
twine==4.0.1
@@ -1,8 +1,8 @@
coverage
codecov>=2.1
pytest>=3.0.5
pytest>=5.0.0
pytest-cov
pytest-flake8
flake8
check-manifest
twine==1.13.0
twine==4.0.1
8 changes: 5 additions & 3 deletions tests/tests_lite/plugins/precision/test_native_amp.py
Expand Up @@ -41,19 +41,21 @@ def test_native_amp_precision_bf16_min_torch():


def test_native_amp_precision_forward_context():
"""Test to ensure that the context manager correctly is set to CPU + bfloat16."""
"""Test to ensure that the context manager correctly is set to bfloat16 on CPU and CUDA."""
precision = NativeMixedPrecision(precision=16, device="cuda")
assert precision.device == "cuda"
assert isinstance(precision.scaler, torch.cuda.amp.GradScaler)
assert torch.get_default_dtype() == torch.float32
with precision.forward_context():
assert torch.get_autocast_gpu_dtype() == torch.float16
# check with str due to a bug upstream: https://github.com/pytorch/pytorch/issues/65786
assert str(torch.get_autocast_gpu_dtype()) in ("torch.float16", "torch.half")

precision = NativeMixedPrecision(precision="bf16", device="cpu")
assert precision.device == "cpu"
assert precision.scaler is None
with precision.forward_context():
assert torch.get_autocast_cpu_dtype() == torch.bfloat16
# check with str due to a bug upstream: https://github.com/pytorch/pytorch/issues/65786
assert str(torch.get_autocast_cpu_dtype()) == str(torch.bfloat16)

context_manager = precision._autocast_context_manager()
assert isinstance(context_manager, torch.autocast)
Expand Down

0 comments on commit 57ac548

Please sign in to comment.