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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: testing with py3.11 #17822

Merged
merged 38 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
bff2b0c
ci: testing with py3.11
Borda Jun 13, 2023
792ee44
onnxruntime
Borda Jun 13, 2023
82b77df
protobuf
Borda Jun 13, 2023
5b723ec
protobuf-compiler
Borda Jun 13, 2023
1912fc1
Merge branch 'master' into ci/py3.11
Borda Jun 15, 2023
605cc5c
Merge branch 'master' into ci/py3.11
carmocca Jun 16, 2023
74f1d61
Merge branch 'master' into ci/py3.11
Borda Jun 22, 2023
3ae60ae
Merge branch 'master' into ci/py3.11
Borda Jun 26, 2023
32afede
Merge branch 'master' into ci/py3.11
Borda Aug 8, 2023
15e19b3
Merge branch 'master' into ci/py3.11
Borda Aug 10, 2023
a19f0a2
Merge branch 'master' into ci/py3.11
Borda Aug 13, 2023
63bedc9
Merge branch 'master' into ci/py3.11
Borda Aug 21, 2023
d569b9f
switch to sub pkg
Borda Aug 23, 2023
9445815
just addition
Borda Aug 23, 2023
55a894a
skip hotfix
Borda Aug 23, 2023
d10473a
onnx >=0.14.0
Borda Aug 23, 2023
516df96
extra
Borda Aug 23, 2023
b34c5c6
extra_prefix
Borda Aug 23, 2023
9294650
...
Borda Aug 23, 2023
fe8af51
--find-links
Borda Aug 23, 2023
73c7712
!=
Borda Aug 23, 2023
43a4ab2
!=
Borda Aug 23, 2023
367ced3
try onnx
Borda Aug 23, 2023
4e00bca
try onnx
Borda Aug 23, 2023
f34c077
ex protobuf
Borda Aug 23, 2023
1497fa1
drop protobuf
Borda Aug 23, 2023
f018a31
install 3.11
Borda Aug 23, 2023
cf7bc77
Merge branch 'master' into ci/py3.11
Borda Aug 23, 2023
48c2545
tags
Borda Aug 23, 2023
5b17719
Merge branch 'ci/py3.11' of https://github.com/PyTorchLightning/pytor…
Borda Aug 23, 2023
edd113d
Merge branch 'master' into ci/py3.11
awaelchli Aug 25, 2023
375f130
enum fixes
awaelchli Aug 25, 2023
dcb06d9
debug
awaelchli Aug 25, 2023
236f2f4
Merge branch 'master' into ci/py3.11
awaelchli Aug 25, 2023
b874f8c
debug
awaelchli Aug 25, 2023
176f322
fix augment message
awaelchli Aug 25, 2023
8d7ac8e
gc
Borda Aug 28, 2023
bc9cbd5
Merge branch 'master' into ci/py3.11
Borda Aug 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 24 additions & 15 deletions .github/checkgroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ subprojects:
- "pl-cpu (macOS-11, pytorch, 3.8, 1.13)"
- "pl-cpu (ubuntu-20.04, pytorch, 3.8, 1.13)"
- "pl-cpu (windows-2022, pytorch, 3.8, 1.13)"
- "pl-cpu (macOS-12, pytorch, 3.11, 2.0)"
- "pl-cpu (ubuntu-22.04, pytorch, 3.11, 2.0)"
- "pl-cpu (windows-2022, pytorch, 3.11, 2.0)"

- id: "pytorch_lightning: Azure GPU"
paths:
Expand Down Expand Up @@ -205,6 +208,9 @@ subprojects:
- "fabric-cpu (macOS-11, fabric, 3.8, 1.13)"
- "fabric-cpu (ubuntu-20.04, fabric, 3.8, 1.13)"
- "fabric-cpu (windows-2022, fabric, 3.8, 1.13)"
- "fabric-cpu (macOS-12, fabric, 3.11, 2.0)"
- "fabric-cpu (ubuntu-22.04, fabric, 3.11, 2.0)"
- "fabric-cpu (windows-2022, fabric, 3.11, 2.0)"

- id: "lightning_fabric: Azure GPU"
paths:
Expand Down Expand Up @@ -259,12 +265,15 @@ subprojects:
- "app-pytest (macOS-11, lightning, 3.8, latest)"
- "app-pytest (macOS-11, lightning, 3.8, oldest)"
- "app-pytest (macOS-11, app, 3.9, latest)"
- "app-pytest (macOS-12, app, 3.11, latest)"
- "app-pytest (ubuntu-20.04, lightning, 3.8, latest)"
- "app-pytest (ubuntu-20.04, lightning, 3.8, oldest)"
- "app-pytest (ubuntu-20.04, app, 3.9, latest)"
- "app-pytest (ubuntu-22.04, app, 3.11, latest)"
- "app-pytest (windows-2022, lightning, 3.8, latest)"
- "app-pytest (windows-2022, lightning, 3.8, oldest)"
- "app-pytest (windows-2022, app, 3.8, latest)"
- "app-pytest (windows-2022, app, 3.11, latest)"

