Skip to content

Commit

Permalink
Revert "Revert "Remove skipping logic in favor of path filtering (#14170
Browse files Browse the repository at this point in the history
)" (#14244)"

This reverts commit fcf9b42.
  • Loading branch information
carmocca committed Aug 23, 2022
1 parent 239131b commit 8513126
Show file tree
Hide file tree
Showing 12 changed files with 102 additions and 149 deletions.
6 changes: 6 additions & 0 deletions .azure/app-cloud-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ trigger:
- "master"
- "release/*"
- "refs/tags/*"
paths:
include:
- ".azure/app-cloud-e2e.yml"
- "requirements/app/**"
- "src/lightning_app/**"
- "examples/app_*"

pr:
- "master"
Expand Down
1 change: 1 addition & 0 deletions .azure/gpu-benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ trigger:
- "master"
- "release/*"
- "refs/tags/*"
# TODO: add paths

pr: none

Expand Down
59 changes: 28 additions & 31 deletions .azure/gpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,30 @@ trigger:
- "master"
- "release/*"
- "refs/tags/*"
paths:
include:
- ".azure/gpu-tests.yml"
- "examples/run_ddp_examples.sh"
- "examples/convert_from_pt_to_pl/**"
- "examples/run_pl_examples.sh"
- "examples/pl_basics/backbone_image_classifier.py"
- "examples/pl_basics/autoencoder.py"
- "examples/pl_loops/mnist_lite.py"
- "examples/pl_fault_tolerant/automatic.py"
- "examples/test_pl_examples.py"
- "examples/pl_integrations/dali_image_classifier.py"
- "requirements/pytorch/**"
- "src/pytorch_lightning/**"
- "tests/tests_pytorch/**"
- "setup.cfg"
- "pyproject.toml"
- ".github/workflows/ci-pytorch*.yml"
- ".github/workflows/docs-*.yml"

pr:
- "master"
- "release/*"

variables:
- name: continue
value: '1'

jobs:
- job: testing
strategy:
Expand All @@ -41,22 +56,6 @@ jobs:
clean: all

steps:

- bash: |
CHANGED_FILES=$(git diff --name-status origin/master -- . | awk '{print $2}')
FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
echo $CHANGED_FILES > changed_files.txt
MATCHES=$(cat changed_files.txt | grep -E $FILTER)
echo $MATCHES
if [ -z "$MATCHES" ]; then
echo "Skip"
echo "##vso[task.setvariable variable=continue]0"
else
echo "Continue"
echo "##vso[task.setvariable variable=continue]1"
fi
displayName: Skipper
- bash: |
lspci | egrep 'VGA|3D'
whereis nvidia
Expand All @@ -66,7 +65,6 @@ jobs:
pip --version
pip list
displayName: 'Image info & NVIDIA'
condition: eq(variables['continue'], '1')
- bash: |
set -e
Expand All @@ -82,7 +80,6 @@ jobs:
PACKAGE_NAME: pytorch
FREEZE_REQUIREMENTS: 1
displayName: 'Install dependencies'
condition: eq(variables['continue'], '1')
- bash: |
set -e
Expand All @@ -91,24 +88,20 @@ jobs:
python requirements/pytorch/check-avail-strategies.py
python requirements/pytorch/check-avail-extras.py
displayName: 'Env details'
condition: eq(variables['continue'], '1')
- bash: bash .actions/pull_legacy_checkpoints.sh
displayName: 'Get legacy checkpoints'
condition: eq(variables['continue'], '1')

- bash: python -m coverage run --source pytorch_lightning -m pytest
workingDirectory: src/pytorch_lightning
displayName: 'Testing: PyTorch doctests'
condition: eq(variables['continue'], '1')

- bash: python -m coverage run --source pytorch_lightning -m pytest --ignore benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
env:
PL_RUN_CUDA_TESTS: "1"
workingDirectory: tests/tests_pytorch
displayName: 'Testing: PyTorch standard'
timeoutInMinutes: "35"
condition: eq(variables['continue'], '1')

