@@ -12,18 +12,23 @@ trigger:
1212 - " master"
1313 - " release/*"
1414 - " refs/tags/*"
15+
1516pr :
1617 - " master"
1718 - " release/*"
1819
20+ variables :
21+ - name : continue
22+ value : ' 1'
23+
1924jobs :
2025 - job : testing
2126 strategy :
2227 matrix :
2328 ' PyTorch - stable ' :
2429 image : " pytorchlightning/pytorch_lightning:base-cuda-py3.9-torch1.11"
2530 # how long to run the job before automatically cancelling
26- timeoutInMinutes : " 100 "
31+ timeoutInMinutes : " 80 "
2732 # how much time to give 'run always even if cancelled tasks' before stopping them
2833 cancelTimeoutInMinutes : " 2"
2934 pool : azure-jirka-spot
3742
3843 steps :
3944
45+ - bash : |
46+ CHANGED_FILES=$(git diff --name-status origin/master -- . | awk '{print $2}')
47+ FILTER='src/pytorch_lightning|requirements/pytorch|tests/tests_pytorch|examples/pl_*'
48+ echo $CHANGED_FILES > changed_files.txt
49+ MATCHES=$(cat changed_files.txt | grep -E $FILTER)
50+ echo $MATCHES
51+ if [ -z "$MATCHES" ]; then
52+ echo "Skip"
53+ echo "##vso[task.setvariable variable=continue]0"
54+ else
55+ echo "Continue"
56+ echo "##vso[task.setvariable variable=continue]1"
57+ fi
58+ displayName: Skipper
59+
4060 - bash : |
4161 lspci | egrep 'VGA|3D'
4262 whereis nvidia
4666 pip --version
4767 pip list
4868 displayName: 'Image info & NVIDIA'
69+ condition: eq(variables['continue'], '1')
4970
5071 - bash : |
5172 python -c "fname = 'requirements/pytorch/strategies.txt' ; lines = [line for line in open(fname).readlines() if 'horovod' not in line] ; open(fname, 'w').writelines(lines)"
5879 PACKAGE_NAME: pytorch
5980 FREEZE_REQUIREMENTS: 1
6081 displayName: 'Install dependencies'
82+ condition: eq(variables['continue'], '1')
6183
6284 - bash : |
6385 set -e
@@ -66,23 +88,33 @@ jobs:
6688 python requirements/pytorch/check-avail-strategies.py
6789 python requirements/pytorch/check-avail-extras.py
6890 displayName: 'Env details'
91+ condition: eq(variables['continue'], '1')
6992
7093 - bash : bash .actions/pull_legacy_checkpoints.sh
7194 displayName : ' Get legacy checkpoints'
95+ condition : eq(variables['continue'], '1')
7296
7397 - bash : python -m coverage run --source pytorch_lightning -m pytest
7498 workingDirectory : src/pytorch_lightning
7599 displayName : ' Testing: PyTorch doctests'
100+ condition : eq(variables['continue'], '1')
76101
77102 - bash : python -m coverage run --source pytorch_lightning -m pytest --ignore benchmarks -v --junitxml=$(Build.StagingDirectory)/test-results.xml --durations=50
78- displayName : ' Testing: PyTorch standard'
103+ env :
104+ PL_RUN_CUDA_TESTS : " 1"
79105 workingDirectory : tests/tests_pytorch
106+ displayName : ' Testing: PyTorch standard'
107+ timeoutInMinutes : " 35"
108+ condition : eq(variables['continue'], '1')
80109
81110 - bash : bash run_standalone_tests.sh
82111 workingDirectory : tests/tests_pytorch
83112 env :
84113 PL_USE_MOCKED_MNIST : " 1"
114+ PL_RUN_CUDA_TESTS : " 1"
85115 displayName : ' Testing: PyTorch standalone tests'
116+ timeoutInMinutes : " 35"
117+ condition : eq(variables['continue'], '1')
86118
87119 - bash : |
88120 python -m coverage report
@@ -92,13 +124,14 @@ jobs:
92124 ls -l
93125 workingDirectory: tests/tests_pytorch
94126 displayName: 'Statistics'
127+ condition: eq(variables['continue'], '1')
95128
96129 - task : PublishTestResults@2
97130 displayName : ' Publish test results'
98131 inputs :
99132 testResultsFiles : ' $(Build.StagingDirectory)/test-results.xml'
100133 testRunTitle : ' $(Agent.OS) - $(Build.DefinitionName) - Python $(python.version)'
101- condition : succeededOrFailed()
134+ condition : and( succeededOrFailed(), eq(variables['continue'], '1') )
102135
103136 - script : |
104137 set -e
@@ -110,7 +143,11 @@ jobs:
110143 env:
111144 PL_USE_MOCKED_MNIST: "1"
112145 displayName: 'Testing: PyTorch examples'
146+ condition: eq(variables['continue'], '1')
113147
114148 - bash : python -m pytest benchmarks -v --maxfail=2 --durations=0
115149 workingDirectory : tests/tests_pytorch
150+ env :
151+ PL_RUN_CUDA_TESTS : " 1"
116152 displayName : ' Testing: PyTorch benchmarks'
153+ condition : eq(variables['continue'], '1')
0 commit comments