- id: "lightning_app: Examples"
paths:
Expand Down Expand Up @@ -387,35 +396,35 @@ subprojects:
- "!**/*.md"
checks:
- "install-pkg (ubuntu-22.04, app, 3.8)"
- "install-pkg (ubuntu-22.04, app, 3.10)"
- "install-pkg (ubuntu-22.04, app, 3.11)"
- "install-pkg (ubuntu-22.04, fabric, 3.8)"
- "install-pkg (ubuntu-22.04, fabric, 3.10)"
- "install-pkg (ubuntu-22.04, fabric, 3.11)"
- "install-pkg (ubuntu-22.04, pytorch, 3.8)"
- "install-pkg (ubuntu-22.04, pytorch, 3.10)"
- "install-pkg (ubuntu-22.04, pytorch, 3.11)"
- "install-pkg (ubuntu-22.04, lightning, 3.8)"
- "install-pkg (ubuntu-22.04, lightning, 3.10)"
- "install-pkg (ubuntu-22.04, lightning, 3.11)"
- "install-pkg (ubuntu-22.04, notset, 3.8)"
- "install-pkg (ubuntu-22.04, notset, 3.10)"
- "install-pkg (ubuntu-22.04, notset, 3.11)"
- "install-pkg (macOS-12, app, 3.8)"
- "install-pkg (macOS-12, app, 3.10)"
- "install-pkg (macOS-12, app, 3.11)"
- "install-pkg (macOS-12, fabric, 3.8)"
- "install-pkg (macOS-12, fabric, 3.10)"
- "install-pkg (macOS-12, fabric, 3.11)"
- "install-pkg (macOS-12, pytorch, 3.8)"
- "install-pkg (macOS-12, pytorch, 3.10)"
- "install-pkg (macOS-12, pytorch, 3.11)"
- "install-pkg (macOS-12, lightning, 3.8)"
- "install-pkg (macOS-12, lightning, 3.10)"
- "install-pkg (macOS-12, lightning, 3.11)"
- "install-pkg (macOS-12, notset, 3.8)"
- "install-pkg (macOS-12, notset, 3.10)"
- "install-pkg (macOS-12, notset, 3.11)"
- "install-pkg (windows-2022, app, 3.8)"
- "install-pkg (windows-2022, app, 3.10)"
- "install-pkg (windows-2022, app, 3.11)"
- "install-pkg (windows-2022, fabric, 3.8)"
- "install-pkg (windows-2022, fabric, 3.10)"
- "install-pkg (windows-2022, fabric, 3.11)"
- "install-pkg (windows-2022, pytorch, 3.8)"
- "install-pkg (windows-2022, pytorch, 3.10)"
- "install-pkg (windows-2022, pytorch, 3.11)"
- "install-pkg (windows-2022, lightning, 3.8)"
- "install-pkg (windows-2022, lightning, 3.10)"
- "install-pkg (windows-2022, lightning, 3.11)"
- "install-pkg (windows-2022, notset, 3.8)"
- "install-pkg (windows-2022, notset, 3.10)"
- "install-pkg (windows-2022, notset, 3.11)"

- id: "release dockers"
paths:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-pkg-install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
matrix:
os: [ubuntu-22.04, macOS-12, windows-2022]
pkg-name: ["app", "fabric", "pytorch", "lightning", "notset"]
python-version: ["3.8" , "3.10"]
python-version: ["3.8" , "3.11"]
# TODO: add also install from source
steps:
- uses: actions/checkout@v3
Expand Down
19 changes: 14 additions & 5 deletions .github/workflows/ci-tests-app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,15 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04, macOS-11, windows-2022]
os: ["ubuntu-20.04", "macOS-11", "windows-2022"]
pkg-name: ["lightning"]
python-version: ["3.8"]
requires: ["oldest", "latest"]
include:
# only run Python latest, use App scope to limit dependency issues
- {os: "macOS-12", pkg-name: "app", python-version: "3.11", requires: "latest"}
- {os: "ubuntu-22.04", pkg-name: "app", python-version: "3.11", requires: "latest"}
- {os: "windows-2022", pkg-name: "app", python-version: "3.11", requires: "latest"}
# "app" installs the standalone package
- {os: "macOS-11", pkg-name: "app", python-version: "3.9", requires: "latest"}
- {os: "ubuntu-20.04", pkg-name: "app", python-version: "3.9", requires: "latest"}
Expand All @@ -52,6 +56,7 @@ jobs:
PACKAGE_NAME: ${{ matrix.pkg-name }}
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
PYPI_CACHE_DIR: "_pip-wheels"
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand All @@ -75,14 +80,18 @@ jobs:
mkdir -p $PYPI_CACHE_DIR
ls -lh $PYPI_CACHE_DIR