- bash: bash run_standalone_tests.sh
workingDirectory: tests/tests_pytorch
Expand All @@ -117,7 +110,14 @@ jobs:
PL_RUN_CUDA_TESTS: "1"
displayName: 'Testing: PyTorch standalone tests'
timeoutInMinutes: "35"
condition: eq(variables['continue'], '1')

- bash: bash run_standalone_tasks.sh
workingDirectory: tests/tests_pytorch
env:
PL_USE_MOCKED_MNIST: "1"
PL_RUN_CUDA_TESTS: "1"
displayName: 'Testing: PyTorch standalone tasks'
timeoutInMinutes: "10"

- bash: |
python -m coverage report
Expand All @@ -127,14 +127,13 @@ jobs:
ls -l
workingDirectory: tests/tests_pytorch
displayName: 'Statistics'
condition: eq(variables['continue'], '1')
- task: PublishTestResults@2
displayName: 'Publish test results'
inputs:
testResultsFiles: '$(Build.StagingDirectory)/test-results.xml'
testRunTitle: '$(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
condition: and(succeededOrFailed(), eq(variables['continue'], '1'))
condition: succeededOrFailed()

- script: |
set -e
Expand All @@ -146,11 +145,9 @@ jobs:
env:
PL_USE_MOCKED_MNIST: "1"
displayName: 'Testing: PyTorch examples'
condition: eq(variables['continue'], '1')
- bash: python -m pytest benchmarks -v --maxfail=2 --durations=0
workingDirectory: tests/tests_pytorch
env:
PL_RUN_CUDA_TESTS: "1"
displayName: 'Testing: PyTorch benchmarks'
condition: eq(variables['continue'], '1')
1 change: 1 addition & 0 deletions .azure/hpu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ trigger:
- "master"
- "release/*"
- "refs/tags/*"
# TODO: add paths

