Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade CI to PyTorch 1.13 #15403

Merged
merged 46 commits into from Nov 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
cff2e96
requirements
Borda Oct 28, 2022
2874b8f
bump CI
Borda Oct 28, 2022
970d922
cleaning
Borda Oct 28, 2022
9feaac9
group-check
Borda Oct 28, 2022
6cb882a
docker
Borda Oct 28, 2022
6b37f1f
if
Borda Oct 31, 2022
074eb0b
Merge branch 'master' into ci/pt-1.13
Borda Nov 1, 2022
d6dedae
Merge branch 'master' into ci/pt-1.13
Borda Nov 1, 2022
be1bfc7
Merge branch 'master' into ci/pt-1.13
Borda Nov 1, 2022
d83eab7
update
Borda Nov 1, 2022
21ca4ae
push
Borda Nov 1, 2022
3ee95a2
py3.9
Borda Nov 2, 2022
41c0249
py3.10
Borda Nov 2, 2022
dc23fbe
drop bagua
Borda Nov 3, 2022
4885f99
checks
Borda Nov 4, 2022
10567dc
Merge branch 'master' into ci/pt-1.13
Borda Nov 4, 2022
8bec290
dockers
Borda Nov 5, 2022
3296496
Merge branch 'master' into ci/pt-1.13
akihironitta Nov 7, 2022
6a3961f
Merge branch 'master' into ci/pt-1.13
Borda Nov 8, 2022
def2885
Merge branch 'master' into ci/pt-1.13
akihironitta Nov 9, 2022
54516f7
Update checkgroup
akihironitta Nov 9, 2022
d092536
Skip 3.10 as there's no distribution of bagua and colossalai
akihironitta Nov 9, 2022
e1ca8b2
Apply suggestions from code review
Borda Nov 9, 2022
152b27d
Merge branch 'master' into ci/pt-1.13
Borda Nov 9, 2022
129453a
group
awaelchli Nov 8, 2022
2e3af53
rev
Borda Nov 9, 2022
99c1136
Merge branch 'master' into ci/pt-1.13
Borda Nov 10, 2022
e6d3870
.10
Borda Nov 10, 2022
34c1675
fix version issue in test
awaelchli Nov 10, 2022
47052a2
70min
Borda Nov 10, 2022
66e0ec9
Merge branch 'master' into ci/pt-1.13
Borda Nov 10, 2022
02538f4
Apply suggestions from code review
Borda Nov 11, 2022
55eefcf
Merge branch 'master' into ci/pt-1.13
Borda Nov 11, 2022
bb0a52d
Merge branch 'master' into ci/pt-1.13
Borda Nov 11, 2022
6271c04
Merge branch 'master' into ci/pt-1.13
Borda Nov 11, 2022
37d0d62
Merge branch 'master' into ci/pt-1.13
carmocca Nov 11, 2022
b8638c7
Remove stale comments
carmocca Nov 11, 2022
8f3d2c2
Merge branch 'master' into ci/pt-1.13
Borda Nov 11, 2022
39a9a43
Merge branch 'master' into ci/pt-1.13
Borda Nov 12, 2022
ea56ffc
Merge branch 'master' into ci/pt-1.13
carmocca Nov 12, 2022
6a52596
Unused changes
carmocca Nov 12, 2022
60a2701
Fix Lite tests according to current checkgroup config
carmocca Nov 12, 2022
1ad9c2a
Match PL tests config (+SLOW) to Lite test config
carmocca Nov 12, 2022
98bc516
TODO
carmocca Nov 12, 2022
bb94f8a
Merge branch 'master' into ci/pt-1.13
carmocca Nov 12, 2022
89601fb
Try 3.8
carmocca Nov 12, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
akihironitta marked this conversation as resolved.
Show resolved Hide resolved
- {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