- name: Switch PyTorch URL
run: python -c "print('TORCH_URL=https://download.pytorch.org/whl/' + str('test/cpu/torch_test.html' if '${{matrix.release}}' == 'pre' else 'cpu/torch_stable.html'))" >> $GITHUB_ENV
- name: Env. variables
run: |
# Switch coverage scope
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'pytorch_lightning'))" >> $GITHUB_ENV
# if you install mono-package set dependency only for this subpackage
python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.pkg-name}}' != 'lightning' else 'app-'))" >> $GITHUB_ENV

- name: Install package & dependencies
run: |
python -m pip install -q pip -U
extra=$(python -c "print({'lightning': 'app-'}.get('${{ matrix.pkg-name }}', ''))")
pip install -e ".[${extra}dev]" -U -f ${TORCH_URL} -f ${PYPI_CACHE_DIR} --prefer-binary
pip install -e ".[${EXTRA_PREFIX}dev]" -U --prefer-binary \
-f ${TORCH_URL} -f ${PYPI_CACHE_DIR}
pip list
- name: Dump handy wheels
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/ci-tests-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,7 @@ jobs:
PACKAGE_NAME: ${{ matrix.pkg-name }}
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
# PYPI_CACHE_DIR: "_pip-wheels"
TORCH_URL_STABLE: "https://download.pytorch.org/whl/cpu/torch_stable.html"
TORCH_URL_TEST: "https://download.pytorch.org/whl/test/cpu/torch_test.html"
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
steps:
- uses: actions/checkout@v3

Expand Down Expand Up @@ -75,6 +74,7 @@ jobs:
cat requirements/data/data.txt
cat requirements/data/cloud.txt

# ToDo
# - name: pip wheels cache
# uses: actions/cache/restore@v3
# with:
Expand All @@ -84,12 +84,10 @@ jobs:
# mkdir -p $PYPI_CACHE_DIR
# ls -lh $PYPI_CACHE_DIR

# removing torch stable line:
# pip install -e ".[${extra}test]" "pytest-timeout" -U -f ${TORCH_URL} ${TORCH_PREINSTALL} -f ${PYPI_CACHE_DIR} --prefer-binary
- name: Install package & dependencies
run: |
python -m pip install -q pip -U
pip install -e ".[data-dev]" "pytest-timeout" -U -f ${TORCH_URL} --prefer-binary
pip install -e ".[data-dev]" "pytest-timeout" -U --prefer-binary -f ${TORCH_URL}
pip list

- name: Testing Data
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/ci-tests-fabric.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,14 @@ jobs:
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.11"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.9", pytorch-version: "1.12"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.13"}
# only run PyTorch latest with Python latest
# only run PyTorch latest with Python recent
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0"}
# only run PyTorch latest with Python latest, use Fabric scope to limit dependency issues
- {os: "macOS-12", pkg-name: "fabric", python-version: "3.11", pytorch-version: "2.0"}
- {os: "ubuntu-22.04", pkg-name: "fabric", python-version: "3.11", pytorch-version: "2.0"}
- {os: "windows-2022", pkg-name: "fabric", python-version: "3.11", pytorch-version: "2.0"}
# "oldest" versions tests, only on minimum Python
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.11", requires: "oldest"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.11", requires: "oldest"}
Expand Down Expand Up @@ -82,7 +86,7 @@ jobs:
run: python .actions/assistant.py replace_oldest_ver

- name: Adjust PyTorch versions in requirements files
if: ${{ matrix.requires != 'oldest' && matrix.release != 'pre' }}
if: ${{ matrix.requires != 'oldest' }}
run: |
pip install -q wget packaging
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
Expand All @@ -103,16 +107,17 @@ jobs:
- name: Env. variables
run: |
# Switch PyTorch URL
python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.release }}' == 'pre' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
python -c "print('TORCH_PREINSTALL=' + str('--pre' if '${{ matrix.release }}' == 'pre' else ''))" >> $GITHUB_ENV
#python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.release }}' == 'pre' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
# Switch coverage scope
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'lightning_fabric'))" >> $GITHUB_ENV
# if you install mono-package set dependency only for this subpackage
python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.pkg-name}}' != 'lightning' else 'fabric-'))" >> $GITHUB_ENV

