Skip to content

Commit 6e45d19

Browse files
committed
Merge branch 'master' into ci/upgrade-eager
2 parents 6388030 + 83436ee commit 6e45d19

File tree

23 files changed

+432
-400
lines changed

23 files changed

+432
-400
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# Run this script from the project root.
3+
URL="https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip"
4+
mkdir -p legacy
5+
# wget is simpler but does not work on Windows
6+
python -c "from urllib.request import urlretrieve; urlretrieve('$URL', 'legacy/checkpoints.zip')"
7+
ls -l legacy/
8+
unzip -o legacy/checkpoints.zip -d legacy/
9+
ls -l legacy/checkpoints/

.azure-pipelines/gpu-tests.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,7 @@ jobs:
6969
python requirements/check-avail-extras.py
7070
displayName: 'Env details'
7171
72-
- bash: |
73-
wget https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip -P legacy/
74-
unzip -o legacy/checkpoints.zip -d legacy/
75-
ls -l legacy/checkpoints/
72+
- bash: bash .actions/pull_legacy_checkpoints.sh
7673
displayName: 'Get legacy checkpoints'
7774

7875
- bash: |

.github/workflows/ci_test-conda.yml

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,8 @@ jobs:
5555
# sanity check
5656
python requirements/check-avail-extras.py
5757
58-
- name: Pull checkpoints from S3
59-
working-directory: ./legacy
60-
run: |
61-
# enter legacy and update checkpoints from S3
62-
curl https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip --output checkpoints.zip
63-
unzip -o checkpoints.zip
64-
ls -l checkpoints/
58+
- name: Pull legacy checkpoints
59+
run: bash .actions/pull_legacy_checkpoints.sh
6560

6661
- name: Tests
6762
run: |

.github/workflows/ci_test-full.yml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,8 @@ jobs:
7676
restore-keys: |
7777
${{ runner.os }}-pip-td${{ env.TIME_PERIOD }}-py${{ matrix.python-version }}-${{ matrix.release }}-${{ matrix.requires }}-
7878
79-
- name: Pull checkpoints from S3
80-
working-directory: ./legacy
81-
run: |
82-
# wget is simpler but does not work on Windows
83-
python -c "from urllib.request import urlretrieve ; urlretrieve('https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip', 'checkpoints.zip')"
84-
ls -l .
85-
unzip -o checkpoints.zip
86-
ls -l checkpoints/
79+
- name: Pull legacy checkpoints
80+
run: bash .actions/pull_legacy_checkpoints.sh
8781

8882
- name: Install dependencies
8983
run: |

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
9696

