From f56a34db1362e59ddaf0bace138aceeb5702d41b Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Mon, 22 Mar 2021 16:13:00 +0100 Subject: [PATCH 1/3] mock examples --- .github/workflows/ci_test-full.yml | 2 ++ azure-pipelines.yml | 2 ++ pl_examples/__init__.py | 4 ++-- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index ba8d804414993..df189884d005a 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -137,6 +137,8 @@ jobs: python -m pytest pytorch_lightning tests --cov=pytorch_lightning -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml - name: Examples + env: + PL_USE_MOCKED_MNIST: "1" run: | python -m pytest pl_examples -v --durations=10 diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9e2ff77563fa0..b7a2d851052ed 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -121,4 +121,6 @@ jobs: # cd pl_examples/basic_examples # bash submit_ddp_job.sh # bash submit_ddp2_job.sh + env: + PL_USE_MOCKED_MNIST: "1" displayName: 'Examples' diff --git a/pl_examples/__init__.py b/pl_examples/__init__.py index ffd60f9ed71af..ca49fb9aeefc0 100644 --- a/pl_examples/__init__.py +++ b/pl_examples/__init__.py @@ -15,10 +15,10 @@ _DATASETS_PATH = os.path.join(_PACKAGE_ROOT, 'Datasets') _TORCHVISION_AVAILABLE = _module_available("torchvision") -_TORCHVISION_MNIST_AVAILABLE = True +_TORCHVISION_MNIST_AVAILABLE = not bool(os.environ.get("PL_USE_MOCKED_MNIST", "0")) _DALI_AVAILABLE = _module_available("nvidia.dali") -if _TORCHVISION_AVAILABLE: +if _TORCHVISION_MNIST_AVAILABLE: try: from torchvision.datasets.mnist import MNIST MNIST(_DATASETS_PATH, download=True) From 3efbdd309e01053d9d77a90b50363f3cf6fee009 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Mon, 22 Mar 2021 16:21:27 +0100 Subject: [PATCH 2/3] drop from GA --- .github/workflows/ci_test-full.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci_test-full.yml b/.github/workflows/ci_test-full.yml index df189884d005a..ba8d804414993 100644 --- a/.github/workflows/ci_test-full.yml +++ b/.github/workflows/ci_test-full.yml @@ -137,8 +137,6 @@ jobs: python -m pytest pytorch_lightning tests --cov=pytorch_lightning -v --durations=50 --junitxml=junit/test-results-${{ runner.os }}-py${{ matrix.python-version }}-${{ matrix.requires }}.xml - name: Examples - env: - PL_USE_MOCKED_MNIST: "1" run: | python -m pytest pl_examples -v --durations=10 From ccde3b8c24980ee812a58affd5357370e7d8d029 Mon Sep 17 00:00:00 2001 From: Jirka Borovec Date: Mon, 22 Mar 2021 17:28:44 +0100 Subject: [PATCH 3/3] ... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Carlos MocholĂ­ --- pl_examples/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl_examples/__init__.py b/pl_examples/__init__.py index ca49fb9aeefc0..150ac309ddceb 100644 --- a/pl_examples/__init__.py +++ b/pl_examples/__init__.py @@ -15,7 +15,7 @@ _DATASETS_PATH = os.path.join(_PACKAGE_ROOT, 'Datasets') _TORCHVISION_AVAILABLE = _module_available("torchvision") -_TORCHVISION_MNIST_AVAILABLE = not bool(os.environ.get("PL_USE_MOCKED_MNIST", "0")) +_TORCHVISION_MNIST_AVAILABLE = not bool(os.environ.get("PL_USE_MOCKED_MNIST", False)) _DALI_AVAILABLE = _module_available("nvidia.dali") if _TORCHVISION_MNIST_AVAILABLE: