Skip to content

Commit cb73790

Browse files
committed
Merge branch 'ci/bump-pt-2.6' of https://github.com/Lightning-AI/lightning into ci/bump-pt-2.6
2 parents 7530f57 + 6ac85c1 commit cb73790

File tree

290 files changed

+643
-519
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

290 files changed

+643
-519
lines changed

.github/CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ We welcome any useful contribution! For your convenience here's a recommended wo
182182
1. Use tags in PR name for the following cases:
183183

184184
- **\[blocked by #<number>\]** if your work is dependent on other PRs.
185-
- **\[wip\]** when you start to re-edit your work, mark it so no one will accidentally merge it in meantime.
185+
- **[wip]** when you start to re-edit your work, mark it so no one will accidentally merge it in meantime.
186186

187187
### Question & Answer
188188

.github/workflows/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Brief description of all our automation tools used for boosting development perf
1616
| .azure-pipelines/gpu-benchmarks.yml | Run speed/memory benchmarks for parity with vanila PyTorch. | GPU |
1717
| .github/workflows/ci-flagship-apps.yml | Run end-2-end tests with full applications, including deployment to the production cloud. | CPU |
1818
| .github/workflows/ci-tests-pytorch.yml | Run all tests except for accelerator-specific, standalone and slow tests. | CPU |
19-
| .github/workflows/tpu-tests.yml | Run only TPU-specific tests. Requires that the PR title contains '\[TPU\]' | TPU |
19+
| .github/workflows/tpu-tests.yml | Run only TPU-specific tests. Requires that the PR title contains '[TPU]' | TPU |
2020

2121
\* Each standalone test needs to be run in separate processes to avoid unwanted interactions between test cases.
2222

.github/workflows/docs-build.yml

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,21 @@ jobs:
174174
with:
175175
project_id: ${{ secrets.GCS_PROJECT }}
176176

177+
# Uploading docs as archive to GCS, so they can be as backup
178+
- name: Upload docs as archive to GCS 🪣
179+
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
180+
working-directory: docs/build
181+
run: |
182+
zip ${{ env.VERSION }}.zip -r html/
183+
gsutil cp ${{ env.VERSION }}.zip ${GCP_TARGET}
184+
185+
- name: Inject version selector
186+
working-directory: docs/build
187+
run: |
188+
pip install -q wget
189+
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/inject-selector-script.py
190+
python inject-selector-script.py html ${{ matrix.pkg-name }}
191+
177192
# Uploading docs to GCS, so they can be served on lightning.ai
178193
- name: Upload docs/${{ matrix.pkg-name }}/stable to GCS 🪣
179194
if: startsWith(github.ref, 'refs/heads/release/') && github.event_name == 'push'
@@ -188,11 +203,3 @@ jobs:
188203
- name: Upload docs/${{ matrix.pkg-name }}/release to GCS 🪣
189204
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
190205
run: gsutil -m rsync -d -R docs/build/html/ ${GCP_TARGET}/${{ env.VERSION }}
191-
192-
# Uploading docs as archive to GCS, so they can be as backup
193-
- name: Upload docs as archive to GCS 🪣
194-
if: startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch'
195-
working-directory: docs/build
196-
run: |
197-
zip ${{ env.VERSION }}.zip -r html/
198-
gsutil cp ${{ env.VERSION }}.zip ${GCP_TARGET}

.pre-commit-config.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ ci:
2323

2424
repos:
2525
- repo: https://github.com/pre-commit/pre-commit-hooks
26-
rev: v4.6.0
26+
rev: v5.0.0
2727
hooks:
2828
- id: end-of-file-fixer
2929
- id: trailing-whitespace
@@ -65,12 +65,12 @@ repos:
6565
args: ["--in-place"]
6666

6767
- repo: https://github.com/sphinx-contrib/sphinx-lint
68-
rev: v0.9.1
68+
rev: v1.0.0
6969
hooks:
7070
- id: sphinx-lint
7171

7272
- repo: https://github.com/astral-sh/ruff-pre-commit
73-
rev: v0.5.0
73+
rev: v0.8.6
7474
hooks:
7575
# try to fix what is possible
7676
- id: ruff
@@ -81,7 +81,7 @@ repos:
8181
- id: ruff
8282

8383
- repo: https://github.com/executablebooks/mdformat
84-
rev: 0.7.17
84+
rev: 0.7.21
8585
hooks:
8686
- id: mdformat
8787
additional_dependencies:

examples/fabric/build_your_own_trainer/run.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import lightning as L
21
import torch
32
from torchmetrics.functional.classification.accuracy import accuracy
43
from trainer import MyCustomTrainer
54

5+
import lightning as L
6+
67

78
class MNISTModule(L.LightningModule):
89
def __init__(self) -> None:

examples/fabric/build_your_own_trainer/trainer.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,16 @@
33
from functools import partial
44
from typing import Any, Literal, Optional, Union, cast
55

6-
import lightning as L
76
import torch
7+
from lightning_utilities import apply_to_collection
8+
from tqdm import tqdm
9+
10+
import lightning as L
811
from lightning.fabric.accelerators import Accelerator
912
from lightning.fabric.loggers import Logger
1013
from lightning.fabric.strategies import Strategy
1114
from lightning.fabric.wrappers import _unwrap_objects
1215
from lightning.pytorch.utilities.model_helpers import is_overridden
13-
from lightning_utilities import apply_to_collection
14-
from tqdm import tqdm
1516

1617

1718
class MyCustomTrainer:

examples/fabric/dcgan/train_fabric.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,10 @@
1616
import torch.utils.data
1717
import torchvision.transforms as transforms
1818
import torchvision.utils
19-
from lightning.fabric import Fabric, seed_everything
2019
from torchvision.datasets import CelebA
2120

21+
from lightning.fabric import Fabric, seed_everything
22+
2223
# Root directory for dataset
2324
dataroot = "data/"
2425
# Number of workers for dataloader

examples/fabric/fp8_distributed_transformer/train.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
import lightning as L
21
import torch
32
import torch.nn as nn
43
import torch.nn.functional as F
5-
from lightning.fabric.strategies import ModelParallelStrategy
6-
from lightning.pytorch.demos import Transformer, WikiText2
74
from torch.distributed._composable.fsdp.fully_shard import fully_shard
85
from torch.distributed.device_mesh import DeviceMesh
96
from torch.utils.data import DataLoader
107
from torchao.float8 import Float8LinearConfig, convert_to_float8_training
118
from tqdm import tqdm
129

10+
import lightning as L
11+
from lightning.fabric.strategies import ModelParallelStrategy
12+
from lightning.pytorch.demos import Transformer, WikiText2
13+
1314

1415
def configure_model(model: nn.Module, device_mesh: DeviceMesh) -> nn.Module:
1516
float8_config = Float8LinearConfig(

examples/fabric/image_classifier/train_fabric.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,12 @@
3636
import torch.nn.functional as F
3737
import torch.optim as optim
3838
import torchvision.transforms as T
39-
from lightning.fabric import Fabric, seed_everything
4039
from torch.optim.lr_scheduler import StepLR
4140
from torchmetrics.classification import Accuracy
4241
from torchvision.datasets import MNIST
4342

43+
from lightning.fabric import Fabric, seed_everything
44+
4445
DATASETS_PATH = path.join(path.dirname(__file__), "..", "..", "..", "Datasets")
4546

4647

examples/fabric/kfold_cv/train_fabric.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@
2020
import torch.nn.functional as F
2121
import torch.optim as optim
2222
import torchvision.transforms as T
23-
from lightning.fabric import Fabric, seed_everything
2423
from sklearn import model_selection
2524
from torch.utils.data import DataLoader, SubsetRandomSampler
2625
from torchmetrics.classification import Accuracy
2726
from torchvision.datasets import MNIST
2827

28+
from lightning.fabric import Fabric, seed_everything
29+
2930
DATASETS_PATH = path.join(path.dirname(__file__), "..", "..", "..", "Datasets")
3031

3132

0 commit comments

Comments
 (0)