9797
- Raise an error if there are insufficient training batches when using a float value of `limit_train_batches` ([#12885](https://github.com/PyTorchLightning/pytorch-lightning/pull/12885))
9898

99-
100-
- Changed `pytorch_lightning.core.lightning` to `pytorch_lightning.core.module` ([#12740](https://github.com/PyTorchLightning/pytorch-lightning/pull/12740))
101-
10299
### Deprecated
103100

104101
- Deprecated `pytorch_lightning.loggers.base.LightningLoggerBase` in favor of `pytorch_lightning.loggers.logger.Logger`, and deprecated `pytorch_lightning.loggers.base` in favor of `pytorch_lightning.loggers.logger` ([#120148](https://github.com/PyTorchLightning/pytorch-lightning/pull/12014))
@@ -116,6 +113,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
116113
- Deprecated `pytorch_lightning.core.lightning.LightningModule` in favor of `pytorch_lightning.core.module.LightningModule` ([#12740](https://github.com/PyTorchLightning/pytorch-lightning/pull/12740))
117114

118115

116+
- Deprecated `pytorch_lightning.loops.base.Loop` in favor of `pytorch_lightning.loops.loop.Loop` ([#13043](https://github.com/PyTorchLightning/pytorch-lightning/pull/13043))
117+
118+
119119
- Deprecated `Trainer.reset_train_val_dataloaders()` in favor of `Trainer.reset_{train,val}_dataloader` ([#12184](https://github.com/PyTorchLightning/pytorch-lightning/pull/12184))
120120

121121
### Removed

dockers/nvidia/Dockerfile

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
ARG PYTORCH_VERSION=21.11
15+
ARG PYTORCH_VERSION=22.04
1616

1717
# https://docs.nvidia.com/deeplearning/frameworks/pytorch-release-notes
1818
FROM nvcr.io/nvidia/pytorch:${PYTORCH_VERSION}-py3
@@ -37,21 +37,20 @@ RUN \
3737
cd .. ; \
3838
fi && \
3939
# save the examples
40-
mv pytorch-lightning/_notebooks notebooks && \
40+
mv pytorch-lightning/_notebooks/.notebooks/ notebooks && \
4141
mv pytorch-lightning/pl_examples . && \
4242

4343
# Installations \
4444
pip install -q fire && \
45-
python ./pytorch-lightning/.actions/assistant.py requirements_prune_pkgs horovod --req_files ./pytorch-lightning/requirements/extra.txt && \
46-
pip install "Pillow>=8.2, !=8.3.0" "cryptography>=3.4" "py>=1.10" "protobuf>=3.15.6" --no-cache-dir -U --upgrade-strategy eager && \
47-
pip install -r ./pytorch-lightning/requirements/extra.txt --no-cache-dir -U --upgrade-strategy eager && \
45+
pip install "Pillow>=8.2, !=8.3.0" "cryptography>=3.4" "py>=1.10" --no-cache-dir -U --upgrade-strategy eager && \
46+
pip install ./pytorch-lightning["extra","loggers","strategies"] --no-cache-dir -U --upgrade-strategy eager && \
4847
pip install -r ./pytorch-lightning/requirements/examples.txt --no-cache-dir -U --upgrade-strategy eager && \
49-
pip install ./pytorch-lightning --no-cache-dir -U --upgrade-strategy eager && \
5048
rm -rf pytorch-lightning && \
51-
pip install jupyterlab[all] -U && \
5249
pip list
5350

54-
RUN pip install lightning-grid -U
51+
RUN pip install jupyterlab[all] -U && \
52+
pip install lightning-grid -U
53+
# pip install "py>=1.10" "protobuf>=3.15.6" --upgrade-strategy only-if-needed
5554

5655
ENV PYTHONPATH="/workspace"
5756

dockers/release/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ RUN \
3636
mv pytorch-lightning-*/ pytorch-lightning ; \
3737
rm *.zip ; \
3838
fi && \
39-
pip install ./pytorch-lightning["extra"] --no-cache-dir -U --upgrade-strategy eager && \
39+
pip install ./pytorch-lightning["extra","loggers","strategies"] --no-cache-dir -U --upgrade-strategy eager && \
4040
rm -rf pytorch-lightning
4141

4242
RUN python --version && \

dockers/tpu-tests/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,7 @@ LABEL maintainer="PyTorchLightning <https://github.com/PyTorchLightning>"
2222
COPY ./ ./pytorch-lightning/
2323

2424
# Pull the legacy checkpoints
25-
RUN cd pytorch-lightning && \
26-
wget https://pl-public-data.s3.amazonaws.com/legacy/checkpoints.zip -P legacy/ && \
27-
unzip -o legacy/checkpoints.zip -d legacy/ && \
28-
ls -l legacy/checkpoints/
25+
RUN cd pytorch-lightning && bash .actions/pull_legacy_checkpoints.sh
2926

3027
RUN \
3128
pip install -q fire && \

docs/source/common/trainer.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -850,6 +850,9 @@ Useful when debugging or testing something that happens at the end of an epoch.
850850
# run for only 10 batches
851851
trainer = Trainer(limit_val_batches=10)
852852

853+
# disable validation
854+
trainer = Trainer(limit_val_batches=0)
855+
853856
In the case of multiple validation dataloaders, the limit applies to each dataloader individually.
854857

855858
log_every_n_steps

docs/source/extensions/loops.rst

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ The core research logic is simply shifted to the :class:`~pytorch_lightning.core
8181
loss.backward()
8282
optimizer.step()
8383
84-
Under the hood, the above loop is implemented using the :class:`~pytorch_lightning.loops.base.Loop` API like so:
84+
Under the hood, the above loop is implemented using the :class:`~pytorch_lightning.loops.loop.Loop` API like so:
8585

8686
.. code-block:: python
8787
@@ -183,7 +183,7 @@ Now your code is FULLY flexible and you can still leverage ALL the best parts of
183183
Creating a New Loop From Scratch
184184
--------------------------------
185185

186-
You can also go wild and implement a full loop from scratch by sub-classing the :class:`~pytorch_lightning.loops.base.Loop` base class.
186+
You can also go wild and implement a full loop from scratch by sub-classing the :class:`~pytorch_lightning.loops.loop.Loop` base class.
187187
You will need to override a minimum of two things:
188188

189189
.. code-block:: python
@@ -222,7 +222,7 @@ Loop API
222222
--------
223223
Here is the full API of methods available in the Loop base class.
224224

225-
The :class:`~pytorch_lightning.loops.base.Loop` class is the base of all loops in the same way as the :class:`~pytorch_lightning.core.module.LightningModule` is the base of all models.
225+
The :class:`~pytorch_lightning.loops.loop.Loop` class is the base of all loops in the same way as the :class:`~pytorch_lightning.core.module.LightningModule` is the base of all models.
226226
It defines a public interface that each loop implementation must follow, the key ones are:
227227

228228
Properties
@@ -231,13 +231,13 @@ Properties
231231
done
232232
~~~~
233233

234-
.. autoattribute:: pytorch_lightning.loops.base.Loop.done
234+
.. autoattribute:: pytorch_lightning.loops.loop.Loop.done
235235
:noindex:
236236

237237
skip (optional)
238238
~~~~~~~~~~~~~~~
239239

240-
.. autoattribute:: pytorch_lightning.loops.base.Loop.skip
240+
.. autoattribute:: pytorch_lightning.loops.loop.Loop.skip
241241
:noindex:
242242

243243
Methods
@@ -246,19 +246,19 @@ Methods
246246
reset (optional)
247247
~~~~~~~~~~~~~~~~
248248

249-
.. automethod:: pytorch_lightning.loops.base.Loop.reset
249+
.. automethod:: pytorch_lightning.loops.loop.Loop.reset
250250
:noindex:
251251

252252
advance
253253
~~~~~~~
254254

255-
.. automethod:: pytorch_lightning.loops.base.Loop.advance
255+
.. automethod:: pytorch_lightning.loops.loop.Loop.advance
256256
:noindex:
257257

258258
run (optional)
259259
~~~~~~~~~~~~~~
260260

261-
.. automethod:: pytorch_lightning.loops.base.Loop.run
261+
.. automethod:: pytorch_lightning.loops.loop.Loop.run
262262
:noindex:
263263

264264

@@ -267,7 +267,7 @@ run (optional)
267267
Subloops
268268
--------
269269

270-
When you want to customize nested loops within loops, use the :meth:`~pytorch_lightning.loops.base.Loop.replace` method:
270+
When you want to customize nested loops within loops, use the :meth:`~pytorch_lightning.loops.loop.Loop.replace` method:
271271

272272
.. code-block:: python
273273
@@ -276,7 +276,7 @@ When you want to customize nested loops within loops, use the :meth:`~pytorch_li
276276
# Trainer runs the fit loop with your new epoch loop!
277277
trainer.fit(model)
278278
279-
Alternatively, for more fine-grained control, use the :meth:`~pytorch_lightning.loops.base.Loop.connect` method:
279+
Alternatively, for more fine-grained control, use the :meth:`~pytorch_lightning.loops.loop.Loop.connect` method:
280280

281281
.. code-block:: python
282282
@@ -326,7 +326,7 @@ Here is what the structure would look like in plain Python:
326326
...
327327
328328
329-
Each of these :code:`for`-loops represents a class implementing the :class:`~pytorch_lightning.loops.base.Loop` interface.
329+
Each of these :code:`for`-loops represents a class implementing the :class:`~pytorch_lightning.loops.loop.Loop` interface.
330330

331331

332332
.. list-table:: Trainer entry points and associated loops

0 commit comments

Comments
 (0)