- name: Install package & dependencies
run: |
python -m pip install -q pip -U
extra=$(python -c "print({'lightning': 'fabric-'}.get('${{ matrix.pkg-name }}', ''))")
pip install -e ".[${extra}test,${extra}strategies]" "pytest-timeout" -U -f ${TORCH_URL} ${TORCH_PREINSTALL} -f ${PYPI_CACHE_DIR} --prefer-binary
#python -m pip install -q pip -U
pip install -e ".[${EXTRA_PREFIX}test,${EXTRA_PREFIX}strategies]" -U --prefer-binary \
"pytest-timeout" --find-links="${TORCH_URL}" --find-links="${PYPI_CACHE_DIR}"
pip list
- name: Dump handy wheels
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/ci-tests-pytorch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ jobs:
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.11"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.9", pytorch-version: "1.12"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "1.13"}
# only run PyTorch latest with Python latest
# only run PyTorch latest with Python recent
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0"}
- {os: "windows-2022", pkg-name: "lightning", python-version: "3.10", pytorch-version: "2.0"}
# only run PyTorch latest with Python latest, use PyTorch scope to limit dependency issues
- {os: "macOS-12", pkg-name: "pytorch", python-version: "3.11", pytorch-version: "2.0"}
- {os: "ubuntu-22.04", pkg-name: "pytorch", python-version: "3.11", pytorch-version: "2.0"}
- {os: "windows-2022", pkg-name: "pytorch", python-version: "3.11", pytorch-version: "2.0"}
# "oldest" versions tests, only on minimum Python
- {os: "macOS-11", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.11", requires: "oldest"}
- {os: "ubuntu-20.04", pkg-name: "lightning", python-version: "3.8", pytorch-version: "1.11", requires: "oldest"}
Expand All @@ -66,6 +70,7 @@ jobs:
timeout-minutes: 50
env:
PACKAGE_NAME: ${{ matrix.pkg-name }}
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
TORCH_URL_STABLE: "https://download.pytorch.org/whl/cpu/torch_stable.html"
TORCH_URL_TEST: "https://download.pytorch.org/whl/test/cpu/torch_test.html"
FREEZE_REQUIREMENTS: ${{ ! (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release/')) }}
Expand All @@ -86,7 +91,7 @@ jobs:
run: python .actions/assistant.py replace_oldest_ver

- name: Adjust PyTorch versions in requirements files
if: ${{ matrix.requires != 'oldest' && matrix.release != 'pre' }}
if: ${{ matrix.requires != 'oldest' }}
run: |
pip install -q wget packaging
python -m wget https://raw.githubusercontent.com/Lightning-AI/utilities/main/scripts/adjust-torch-versions.py
Expand All @@ -107,18 +112,18 @@ jobs:
- name: Env. variables
run: |
# Switch PyTorch URL
python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.release }}' == 'pre' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
python -c "print('TORCH_PREINSTALL=' + str('--pre' if '${{ matrix.release }}' == 'pre' else ''))" >> $GITHUB_ENV
#python -c "print('TORCH_URL=' + str('${{env.TORCH_URL_TEST}}' if '${{ matrix.release }}' == 'pre' else '${{env.TORCH_URL_STABLE}}'))" >> $GITHUB_ENV
# Switch coverage scope
python -c "print('COVERAGE_SCOPE=' + str('lightning' if '${{matrix.pkg-name}}' == 'lightning' else 'pytorch_lightning'))" >> $GITHUB_ENV
# if you install mono-package set dependency only for this subpackage
python -c "print('EXTRA_PREFIX=' + str('' if '${{matrix.pkg-name}}' != 'lightning' else 'pytorch-'))" >> $GITHUB_ENV

- name: Install package & dependencies
run: |
python -m pip install -q pip -U
extra=$(python -c "print({'lightning': 'pytorch-'}.get('${{ matrix.pkg-name }}', ''))")
pip install ".[${extra}extra,${extra}test,${extra}strategies]" -U \
#python -m pip install -q pip -U
pip install ".[${EXTRA_PREFIX}extra,${EXTRA_PREFIX}test,${EXTRA_PREFIX}strategies]" -U --prefer-binary \
"pytest-timeout" -r requirements/_integrations/accelerators.txt \
-f ${TORCH_URL} ${TORCH_PREINSTALL} -f ${PYPI_CACHE_DIR} --prefer-binary
--find-links="${TORCH_URL}" --find-links="${PYPI_CACHE_DIR}"
pip list
- name: Drop LAI from extensions
if: ${{ matrix.pkg-name != 'lightning' }}
Expand Down
2 changes: 1 addition & 1 deletion requirements/pytorch/examples.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ torchvision >=0.12.0, <=0.15.2
gym[classic_control] >=0.17.0, <0.26.3
ipython[all] <8.14.1
torchmetrics >=0.10.0, <1.1.0
lightning-utilities >=0.7.0, <0.10.0
lightning-utilities >=0.8.0, <0.10.0
5 changes: 2 additions & 3 deletions requirements/pytorch/test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ pytest-random-order ==1.1.0
# needed in tests
cloudpickle >=1.3, <2.3.0
scikit-learn >0.22.1, <1.3.1
onnx <1.15.0
onnxruntime <1.16.0
onnx >=0.14.0, <1.15.0
onnxruntime >=0.15.0, <1.16.0
psutil <5.9.6 # for `DeviceStatsMonitor`
pandas >1.0, <2.0.4 # needed in benchmarks
fastapi <0.100.0 # for `ServableModuleValidator`
uvicorn <0.23.3 # for `ServableModuleValidator`

tensorboard >=2.9.1, <2.15.0 # for `TensorBoardLogger`
protobuf <=3.20.1 # strict # an extra is updating protobuf, this pin prevents TensorBoard failure
1 change: 1 addition & 0 deletions src/lightning/__setup__.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,5 +121,6 @@ def _setup_args() -> Dict[str, Any]:
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
], # todo: consider aggregation/union of tags from particular packages
}
8 changes: 4 additions & 4 deletions src/lightning/pytorch/loops/evaluation_loop.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def run(self) -> List[_OUT_DICT]:
def setup_data(self) -> None:
trainer = self.trainer
trainer_fn = self._trainer_fn
if self._combined_loader is not None and trainer_fn == "fit" and not self._should_reload_val_dl:
if self._combined_loader is not None and trainer_fn == TrainerFn.FITTING and not self._should_reload_val_dl:
return