pr:
- "master"
Expand Down
1 change: 1 addition & 0 deletions .azure/ipu-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ trigger:
- master
- release/*
- refs/tags/*
# TODO: add paths

pr:
- master
Expand Down
36 changes: 26 additions & 10 deletions .github/checkgroup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,6 @@ subprojects:
checks:
- "test-on-tpus"

- id: "CI: Azure"
paths:
- ".azure/**"
checks:
- "pytorch-lightning (GPUs)"
- "pytorch-lightning (GPUs) (testing PyTorch - stable)"
- "pytorch-lightning (HPUs)"
- "pytorch-lightning (IPUs)"

- id: "pytorch_lightning"
paths:
# all examples don't need to be added because they aren't used in CI, but these are
Expand Down Expand Up @@ -60,6 +51,26 @@ subprojects:
- "slow (windows-2022, 3.7, 1.11)"
- "test-on-tpus"

- id: "pytorch_lightning: Azure GPU"
paths:
- ".azure/gpu-tests.yml"
checks:
- "pytorch-lightning (GPUs)"
- "pytorch-lightning (GPUs) (testing PyTorch - stable)"

- id: "pytorch_lightning: Azure HPU"
paths:
- ".azure/hpu-tests.yml"
checks:
- "pytorch-lightning (HPUs)"
- "pytorch-lightning (IPUs)"

- id: "pytorch_lightning: Azure IPU"
paths:
- ".azure/ipu-tests.yml"
checks:
- "pytorch-lightning (IPUs)"

- id: "pytorch_lightning: Docs"
paths:
- "docs/source-pytorch/**"
Expand Down Expand Up @@ -107,7 +118,6 @@ subprojects:

- id: "lightning_app"
paths:
- ".azure/app-cloud-e2e.yml"
- "requirements/app/**"
- "src/lightning_app/**"
- "tests/tests_app/**"
Expand All @@ -126,6 +136,12 @@ subprojects:
- "pytest (windows-2022, 3.8, latest)"
- "pytest (windows-2022, 3.8, oldest)"

- id: "lightning_app: Azure"
paths:
- ".azure/app-cloud-e2e.yml"
checks:
- "App.cloud-e2e"

- id: "lightning_app: Docs"
paths:
- "docs/source-app/**"
Expand Down
9 changes: 0 additions & 9 deletions .github/file-filters.yml

This file was deleted.

7 changes: 7 additions & 0 deletions .github/workflows/ci-app-examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
- ".github/workflows/ci-app-examples.yml"
- "requirements/app/**"
- "src/lightning_app/**"
- "tests/tests_app_examples/**"
# the examples are used in the app CI
- "examples/app_*"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-app-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on: # Trigger the workflow on push or pull request, but only for the master bran
branches: [master, "release/*"]
pull_request:
paths:
- ".github/workflows/ci-app-tests.yml"
- "requirements/app/**"
- "src/lightning_app/**"
- "tests/tests_app/**"
- "requirements/app/**"
- "setup.py"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
Expand Down
35 changes: 8 additions & 27 deletions .github/workflows/ci-pytorch-test-conda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ on: # Trigger the workflow on push or pull request, but only for the master bra
branches: [master, "release/*"]
pull_request:
branches: [master, "release/*"]
paths:
- "requirements/pytorch/**"
- "src/pytorch_lightning/**"
- "tests/tests_pytorch/**"
- "setup.cfg" # includes pytest config
- ".github/workflows/ci-pytorch-test-conda.yml"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.head_ref }}
Expand Down Expand Up @@ -35,28 +41,7 @@ jobs:

- uses: actions/checkout@v2

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v28

- name: Decide if the test should be skipped
id: skip
shell: bash -l {0}
run: |
FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr " " "\n" > changed_files.txt
MATCHES=$(cat changed_files.txt | grep -E $FILTER)
echo $MATCHES
if [ -z "$MATCHES" ]; then
echo "Skip"
echo "::set-output name=continue::0"
else
echo "Continue"
echo "::set-output name=continue::1"
fi
- name: Update base dependencies
if: ${{ (steps.skip.outputs.continue == '1') }}
env:
PACKAGE_NAME: pytorch
FREEZE_REQUIREMENTS: 1
Expand All @@ -70,12 +55,10 @@ jobs:
run: pip install "Pillow<9.0" # It messes with torchvision

- name: DocTests
if: ${{ (steps.skip.outputs.continue == '1') }}
working-directory: ./src
run: pytest pytorch_lightning --cov=pytorch_lightning

- name: Update all dependencies
if: ${{ (steps.skip.outputs.continue == '1') }}
env:
HOROVOD_BUILD_ARCH_FLAGS: "-mfma"
HOROVOD_WITHOUT_MXNET: 1
Expand All @@ -95,11 +78,9 @@ jobs:
python requirements/pytorch/check-avail-extras.py
- name: Pull legacy checkpoints
if: ${{ (steps.skip.outputs.continue == '1') }}
run: bash .actions/pull_legacy_checkpoints.sh

- name: Testing PyTorch
if: ${{ (steps.skip.outputs.continue == '1') }}
working-directory: tests/tests_pytorch
run: coverage run --source pytorch_lightning -m pytest -v --timeout 150 --durations=50 --junitxml=results-${{ runner.os }}-torch${{ matrix.pytorch-version }}.xml

Expand All @@ -111,15 +92,15 @@ jobs:
if: failure()

- name: Statistics
if: ${{ success() && (steps.skip.outputs.continue == '1') }}
if: success()
working-directory: tests/tests_pytorch
run: |
coverage report
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
if: ${{ success() && (steps.skip.outputs.continue == '1') }}
if: success()
# see: https://github.com/actions/toolkit/issues/399
continue-on-error: true
with:
Expand Down
Loading

0 comments on commit 8513126

Please sign in to comment.