Skip to content

Commit 3c84f84

Browse files
authored
Merge branch 'master' into feature/comet-logger-update
2 parents dc048b1 + 110d621 commit 3c84f84

File tree

36 files changed

+578
-37
lines changed

36 files changed

+578
-37
lines changed

.actions/assistant.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,21 @@ def convert_version2nightly(ver_file: str = "src/version.info") -> None:
483483

484484

485485
if __name__ == "__main__":
486+
import sys
487+
486488
import jsonargparse
489+
from jsonargparse import ArgumentParser
490+
491+
def patch_jsonargparse_python_3_12_8():
492+
if sys.version_info < (3, 12, 8):
493+
return
494+
495+
def _parse_known_args_patch(self: ArgumentParser, args: Any = None, namespace: Any = None) -> tuple[Any, Any]:
496+
namespace, args = super(ArgumentParser, self)._parse_known_args(args, namespace, intermixed=False) # type: ignore
497+
return namespace, args
498+
499+
setattr(ArgumentParser, "_parse_known_args", _parse_known_args_patch)
500+
501+
patch_jsonargparse_python_3_12_8() # Required until fix https://github.com/omni-us/jsonargparse/issues/641
487502

488503
jsonargparse.CLI(AssistantCLI, as_positional=False)

.azure/gpu-benchmarks.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ jobs:
7575
pip list
7676
displayName: "Image info & NVIDIA"
7777
78-
- bash: pip install -e .[dev] --find-links ${TORCH_URL}
78+
- bash: |
79+
pip install -e .[dev] --find-links ${TORCH_URL}
80+
pip install setuptools==75.6.0
7981
env:
8082
FREEZE_REQUIREMENTS: "1"
8183
displayName: "Install package"

.azure/gpu-tests-fabric.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,7 @@ jobs:
107107
- bash: |
108108
extra=$(python -c "print({'lightning': 'fabric-'}.get('$(PACKAGE_NAME)', ''))")
109109
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
110+
pip install setuptools==75.6.0
110111
displayName: "Install package & dependencies"
111112
112113
- bash: |

.azure/gpu-tests-pytorch.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ jobs:
111111
- bash: |
112112
extra=$(python -c "print({'lightning': 'pytorch-'}.get('$(PACKAGE_NAME)', ''))")
113113
pip install -e ".[${extra}dev]" pytest-timeout -U --find-links="${TORCH_URL}" --find-links="${TORCHVISION_URL}"
114+
pip install setuptools==75.6.0
114115
displayName: "Install package & dependencies"
115116
116117
- bash: pip uninstall -y lightning

_notebooks

dockers/base-cuda/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ RUN \
5959
add-apt-repository ppa:deadsnakes/ppa && \
6060
apt-get install -y \
6161
python${PYTHON_VERSION} \
62-
python${PYTHON_VERSION}-distutils \
6362
python${PYTHON_VERSION}-dev \
6463
&& \
6564
update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \
@@ -79,6 +78,8 @@ RUN \
7978
curl https://bootstrap.pypa.io/get-pip.py | python${PYTHON_VERSION} && \
8079
# Disable cache \
8180
pip config set global.cache-dir false && \
81+
# Install recent setuptools to obtain pkg_resources \
82+
pip install setuptools==75.6.0 && \
8283
# set particular PyTorch version \
8384
pip install -q wget packaging && \
8485
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py && \

dockers/docs/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ RUN \
4444
dvipng \
4545
texlive-pictures \
4646
python3 \
47-
python3-distutils \
47+
python3-setuptools \
4848
python3-dev \
4949
&& \
5050
update-alternatives --install /usr/bin/python python /usr/bin/python3 1 && \

dockers/release/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ RUN \
3939
fi && \
4040
# otherwise there is collision with folder name and pkg name on Pypi
4141
cd pytorch-lightning && \
42-
pip install setuptools && \
42+
pip install setuptools==75.6.0 && \
4343
PACKAGE_NAME=lightning pip install '.[extra,loggers,strategies]' --no-cache-dir && \
4444
PACKAGE_NAME=pytorch pip install '.[extra,loggers,strategies]' --no-cache-dir && \
4545
cd .. && \

docs/source-pytorch/common/checkpointing_basic.rst

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ PyTorch Lightning checkpoints are fully usable in plain PyTorch.
2020

2121
----
2222

23+
.. important::
24+
25+
**Important Update: Deprecated Method**
26+
27+
Starting from PyTorch Lightning v1.0.0, the `resume_from_checkpoint` argument has been deprecated. To resume training from a checkpoint, use the `ckpt_path` argument in the `fit()` method.
28+
Please update your code accordingly to avoid potential compatibility issues.
29+
2330
************************
2431
Contents of a checkpoint
2532
************************
@@ -197,16 +204,31 @@ You can disable checkpointing by passing:
197204

198205
----
199206

207+
200208
*********************
201209
Resume training state
202210
*********************
203211

204212
If you don't just want to load weights, but instead restore the full training, do the following:
205213

214+
Correct usage:
215+
206216
.. code-block:: python
207217
208218
model = LitModel()
209219
trainer = Trainer()
210220
211221
# automatically restores model, epoch, step, LR schedulers, etc...
212-
trainer.fit(model, ckpt_path="some/path/to/my_checkpoint.ckpt")
222+
trainer.fit(model, ckpt_path="path/to/your/checkpoint.ckpt")
223+
224+
.. warning::
225+
226+
The argument `resume_from_checkpoint` has been deprecated in versions of PyTorch Lightning >= 1.0.0.
227+
To resume training from a checkpoint, use the `ckpt_path` argument in the `fit()` method instead.
228+
229+
Incorrect (deprecated) usage:
230+
231+
.. code-block:: python
232+
233+
trainer = Trainer(resume_from_checkpoint="path/to/your/checkpoint.ckpt")
234+
trainer.fit(model)

docs/source-pytorch/common/index.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
../data/data
2424
../model/own_your_loop
2525
../advanced/model_init
26+
../common/tbptt
2627

2728

2829
#############
@@ -202,6 +203,13 @@ How-to Guides
202203
:col_css: col-md-4
203204
:height: 180
204205

206+
.. displayitem::
207+
:header: Truncated Back-Propagation Through Time
208+
:description: Efficiently step through time when training recurrent models
209+
:button_link: ../common/tbptt.html
210+
:col_css: col-md-4
211+
:height: 180
212+
205213
.. raw:: html
206214

207215
</div>

0 commit comments

Comments
 (0)