From 7b872e8312baa493f0d02f72ff62725715af8cae Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Thu, 20 May 2021 01:29:59 +0200 Subject: [PATCH 01/12] MANIFEST.in and setup.py cleanup --- MANIFEST.in | 64 ++--------------------------------------------------- setup.py | 4 ++-- 2 files changed, 4 insertions(+), 64 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 1b97e27a98abe..4ed189c4dd0c9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -11,67 +11,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - -# Manifest syntax https://docs.python.org/2/distutils/sourcedist.html -graft wheelhouse - -recursive-exclude __pycache__ *.py[cod] *.orig - -# Include the README and CHANGELOG -include *.md - -# Include the license file -include LICENSE - -exclude *.sh -exclude *.svg -recursive-include pytorch_lightning *.py - -# Include marker file for PEP 561 -include pytorch_lightning/py.typed - -# include examples -recursive-include pl_examples *.py *.md *.sh *.txt *.toml - -# exclude tests from package -recursive-exclude tests * -recursive-exclude site * -exclude tests - -# Exclude the documentation files -recursive-exclude docs * -exclude docs -recursive-include docs/source/_static/images/logos/ * -recursive-include docs/source/_static/images/general/ pl_overview* tf_* tutorial_* PTL101_* - -# Include the Requirements +include pytorch_lightning/py.typed # marker file for PEP 561 +include CHANGELOG.md recursive-include requirements *.txt -recursive-exclude requirements *.sh *.py include requirements.txt -include pyproject.toml - -# Exclude build configs -exclude *.yml -exclude *.yaml -exclude *.toml -exclude *.jsonnet -exclude .yapfignore - -# Exclude pyright config -exclude .pyrightconfig.json - -# Exclude submodules -exclude .gitmodules -exclude _notebooks - -# Exclude Makefile -exclude Makefile - -prune .git -prune .github -prune .circleci -prune temp* -prune test* -prune benchmark* -prune dockers -prune legacy diff --git a/setup.py b/setup.py index beebd807c7107..e6d623c90445e 100755 --- a/setup.py +++ b/setup.py @@ -76,10 +76,10 @@ def _load_py_module(fname, pkg="pytorch_lightning"): url=about.__homepage__, download_url='https://github.com/PyTorchLightning/pytorch-lightning', license=about.__license__, - packages=find_packages(exclude=['tests', 'tests/*', 'benchmarks', 'legacy', 'legacy/*']), + packages=find_packages(exclude=['tests*', 'pl_examples*', 'benchmarks*']), + include_package_data=True, long_description=long_description, long_description_content_type='text/markdown', - include_package_data=True, zip_safe=False, keywords=['deep learning', 'pytorch', 'AI'], python_requires='>=3.6', From 692c2335ea669b3d5e625c5bc40420c5c9f8571b Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Thu, 20 May 2021 01:54:57 +0200 Subject: [PATCH 02/12] Remove check-manifest --- .github/workflows/ci_pkg-install.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci_pkg-install.yml b/.github/workflows/ci_pkg-install.yml index 12f3976d078e4..2cf64f39a28b7 100644 --- a/.github/workflows/ci_pkg-install.yml +++ b/.github/workflows/ci_pkg-install.yml @@ -26,12 +26,11 @@ jobs: - name: Prepare env run: | - pip install check-manifest "twine==3.2" setuptools wheel + pip install "twine==3.2" setuptools wheel - name: Create package run: | - check-manifest - # python setup.py check --metadata --strict + python setup.py check --metadata --strict python setup.py sdist bdist_wheel - name: Check package From 3497a10e105872ed6317186acd03390867de0a7f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 10 Nov 2021 04:23:57 +0000 Subject: [PATCH 03/12] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- MANIFEST.in | 2 +- setup.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 6ae72d5709b8b..4ed189c4dd0c9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -14,4 +14,4 @@ include pytorch_lightning/py.typed # marker file for PEP 561 include CHANGELOG.md recursive-include requirements *.txt -include requirements.txt \ No newline at end of file +include requirements.txt diff --git a/setup.py b/setup.py index ff8a3f862ea1f..0bdcd2f9e09ff 100755 --- a/setup.py +++ b/setup.py @@ -74,10 +74,10 @@ def _load_py_module(fname, pkg="pytorch_lightning"): url=about.__homepage__, download_url="https://github.com/PyTorchLightning/pytorch-lightning", license=about.__license__, - packages=find_packages(exclude=['tests*', 'pl_examples*', 'benchmarks*']), + packages=find_packages(exclude=["tests*", "pl_examples*", "benchmarks*"]), include_package_data=True, long_description=long_description, - long_description_content_type='text/markdown', + long_description_content_type="text/markdown", zip_safe=False, keywords=["deep learning", "pytorch", "AI"], python_requires=">=3.6", From 05e51fe3a141365f4e08a0d4d6c2e6345ced72ad Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 05:32:43 +0100 Subject: [PATCH 04/12] Avoid using RunIf --- pl_examples/test_examples.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pl_examples/test_examples.py b/pl_examples/test_examples.py index 19d09836ef34c..00ca558c53606 100644 --- a/pl_examples/test_examples.py +++ b/pl_examples/test_examples.py @@ -14,9 +14,10 @@ from unittest import mock import pytest +import torch from pl_examples import _DALI_AVAILABLE -from tests.helpers.runif import RunIf +from pytorch_lightning.utilities.imports import _IS_WINDOWS ARGS_DEFAULT = ( "--trainer.default_root_dir %(tmpdir)s " @@ -31,7 +32,8 @@ @pytest.mark.skipif(not _DALI_AVAILABLE, reason="Nvidia DALI required") -@RunIf(min_gpus=1, skip_windows=True) +@pytest.mark.skipif(not torch.cuda.is_available(), reason="CUDA required") +@pytest.mark.skipif(_IS_WINDOWS, reason="Not supported on Windows") @pytest.mark.parametrize("cli_args", [ARGS_GPU]) def test_examples_mnist_dali(tmpdir, cli_args): from pl_examples.integration_examples.dali_image_classifier import cli_main From 78b510f8507290f882f98ecca5288fed29d7d74a Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 05:32:57 +0100 Subject: [PATCH 05/12] Copy the MNIST implementation --- .../basic_examples/mnist_datamodule.py | 102 +++++++++++++++++- tests/helpers/datasets.py | 5 +- 2 files changed, 101 insertions(+), 6 deletions(-) diff --git a/pl_examples/basic_examples/mnist_datamodule.py b/pl_examples/basic_examples/mnist_datamodule.py index 1d2371c702ce0..21049cf576184 100644 --- a/pl_examples/basic_examples/mnist_datamodule.py +++ b/pl_examples/basic_examples/mnist_datamodule.py @@ -11,13 +11,18 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. +import logging import os import platform -from typing import Optional +import random +import time +import urllib +from typing import Optional, Tuple from urllib.error import HTTPError from warnings import warn -from torch.utils.data import DataLoader, random_split +import torch +from torch.utils.data import DataLoader, Dataset, random_split from pl_examples import _DATASETS_PATH from pytorch_lightning import LightningDataModule @@ -27,6 +32,97 @@ from torchvision import transforms as transform_lib +class _MNIST(Dataset): + """Carbon copy of `tests.helpers.datasets.MNIST`. + + We cannot import the tests as they are not distributed with the package. + See https://github.com/PyTorchLightning/pytorch-lightning/pull/7614#discussion_r671183652 for more context. + """ + + RESOURCES = ( + "https://pl-public-data.s3.amazonaws.com/MNIST/processed/training.pt", + "https://pl-public-data.s3.amazonaws.com/MNIST/processed/test.pt", + ) + + TRAIN_FILE_NAME = "training.pt" + TEST_FILE_NAME = "test.pt" + cache_folder_name = "complete" + + def __init__( + self, root: str, train: bool = True, normalize: tuple = (0.1307, 0.3081), download: bool = True, **kwargs + ): + super().__init__() + self.root = root + self.train = train # training set or test set + self.normalize = normalize + + self.prepare_data(download) + + data_file = self.TRAIN_FILE_NAME if self.train else self.TEST_FILE_NAME + self.data, self.targets = self._try_load(os.path.join(self.cached_folder_path, data_file)) + + def __getitem__(self, idx: int) -> Tuple[torch.Tensor, int]: + img = self.data[idx].float().unsqueeze(0) + target = int(self.targets[idx]) + + if self.normalize is not None and len(self.normalize) == 2: + img = self.normalize_tensor(img, *self.normalize) + + return img, target + + def __len__(self) -> int: + return len(self.data) + + @property + def cached_folder_path(self) -> str: + return os.path.join(self.root, "MNIST", self.cache_folder_name) + + def _check_exists(self, data_folder: str) -> bool: + existing = True + for fname in (self.TRAIN_FILE_NAME, self.TEST_FILE_NAME): + existing = existing and os.path.isfile(os.path.join(data_folder, fname)) + return existing + + def prepare_data(self, download: bool = True): + if download and not self._check_exists(self.cached_folder_path): + self._download(self.cached_folder_path) + if not self._check_exists(self.cached_folder_path): + raise RuntimeError("Dataset not found.") + + def _download(self, data_folder: str) -> None: + os.makedirs(data_folder, exist_ok=True) + for url in self.RESOURCES: + logging.info(f"Downloading {url}") + fpath = os.path.join(data_folder, os.path.basename(url)) + urllib.request.urlretrieve(url, fpath) + + @staticmethod + def _try_load(path_data, trials: int = 30, delta: float = 1.0): + """Resolving loading from the same time from multiple concurrent processes.""" + res, exception = None, None + assert trials, "at least some trial has to be set" + assert os.path.isfile(path_data), f"missing file: {path_data}" + for _ in range(trials): + try: + res = torch.load(path_data) + # todo: specify the possible exception + except Exception as e: + exception = e + time.sleep(delta * random.random()) + else: + break + if exception is not None: + # raise the caught exception + raise exception + return res + + @staticmethod + def normalize_tensor(tensor: torch.Tensor, mean: float = 0.0, std: float = 1.0) -> torch.Tensor: + mean = torch.as_tensor(mean, dtype=tensor.dtype, device=tensor.device) + std = torch.as_tensor(std, dtype=tensor.dtype, device=tensor.device) + return tensor.sub(mean).div(std) + + def MNIST(*args, **kwargs): torchvision_mnist_available = not bool(os.getenv("PL_USE_MOCKED_MNIST", False)) if torchvision_mnist_available: @@ -39,7 +135,7 @@ def MNIST(*args, **kwargs): torchvision_mnist_available = False if not torchvision_mnist_available: print("`torchvision.datasets.MNIST` not available. Using our hosted version") - from tests.helpers.datasets import MNIST + MNIST = _MNIST return MNIST(*args, **kwargs) diff --git a/tests/helpers/datasets.py b/tests/helpers/datasets.py index 561642ae8cfbe..33bf1d9b8e13f 100644 --- a/tests/helpers/datasets.py +++ b/tests/helpers/datasets.py @@ -19,7 +19,6 @@ from typing import Optional, Sequence, Tuple import torch -from torch import Tensor from torch.utils.data import Dataset @@ -70,7 +69,7 @@ def __init__( data_file = self.TRAIN_FILE_NAME if self.train else self.TEST_FILE_NAME self.data, self.targets = self._try_load(os.path.join(self.cached_folder_path, data_file)) - def __getitem__(self, idx: int) -> Tuple[Tensor, int]: + def __getitem__(self, idx: int) -> Tuple[torch.Tensor, int]: img = self.data[idx].float().unsqueeze(0) target = int(self.targets[idx]) @@ -126,7 +125,7 @@ def _try_load(path_data, trials: int = 30, delta: float = 1.0): return res @staticmethod - def normalize_tensor(tensor: Tensor, mean: float = 0.0, std: float = 1.0) -> Tensor: + def normalize_tensor(tensor: torch.Tensor, mean: float = 0.0, std: float = 1.0) -> torch.Tensor: mean = torch.as_tensor(mean, dtype=tensor.dtype, device=tensor.device) std = torch.as_tensor(std, dtype=tensor.dtype, device=tensor.device) return tensor.sub(mean).div(std) From 4e399e5b5f6b46c74443bdcbfc6a7a398c86db0f Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 05:38:39 +0100 Subject: [PATCH 06/12] Update MANIFEST --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index 4ed189c4dd0c9..a68fc82474e70 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -15,3 +15,4 @@ include pytorch_lightning/py.typed # marker file for PEP 561 include CHANGELOG.md recursive-include requirements *.txt include requirements.txt +include *.cff # citation info From afee78e31c0fd679c02e558c32789a1d30f1dfce Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 06:54:59 +0100 Subject: [PATCH 07/12] Remove dependency --- pl_examples/basic_examples/mnist_datamodule.py | 2 +- requirements/test.txt | 1 - setup.cfg | 8 -------- 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/pl_examples/basic_examples/mnist_datamodule.py b/pl_examples/basic_examples/mnist_datamodule.py index 21049cf576184..a8d33b287f380 100644 --- a/pl_examples/basic_examples/mnist_datamodule.py +++ b/pl_examples/basic_examples/mnist_datamodule.py @@ -33,7 +33,7 @@ class _MNIST(Dataset): - """Carbon copy of `tests.helpers.datasets.MNIST`. + """Carbon copy of ``tests.helpers.datasets.MNIST``. We cannot import the tests as they are not distributed with the package. See https://github.com/PyTorchLightning/pytorch-lightning/pull/7614#discussion_r671183652 for more context. diff --git a/requirements/test.txt b/requirements/test.txt index de749e2339f10..d86137b037f4d 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -2,7 +2,6 @@ coverage>5.2.0 codecov>=2.1 pytest>=6.0 pytest-rerunfailures>=10.2 -check-manifest twine==3.2 mypy>=0.900 flake8>=3.9.2 diff --git a/setup.cfg b/setup.cfg index 9d63c0e556341..20f00ef8ae102 100644 --- a/setup.cfg +++ b/setup.cfg @@ -66,14 +66,6 @@ ignore = W503 # Ignore "Line break occurred before a binary operator" E203 # Ignore "whitespace before ':'" -# setup.cfg or tox.ini -[check-manifest] -ignore = - *.yml - .github - .github/* - .circleci - [metadata] license_file = LICENSE From e1b62f596ae64676819fd00edac20c030f0b7d95 Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 07:21:44 +0100 Subject: [PATCH 08/12] Set PYTHONPATH --- pl_examples/run_examples.sh | 1 + tests/special_tests.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/pl_examples/run_examples.sh b/pl_examples/run_examples.sh index 4a15c3367d35f..a04a57631d9cb 100755 --- a/pl_examples/run_examples.sh +++ b/pl_examples/run_examples.sh @@ -1,6 +1,7 @@ #!/bin/bash set -ex +export PYTHONPATH="${PYTHONPATH}:$(pwd)" dir_path=$(dirname "${BASH_SOURCE[0]}") args=" --data.batch_size=32 diff --git a/tests/special_tests.sh b/tests/special_tests.sh index f4b760dd75291..ff6dbcecb34cd 100755 --- a/tests/special_tests.sh +++ b/tests/special_tests.sh @@ -87,6 +87,7 @@ fi # report+="Ran\ttests/plugins/environments/torch_elastic_deadlock.py\n" # test that a user can manually launch individual processes +export PYTHONPATH="${PYTHONPATH}:$(pwd)" args="--trainer.gpus 2 --trainer.strategy ddp --trainer.max_epochs=1 --trainer.limit_train_batches=1 --trainer.limit_val_batches=1 --trainer.limit_test_batches=1" MASTER_ADDR="localhost" MASTER_PORT=1234 LOCAL_RANK=1 python pl_examples/basic_examples/mnist_examples/image_classifier_5_lightning_datamodule.py ${args} & MASTER_ADDR="localhost" MASTER_PORT=1234 LOCAL_RANK=0 python pl_examples/basic_examples/mnist_examples/image_classifier_5_lightning_datamodule.py ${args} From 66e5594fb73152e12585673ad1695ab3553f3d2a Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 07:30:35 +0100 Subject: [PATCH 09/12] Move benchmarks --- .azure-pipelines/gpu-benchmark.yml | 2 +- .azure-pipelines/gpu-tests.yml | 4 ++-- benchmarks/__init__.py | 18 ------------------ setup.py | 2 +- tests/benchmarks/__init__.py | 0 .../benchmarks}/generate_comparison.py | 2 +- .../benchmarks}/test_basic_parity.py | 0 .../benchmarks}/test_sharded_parity.py | 0 8 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 benchmarks/__init__.py create mode 100644 tests/benchmarks/__init__.py rename {benchmarks => tests/benchmarks}/generate_comparison.py (97%) rename {benchmarks => tests/benchmarks}/test_basic_parity.py (100%) rename {benchmarks => tests/benchmarks}/test_sharded_parity.py (100%) diff --git a/.azure-pipelines/gpu-benchmark.yml b/.azure-pipelines/gpu-benchmark.yml index f8b9593d72798..6d45cc2f4566a 100644 --- a/.azure-pipelines/gpu-benchmark.yml +++ b/.azure-pipelines/gpu-benchmark.yml @@ -36,7 +36,7 @@ jobs: steps: - bash: | - python -m pytest benchmarks -v --durations=0 + python -m pytest tests/benchmarks -v --durations=0 displayName: 'Testing: benchmarks' env: PL_RUNNING_BENCHMARKS: 1 diff --git a/.azure-pipelines/gpu-tests.yml b/.azure-pipelines/gpu-tests.yml index f1af36a6090b9..71332a840fdb0 100644 --- a/.azure-pipelines/gpu-tests.yml +++ b/.azure-pipelines/gpu-tests.yml @@ -68,7 +68,7 @@ jobs: displayName: 'Get legacy checkpoints' - bash: | - python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50 + python -m coverage run --source pytorch_lightning -m pytest pytorch_lightning tests --ignore tests/benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50 displayName: 'Testing: standard' - bash: | @@ -113,5 +113,5 @@ jobs: displayName: 'Testing: examples' - bash: | - python -m pytest benchmarks -v --maxfail=2 --durations=0 + python -m pytest tests/benchmarks -v --maxfail=2 --durations=0 displayName: 'Testing: benchmarks' diff --git a/benchmarks/__init__.py b/benchmarks/__init__.py deleted file mode 100644 index b4a3da40d40d0..0000000000000 --- a/benchmarks/__init__.py +++ /dev/null @@ -1,18 +0,0 @@ -# Copyright The PyTorch Lightning team. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -import os - -_BENCHMARK_ROOT = os.path.dirname(__file__) -_PROJECT_ROOT = os.path.dirname(_BENCHMARK_ROOT) -_PATH_DATASETS = os.path.join(_PROJECT_ROOT, "Datasets") diff --git a/setup.py b/setup.py index 0bdcd2f9e09ff..9d54a0d5641f5 100755 --- a/setup.py +++ b/setup.py @@ -74,7 +74,7 @@ def _load_py_module(fname, pkg="pytorch_lightning"): url=about.__homepage__, download_url="https://github.com/PyTorchLightning/pytorch-lightning", license=about.__license__, - packages=find_packages(exclude=["tests*", "pl_examples*", "benchmarks*"]), + packages=find_packages(exclude=["tests*", "pl_examples*", "legacy*"]), include_package_data=True, long_description=long_description, long_description_content_type="text/markdown", diff --git a/tests/benchmarks/__init__.py b/tests/benchmarks/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/benchmarks/generate_comparison.py b/tests/benchmarks/generate_comparison.py similarity index 97% rename from benchmarks/generate_comparison.py rename to tests/benchmarks/generate_comparison.py index 5a9cde0d80ed3..bc95b5d9cf591 100644 --- a/benchmarks/generate_comparison.py +++ b/tests/benchmarks/generate_comparison.py @@ -16,7 +16,7 @@ import matplotlib.pylab as plt import pandas as pd -from benchmarks.test_basic_parity import measure_loops +from tests.benchmarks.test_basic_parity import measure_loops from tests.helpers.advanced_models import ParityModuleMNIST, ParityModuleRNN NUM_EPOCHS = 20 diff --git a/benchmarks/test_basic_parity.py b/tests/benchmarks/test_basic_parity.py similarity index 100% rename from benchmarks/test_basic_parity.py rename to tests/benchmarks/test_basic_parity.py diff --git a/benchmarks/test_sharded_parity.py b/tests/benchmarks/test_sharded_parity.py similarity index 100% rename from benchmarks/test_sharded_parity.py rename to tests/benchmarks/test_sharded_parity.py From 040b4a633688e5fcfcf5c80b4b5f72eb993968a4 Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 15:08:26 +0100 Subject: [PATCH 10/12] Fix special tests --- tests/special_tests.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/special_tests.sh b/tests/special_tests.sh index ff6dbcecb34cd..0d20c34651518 100755 --- a/tests/special_tests.sh +++ b/tests/special_tests.sh @@ -20,7 +20,7 @@ export PL_RUNNING_SPECIAL_TESTS=1 defaults='-m coverage run --source pytorch_lightning --append -m pytest --durations=0 --capture=no --disable-warnings' # find tests marked as `@RunIf(special=True)` -grep_output=$(grep --recursive --line-number --word-regexp 'tests' 'benchmarks' --regexp 'special=True') +grep_output=$(grep --recursive --line-number --word-regexp 'tests' --regexp 'special=True') # file paths files=$(echo "$grep_output" | cut -f1 -d:) files_arr=($files) From 9c70e4e8903d6fe0102abc77f45c1a6eddd37d94 Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 10 Nov 2021 15:14:36 +0100 Subject: [PATCH 11/12] Fix mypy --- pyproject.toml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 6546d96e3d5e5..08b7b50eee770 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,6 @@ requires = [ [tool.isort] known_first_party = [ - "benchmarks", "docs", "pl_examples", "pytorch_lightning", @@ -24,7 +23,7 @@ line-length = 120 [tool.mypy] -files = ["pytorch_lightning", "pl_examples", "benchmarks"] +files = ["pytorch_lightning"] disallow_untyped_defs = "True" ignore_missing_imports = "True" show_error_codes = "True" @@ -53,9 +52,6 @@ module = [ "pytorch_lightning.distributed.*", "pytorch_lightning.tuner.*", "pytorch_lightning.utilities.*", - "pl_examples.*", - "benchmarks.*", - "tests.helpers.*" ] ignore_errors = "True" From 34eea89055f47f1e4f048b8e42280f9626f1a305 Mon Sep 17 00:00:00 2001 From: Carlos Mocholi Date: Wed, 17 Nov 2021 17:12:44 +0100 Subject: [PATCH 12/12] Use non-deprecated option --- tests/benchmarks/test_basic_parity.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/benchmarks/test_basic_parity.py b/tests/benchmarks/test_basic_parity.py index 2144be39394cb..7d3ad6af4bac3 100644 --- a/tests/benchmarks/test_basic_parity.py +++ b/tests/benchmarks/test_basic_parity.py @@ -160,8 +160,8 @@ def lightning_loop(cls_model, idx, device_type: str = "cuda", num_epochs=10): max_epochs=num_epochs if idx > 0 else 1, enable_progress_bar=False, enable_model_summary=False, + enable_checkpointing=False, gpus=1 if device_type == "cuda" else 0, - checkpoint_callback=False, logger=False, replace_sampler_ddp=False, )