From 7d067c8c8d42bfdd861c0c77d1b27d816d93b2f2 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrimali Date: Wed, 26 Oct 2022 13:44:04 +0530 Subject: [PATCH 01/34] Add requires(icevision) for loading data (icevision integration) --- flash/core/integrations/icevision/data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flash/core/integrations/icevision/data.py b/flash/core/integrations/icevision/data.py index 81ce73782d..569e20fb01 100644 --- a/flash/core/integrations/icevision/data.py +++ b/flash/core/integrations/icevision/data.py @@ -20,7 +20,7 @@ from flash.core.data.utilities.loading import IMG_EXTENSIONS, load_image, NP_EXTENSIONS from flash.core.data.utilities.paths import list_valid_files from flash.core.integrations.icevision.transforms import from_icevision_record -from flash.core.utilities.imports import _ICEVISION_AVAILABLE +from flash.core.utilities.imports import _ICEVISION_AVAILABLE, requires if _ICEVISION_AVAILABLE: from icevision.core.record import BaseRecord @@ -33,6 +33,7 @@ class IceVisionInput(Input): num_classes: int labels: list + @requires("icevision") def load_data( self, root: str, From da736764e71244de688f7c809da7006a6814ae9f Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrimali Date: Thu, 3 Nov 2022 10:46:57 +0530 Subject: [PATCH 02/34] checking if issues were there for pl 1.7.7 --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 0ace319458..1a45e4c736 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ setuptools<=59.5.0 # Prevent install bug with tensorboard numpy torch>=1.7.1 torchmetrics>=0.5.0,!=0.5.1 -pytorch-lightning>=1.3.6 +pytorch-lightning>=1.3.6, <1.8.0 pyDeprecate pandas>=1.1.0 jsonargparse[signatures]>=3.17.0, <=4.9.0 From 4438093d9f601b7c96c20d59a1c47f2c8fc4f779 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrimali Date: Thu, 3 Nov 2022 12:22:15 +0530 Subject: [PATCH 03/34] Update requirements.txt --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 1a45e4c736..0ace319458 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ setuptools<=59.5.0 # Prevent install bug with tensorboard numpy torch>=1.7.1 torchmetrics>=0.5.0,!=0.5.1 -pytorch-lightning>=1.3.6, <1.8.0 +pytorch-lightning>=1.3.6 pyDeprecate pandas>=1.1.0 jsonargparse[signatures]>=3.17.0, <=4.9.0 From f189866b7c50f13d3d3866fc9ed02ce9ba52f295 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Thu, 3 Nov 2022 21:02:39 +0530 Subject: [PATCH 04/34] Pin sahi version --- requirements/datatype_image_extras.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/datatype_image_extras.txt b/requirements/datatype_image_extras.txt index 71ecbd4375..5a5d6556f2 100644 --- a/requirements/datatype_image_extras.txt +++ b/requirements/datatype_image_extras.txt @@ -3,6 +3,7 @@ fiftyone classy_vision vissl>=0.1.5 icevision>=0.8 +sahi >=0.8.19,<0.11.0 icedata effdet kornia>=0.5.1 From 2e983763ffb4fb7c099f561446893f339806020a Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 14:04:39 +0530 Subject: [PATCH 05/34] list dependencies as a separate step --- .github/workflows/ci-testing.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 7794336c7a..627b7708e3 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -115,7 +115,6 @@ jobs: pip install torch>=1.7.1 pip install '.[${{ join(matrix.topic, ',') }}]' --upgrade $flag --find-links https://download.pytorch.org/whl/cpu/torch_stable.html pip install '.[test]' --upgrade - pip list shell: bash - name: Install vissl @@ -137,6 +136,11 @@ jobs: pip install matplotlib pip install '.[audio,image]' torch==1.11.0 --upgrade + - name: PIP List + run: | + pip list + shell: bash + - name: Cache datasets uses: actions/cache@v3 with: From 0bad50f04efa790fc62a1a277236f34dbe3c5934 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 14:27:45 +0530 Subject: [PATCH 06/34] Sahi pin to 0.8.19 for serve --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 627b7708e3..460d4debf4 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -127,7 +127,7 @@ jobs: if: contains( matrix.topic , 'serve' ) run: | sudo apt-get install libsndfile1 - pip install '.[all,audio]' icevision effdet --upgrade + pip install '.[all,audio]' icevision sahi==0.8.19 effdet --upgrade - name: Install audio test dependencies if: contains( matrix.topic , 'audio' ) From abc6ef26891d977f638735778d46990146655e1f Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 14:45:50 +0530 Subject: [PATCH 07/34] try torchscript instead of torch.jit.trace --- tests/helpers/task_tester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/helpers/task_tester.py b/tests/helpers/task_tester.py index 9e0026007e..e11d52bc1e 100644 --- a/tests/helpers/task_tester.py +++ b/tests/helpers/task_tester.py @@ -106,7 +106,7 @@ def _test_jit_trace(self, tmpdir): model.eval() model.trainer = trainer - model = torch.jit.trace(model, self.example_forward_input) + model = model.to_torchscript(method='trace', example_inputs=self.example_forward_input) torch.jit.save(model, path) model = torch.jit.load(path) From b180bed08b23e8edf6a88dba0d600f9fe835bb5d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 4 Nov 2022 09:16:36 +0000 Subject: [PATCH 08/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/helpers/task_tester.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/helpers/task_tester.py b/tests/helpers/task_tester.py index e11d52bc1e..5bb1e5da04 100644 --- a/tests/helpers/task_tester.py +++ b/tests/helpers/task_tester.py @@ -106,7 +106,7 @@ def _test_jit_trace(self, tmpdir): model.eval() model.trainer = trainer - model = model.to_torchscript(method='trace', example_inputs=self.example_forward_input) + model = model.to_torchscript(method="trace", example_inputs=self.example_forward_input) torch.jit.save(model, path) model = torch.jit.load(path) From 23c4f1e10a013103d0143895a8a18d412e132fa3 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 14:50:38 +0530 Subject: [PATCH 09/34] Update golang --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0043e4ee67..8a5e69455e 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 orbs: gcp-gke: circleci/gcp-gke@1.4.0 - go: circleci/go@1.7.1 + go: circleci/go@1.19 codecov: codecov/codecov@1.1.0 trigger: From 1178289af9349266a293c323a6180fbe23daa8c2 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 14:54:51 +0530 Subject: [PATCH 10/34] 1.17 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8a5e69455e..cbb7dd36b4 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 orbs: gcp-gke: circleci/gcp-gke@1.4.0 - go: circleci/go@1.19 + go: circleci/go@1.17 codecov: codecov/codecov@1.1.0 trigger: From e125707f7cf0ecb9bf821bdbc3d0fbf51121e026 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 14:59:41 +0530 Subject: [PATCH 11/34] 1.17.9 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cbb7dd36b4..fe050e199f 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 orbs: gcp-gke: circleci/gcp-gke@1.4.0 - go: circleci/go@1.17 + go: circleci/go@1.17.9 codecov: codecov/codecov@1.1.0 trigger: From 105c82933072da8df54eb86b8a0524e369836b53 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 15:05:45 +0530 Subject: [PATCH 12/34] rollback some unrequired changes --- .circleci/config.yml | 2 +- .github/workflows/ci-testing.yml | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fe050e199f..0043e4ee67 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,7 +3,7 @@ version: 2.1 orbs: gcp-gke: circleci/gcp-gke@1.4.0 - go: circleci/go@1.17.9 + go: circleci/go@1.7.1 codecov: codecov/codecov@1.1.0 trigger: diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 460d4debf4..6f97665f23 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -136,11 +136,6 @@ jobs: pip install matplotlib pip install '.[audio,image]' torch==1.11.0 --upgrade - - name: PIP List - run: | - pip list - shell: bash - - name: Cache datasets uses: actions/cache@v3 with: From 21bd12ae72fd60aa5069067f315f884ed4147ed1 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 15:16:13 +0530 Subject: [PATCH 13/34] @rohitgr7 suggested this --- tests/helpers/task_tester.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/helpers/task_tester.py b/tests/helpers/task_tester.py index 5bb1e5da04..11432cc68b 100644 --- a/tests/helpers/task_tester.py +++ b/tests/helpers/task_tester.py @@ -105,7 +105,6 @@ def _test_jit_trace(self, tmpdir): trainer = self.instantiated_trainer model.eval() - model.trainer = trainer model = model.to_torchscript(method="trace", example_inputs=self.example_forward_input) torch.jit.save(model, path) From bfec17868fcfe6d6a8d2df2adaee4b3ac9e26fdc Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 15:18:03 +0530 Subject: [PATCH 14/34] @rohitgr7 suggested this --- tests/helpers/task_tester.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/helpers/task_tester.py b/tests/helpers/task_tester.py index 11432cc68b..5495fa646c 100644 --- a/tests/helpers/task_tester.py +++ b/tests/helpers/task_tester.py @@ -102,7 +102,6 @@ def _test_jit_trace(self, tmpdir): path = os.path.join(tmpdir, "test.pt") model = self.instantiated_task - trainer = self.instantiated_trainer model.eval() model = model.to_torchscript(method="trace", example_inputs=self.example_forward_input) From fd304eb5b38b95d8698bdbf77f1ee132edc82b76 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 15:41:09 +0530 Subject: [PATCH 15/34] lr_schedulers to lr_scheduler_configs --- tests/core/test_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/test_model.py b/tests/core/test_model.py index 65ec60052b..bb8b0c610a 100644 --- a/tests/core/test_model.py +++ b/tests/core/test_model.py @@ -471,7 +471,7 @@ def train_dataloader(self): assert task.get_num_training_steps() == batch_count assert isinstance(trainer.optimizers[0], torch.optim.Adadelta) - assert isinstance(trainer.lr_schedulers[0]["scheduler"], torch.optim.lr_scheduler.LambdaLR) + assert isinstance(trainer.lr_scheduler_configs[0]["scheduler"], torch.optim.lr_scheduler.LambdaLR) @pytest.mark.skipif(not _CORE_TESTING, reason="Not testing core.") From 82d77858061573a69c2a5b3d93b6e1601e0dd3a7 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 16:28:25 +0530 Subject: [PATCH 16/34] check if PL greater than equal to 1.8.0 --- tests/core/test_model.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/core/test_model.py b/tests/core/test_model.py index bb8b0c610a..f48cc0db31 100644 --- a/tests/core/test_model.py +++ b/tests/core/test_model.py @@ -48,6 +48,7 @@ _TEXT_TESTING, _TORCH_OPTIMIZER_AVAILABLE, _TRANSFORMERS_AVAILABLE, + _PL_GREATER_EQUAL_1_8_0, ) from flash.graph import GraphClassifier, GraphEmbedder from flash.image import ImageClassifier, SemanticSegmentation @@ -471,7 +472,10 @@ def train_dataloader(self): assert task.get_num_training_steps() == batch_count assert isinstance(trainer.optimizers[0], torch.optim.Adadelta) - assert isinstance(trainer.lr_scheduler_configs[0]["scheduler"], torch.optim.lr_scheduler.LambdaLR) + if _PL_GREATER_EQUAL_1_8_0: + assert isinstance(trainer.lr_scheduler_configs[0]["scheduler"], torch.optim.lr_scheduler.LambdaLR) + else: + assert isinstance(trainer.lr_schedulers[0]["scheduler"], torch.optim.lr_scheduler.LambdaLR) @pytest.mark.skipif(not _CORE_TESTING, reason="Not testing core.") From 7533ec8eb5f4602ac9bcfd11f6b250f8835b4a4e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 4 Nov 2022 10:59:28 +0000 Subject: [PATCH 17/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/core/test_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/test_model.py b/tests/core/test_model.py index f48cc0db31..1e1ed4d3f3 100644 --- a/tests/core/test_model.py +++ b/tests/core/test_model.py @@ -44,11 +44,11 @@ _GRAPH_TESTING, _IMAGE_AVAILABLE, _IMAGE_TESTING, + _PL_GREATER_EQUAL_1_8_0, _TABULAR_TESTING, _TEXT_TESTING, _TORCH_OPTIMIZER_AVAILABLE, _TRANSFORMERS_AVAILABLE, - _PL_GREATER_EQUAL_1_8_0, ) from flash.graph import GraphClassifier, GraphEmbedder from flash.image import ImageClassifier, SemanticSegmentation From 563bbfbf19d2c51d7ed45e42e948d6a84ee36d65 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 16:34:44 +0530 Subject: [PATCH 18/34] add PL check for 1.8.0 --- flash/core/utilities/imports.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flash/core/utilities/imports.py b/flash/core/utilities/imports.py index 9f067fb900..810e878b91 100644 --- a/flash/core/utilities/imports.py +++ b/flash/core/utilities/imports.py @@ -87,6 +87,7 @@ class Image: _PL_GREATER_EQUAL_1_4_0 = compare_version("pytorch_lightning", operator.ge, "1.4.0") _PL_GREATER_EQUAL_1_5_0 = compare_version("pytorch_lightning", operator.ge, "1.5.0") _PL_GREATER_EQUAL_1_6_0 = compare_version("pytorch_lightning", operator.ge, "1.6.0rc0") + _PL_GREATER_EQUAL_1_8_0 = compare_version("pytorch_lightning", operator.ge, "1.8.0") _PANDAS_GREATER_EQUAL_1_3_0 = compare_version("pandas", operator.ge, "1.3.0") _ICEVISION_GREATER_EQUAL_0_11_0 = compare_version("icevision", operator.ge, "0.11.0") _TM_GREATER_EQUAL_0_7_0 = compare_version("torchmetrics", operator.ge, "0.7.0") From 3d2e79121280606cec05257e27611f418ac1fc3e Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 16:46:25 +0530 Subject: [PATCH 19/34] Start 3.8 to 3.10 --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 6f97665f23..68e2500142 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -21,7 +21,7 @@ jobs: matrix: # PyTorch 1.5 is failing on Win and bolts requires torchvision>=0.5 os: [ubuntu-20.04, macOS-12, windows-2022] - python-version: [3.7, 3.9] + python-version: [3.8, 3.10] requires: ['oldest', 'latest'] topic: [['core']] release: [ 'stable' ] From 3733b5b8f0944545cdbdfd4d344ec52f659564d6 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 16:49:21 +0530 Subject: [PATCH 20/34] Move back to 3.7 to 3.9 --- .github/workflows/ci-testing.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 68e2500142..6f97665f23 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -21,7 +21,7 @@ jobs: matrix: # PyTorch 1.5 is failing on Win and bolts requires torchvision>=0.5 os: [ubuntu-20.04, macOS-12, windows-2022] - python-version: [3.8, 3.10] + python-version: [3.7, 3.9] requires: ['oldest', 'latest'] topic: [['core']] release: [ 'stable' ] From 30deeb6e987ace2105dc35be8a21d4e4bd3c1284 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 16:58:35 +0530 Subject: [PATCH 21/34] Remove _notebooks as it's unused --- .gitmodules | 4 ---- _notebooks | 1 - 2 files changed, 5 deletions(-) delete mode 160000 _notebooks diff --git a/.gitmodules b/.gitmodules index b311352c45..e69de29bb2 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,4 +0,0 @@ -[submodule "_notebooks"] - path = _notebooks - url = https://github.com/PyTorchLightning/lightning-tutorials.git - branch = publication diff --git a/_notebooks b/_notebooks deleted file mode 160000 index 0ad097a6fe..0000000000 --- a/_notebooks +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 0ad097a6fec2b2c3f8ddd5d2263e178c41d614f5 From 7ead5d167a1a81d35bebef140830d6183cc34eae Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 16:59:37 +0530 Subject: [PATCH 22/34] Revert "Remove _notebooks as it's unused" This reverts commit 30deeb6e987ace2105dc35be8a21d4e4bd3c1284. --- .gitmodules | 4 ++++ _notebooks | 1 + 2 files changed, 5 insertions(+) create mode 160000 _notebooks diff --git a/.gitmodules b/.gitmodules index e69de29bb2..b311352c45 100644 --- a/.gitmodules +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "_notebooks"] + path = _notebooks + url = https://github.com/PyTorchLightning/lightning-tutorials.git + branch = publication diff --git a/_notebooks b/_notebooks new file mode 160000 index 0000000000..0ad097a6fe --- /dev/null +++ b/_notebooks @@ -0,0 +1 @@ +Subproject commit 0ad097a6fec2b2c3f8ddd5d2263e178c41d614f5 From e62ed609e4fd9df468752e6316ceca40bf19b5f7 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrimali Date: Fri, 4 Nov 2022 17:20:13 +0530 Subject: [PATCH 23/34] fix lr_scheduler_configs usage --- tests/core/test_model.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/core/test_model.py b/tests/core/test_model.py index 1e1ed4d3f3..b6a7a3437e 100644 --- a/tests/core/test_model.py +++ b/tests/core/test_model.py @@ -473,7 +473,7 @@ def train_dataloader(self): assert task.get_num_training_steps() == batch_count assert isinstance(trainer.optimizers[0], torch.optim.Adadelta) if _PL_GREATER_EQUAL_1_8_0: - assert isinstance(trainer.lr_scheduler_configs[0]["scheduler"], torch.optim.lr_scheduler.LambdaLR) + assert isinstance(trainer.lr_scheduler_configs[0].scheduler, torch.optim.lr_scheduler.LambdaLR) else: assert isinstance(trainer.lr_schedulers[0]["scheduler"], torch.optim.lr_scheduler.LambdaLR) From 5ecaa3137d2e2dfeb8428dbbf1034c4f748464c1 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 19:16:29 +0530 Subject: [PATCH 24/34] try fixing jsonnet (go < 1.17) --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0043e4ee67..c912a9d007 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ references: run: name: Install jsonnet command: | - go install github.com/google/go-jsonnet/cmd/jsonnet@latest + go get github.com/google/go-jsonnet/cmd/jsonnet update_jsonnet: &update_jsonnet run: From e08573727f71157170eed73f1dd0fe62e5d8de21 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 19:23:02 +0530 Subject: [PATCH 25/34] Try installing 1.17 --- .circleci/config.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index c912a9d007..d8e18747ab 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -36,7 +36,7 @@ references: run: name: Install jsonnet command: | - go get github.com/google/go-jsonnet/cmd/jsonnet + go install github.com/google/go-jsonnet/cmd/jsonnet@latest update_jsonnet: &update_jsonnet run: @@ -85,6 +85,9 @@ references: jobs: TPU-tests: + executor: + name: go/default + tag: '1.17' docker: - image: circleci/python:3.7 environment: @@ -94,6 +97,9 @@ jobs: - CHECK_SPEEP: 5 steps: - checkout + - go/load-cache + - go/mod-download + - go/save-cache - go/install - *checkout_ml_testing - gcp-gke/install From da7a08014c8a0957174b9671dca2ca6dbfaa8262 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 19:24:18 +0530 Subject: [PATCH 26/34] Try installing 1.17 --- .circleci/config.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d8e18747ab..16110ddc22 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,9 +97,6 @@ jobs: - CHECK_SPEEP: 5 steps: - checkout - - go/load-cache - - go/mod-download - - go/save-cache - go/install - *checkout_ml_testing - gcp-gke/install From 5e5af421c1bbef3d632e2e90c2885c7b9be3d3e1 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 19:35:20 +0530 Subject: [PATCH 27/34] Try installing 1.17 --- .circleci/config.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 16110ddc22..49f8545056 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,7 +97,9 @@ jobs: - CHECK_SPEEP: 5 steps: - checkout - - go/install + - go/load-cache + - go/mod-download + - go/save-cache - *checkout_ml_testing - gcp-gke/install - gcp-gke/update-kubeconfig-with-credentials: From 4583ef6e31b53358db3f3f9c000783717f697301 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 20:02:36 +0530 Subject: [PATCH 28/34] Try installing 1.17 --- .circleci/config.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 49f8545056..7299e015e2 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -97,9 +97,8 @@ jobs: - CHECK_SPEEP: 5 steps: - checkout - - go/load-cache - - go/mod-download - - go/save-cache + - go/install: + version: 1.17 - *checkout_ml_testing - gcp-gke/install - gcp-gke/update-kubeconfig-with-credentials: From faa3b1756e851407d38766418505a46d420d1868 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 20:03:50 +0530 Subject: [PATCH 29/34] Try installing 1.17 --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 7299e015e2..9897e168da 100755 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -98,7 +98,7 @@ jobs: steps: - checkout - go/install: - version: 1.17 + version: "1.17" - *checkout_ml_testing - gcp-gke/install - gcp-gke/update-kubeconfig-with-credentials: From a810e7ab3c4f8f2fba065605f83479e946e8b390 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 20:40:54 +0530 Subject: [PATCH 30/34] Skip mac os 12 (flaky) --- .github/workflows/ci-testing.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 6f97665f23..21a0c220b9 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -29,6 +29,9 @@ jobs: # Skip if torch<1.8 and py3.9 on Linux: https://github.com/pytorch/pytorch/issues/50014 - { os: ubuntu-20.04, python-version: 3.9, requires: 'oldest' } - { os: ubuntu-20.04, python-version: 3.9, requires: 'latest' } + # Crashes with error code 4 (flaky, not relevant) + - { os: macos-12, python-version: 3.7, requires: 'latest', release: 'stable', topic: [ 'core' ] } + - { os: macos-12, python-version: 3.7, requires: 'oldest', release: 'stable', topic: [ 'core' ] } include: - { os: 'ubuntu-20.04', python-version: 3.9, requires: 'latest', release: 'pre', topic: [ 'core' ] } - { os: 'ubuntu-20.04', python-version: 3.9, requires: 'latest', release: 'stable', topic: [ 'image' ] } From 88b1e678b5586ab0625ff1e5cb59ad8f66bbc23c Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 20:46:17 +0530 Subject: [PATCH 31/34] skip flaky test on Mac --- .github/workflows/ci-testing.yml | 3 --- tests/examples/test_scripts.py | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci-testing.yml b/.github/workflows/ci-testing.yml index 21a0c220b9..6f97665f23 100644 --- a/.github/workflows/ci-testing.yml +++ b/.github/workflows/ci-testing.yml @@ -29,9 +29,6 @@ jobs: # Skip if torch<1.8 and py3.9 on Linux: https://github.com/pytorch/pytorch/issues/50014 - { os: ubuntu-20.04, python-version: 3.9, requires: 'oldest' } - { os: ubuntu-20.04, python-version: 3.9, requires: 'latest' } - # Crashes with error code 4 (flaky, not relevant) - - { os: macos-12, python-version: 3.7, requires: 'latest', release: 'stable', topic: [ 'core' ] } - - { os: macos-12, python-version: 3.7, requires: 'oldest', release: 'stable', topic: [ 'core' ] } include: - { os: 'ubuntu-20.04', python-version: 3.9, requires: 'latest', release: 'pre', topic: [ 'core' ] } - { os: 'ubuntu-20.04', python-version: 3.9, requires: 'latest', release: 'stable', topic: [ 'image' ] } diff --git a/tests/examples/test_scripts.py b/tests/examples/test_scripts.py index 77254d3b49..1eddd06cf4 100644 --- a/tests/examples/test_scripts.py +++ b/tests/examples/test_scripts.py @@ -120,6 +120,7 @@ "template.py", marks=[ pytest.mark.skipif(not _CORE_TESTING, reason="Not testing core."), + pytest.mark.skipif(os.name == 'posix', reason="Flaky on Mac OS (CI)"), pytest.mark.skipif(sys.version_info >= (3, 9), reason="Undiagnosed segmentation fault in 3.9"), ], ), From 7e39c5085a0b69fd57fc694ae9a7bb06a534238e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 4 Nov 2022 15:16:59 +0000 Subject: [PATCH 32/34] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/examples/test_scripts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/examples/test_scripts.py b/tests/examples/test_scripts.py index 1eddd06cf4..8337fad2c1 100644 --- a/tests/examples/test_scripts.py +++ b/tests/examples/test_scripts.py @@ -120,7 +120,7 @@ "template.py", marks=[ pytest.mark.skipif(not _CORE_TESTING, reason="Not testing core."), - pytest.mark.skipif(os.name == 'posix', reason="Flaky on Mac OS (CI)"), + pytest.mark.skipif(os.name == "posix", reason="Flaky on Mac OS (CI)"), pytest.mark.skipif(sys.version_info >= (3, 9), reason="Undiagnosed segmentation fault in 3.9"), ], ), From 49cfb60b0087382f8ae3ce9da33e6eb43079c831 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrmali Date: Fri, 4 Nov 2022 22:42:41 +0530 Subject: [PATCH 33/34] Update with num_devices instead of tpu_cores --- docs/source/general/training.rst | 2 +- flash/core/trainer.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/source/general/training.rst b/docs/source/general/training.rst index f7d00cee97..f310a9026a 100644 --- a/docs/source/general/training.rst +++ b/docs/source/general/training.rst @@ -56,6 +56,6 @@ Flash tasks supports many advanced training functionalities out-of-the-box, such .. code-block:: python # Train on TPUs - flash.Trainer(tpu_cores=8) + flash.Trainer(accelerator="tpu", num_devices=8) You can add to the flash Trainer any argument from the Lightning trainer! Learn more about the Lightning Trainer `here `_. diff --git a/flash/core/trainer.py b/flash/core/trainer.py index d3dead99fe..b0ee93e808 100644 --- a/flash/core/trainer.py +++ b/flash/core/trainer.py @@ -187,9 +187,9 @@ def predict( Returns a list of dictionaries, one for each provided dataloader containing their respective predictions. """ # Note: Prediction on TPU device with multi cores is not supported yet - if isinstance(self.accelerator, TPUAccelerator) and self.tpu_cores > 1: + if isinstance(self.accelerator, TPUAccelerator) and self.num_devices > 1: raise NotImplementedError( - f"Prediction on TPU device with multi-cores (requested cores: {self.tpu_cores}) is not supported yet." + f"Prediction on TPU device with multi-cores (requested cores: {self.num_devices}) is not supported yet." ) model = model or self.lightning_module output_transform = getattr(model, "_output_transform", None) or OutputTransform() From c506d590aebb9e339b159c6aa0d48c97ec1fb733 Mon Sep 17 00:00:00 2001 From: Kushashwa Ravi Shrimali Date: Sat, 5 Nov 2022 14:19:28 +0530 Subject: [PATCH 34/34] Add CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 024a1413b2..6a396dd4b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Fixed +- Fixed compatibility with `lightning==1.8.0` ([#1479](https://github.com/Lightning-AI/lightning-flash/pull/1479)) - Fixed the error message to suggest installing `icevision`, if it's not found while loading data ([#1474](https://github.com/Lightning-AI/lightning-flash/pull/1474)) - Fixed compatibility with `torchmetrics==1.10.0` ([#1469](https://github.com/Lightning-AI/lightning-flash/pull/1469))