pl_module = trainer.lightning_module
Expand All @@ -168,7 +168,7 @@ def setup_data(self) -> None:

# store epoch of dataloader reset for reload_dataloaders_every_n_epochs
# it should not reload again if it has already reloaded during sanity_check
if trainer_fn == "fit" and (
if trainer_fn == TrainerFn.FITTING and (
(trainer.sanity_checking and trainer.fit_loop.epoch_loop._should_check_val_epoch())
or not trainer.sanity_checking
):
Expand All @@ -184,7 +184,7 @@ def setup_data(self) -> None:
else:
combined_loader = dataloaders

if trainer_fn == "fit" and trainer.overfit_batches > 0:
if trainer_fn == TrainerFn.FITTING and trainer.overfit_batches > 0:
_resolve_overfit_batches(combined_loader, stage)

dataloaders = []
Expand Down Expand Up @@ -296,7 +296,7 @@ def on_run_end(self) -> List[_OUT_DICT]:
self._on_evaluation_model_train()

if self.verbose and self.trainer.is_global_zero:
self._print_results(logged_outputs, self._stage)
self._print_results(logged_outputs, self._stage.value)

return logged_outputs

Expand Down
6 changes: 3 additions & 3 deletions src/lightning/pytorch/trainer/connectors/data_connector.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,14 +404,14 @@ def _check_dataloader_iterable(
prefix = "train_" if trainer_fn == TrainerFn.FITTING else ""
if not source.is_module():
raise TypeError(
f"An invalid dataloader was passed to `Trainer.{trainer_fn}({prefix}dataloaders=...)`."
f"An invalid dataloader was passed to `Trainer.{trainer_fn.value}({prefix}dataloaders=...)`."
f" Found {dataloader}."
)
if not is_overridden(source.name, source.instance):
raise TypeError(
f"An invalid dataloader was passed to `Trainer.{trainer_fn}({prefix}dataloaders=...)`."
f"An invalid dataloader was passed to `Trainer.{trainer_fn.value}({prefix}dataloaders=...)`."
f" Found {dataloader}."
f" Either pass the dataloader to the `.{trainer_fn}()` method OR implement"
f" Either pass the dataloader to the `.{trainer_fn.value}()` method OR implement"
f" `def {source.name}(self):` in your LightningModule/LightningDataModule."
)
raise TypeError(
Expand Down
1 change: 1 addition & 0 deletions src/lightning_app/__setup__.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ def _setup_args() -> Dict[str, Any]:
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
}
1 change: 1 addition & 0 deletions src/lightning_fabric/__setup__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,6 @@ def _setup_args() -> Dict[str, Any]:
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
],
}
Loading