This repository has been archived by the owner on Mar 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
/
build-pr.yml
221 lines (206 loc) · 6.82 KB
/
build-pr.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
pr:
branches:
include:
- '*'
name: PR-$(Date:yyyyMMdd)$(Rev:-r)
variables:
model: 'BasicModel2Epochs'
train: 'True'
more_switches: '--log_level=DEBUG --pl_deterministic'
run_recovery_id: ''
tag: ''
number_of_cross_validation_splits: 0
cluster: 'training-nc12'
# Disable a spurious warning
# https://stackoverflow.com/questions/56859264/publishing-code-coverage-results-from-reportgenerator-not-working
disable.coverage.autogenerate: 'true'
jobs:
- job: CancelPreviousJobs
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: cancel_aml_jobs.yml
- job: CredScan_ComponentGov
pool:
vmImage: 'windows-2019'
steps:
- template: build_windows.yaml
# Run jobs that only build the environment. These jobs have a high chance of succeeding and filling the build
# cache. Pytest, etc legs will only fill the cache if they succeed.
# - job: CreateCondaEnvCache_Windows
# pool:
# vmImage: 'windows-2019'
# steps:
# - template: inner_eye_env.yml
- job: CreateCondaEnvAndCache_Linux
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: inner_eye_env.yml
- job: PyTest
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: build.yaml
- job: TrainInAzureML
dependsOn: CancelPreviousJobs
variables:
- name: tag
value: 'TrainBasicModel'
- name: more_switches
value: '--log_level=DEBUG --pl_deterministic --use_dataset_mount=True --regression_test_folder=RegressionTestResults/PR_BasicModel2Epochs'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_template.yml
parameters:
wait_for_completion: 'True'
max_run_duration: '30m'
- template: tests_after_training.yml
parameters:
pytest_mark: after_training_single_run
test_run_title: tests_after_training_single_run
- job: RunGpuTestsInAzureML
dependsOn: CancelPreviousJobs
variables:
- name: tag
value: 'RunGpuTests'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_template.yml
parameters:
wait_for_completion: 'True'
pytest_mark: 'gpu or cpu_and_gpu or azureml'
max_run_duration: '30m'
- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test-*.xml'
testRunTitle: 'tests_on_AzureML'
condition: succeededOrFailed()
displayName: Publish test results
# Now train a module, using the Github code as a submodule. Here, a simpler 1 channel model
# is trained, because we use this build to also check the "submit_for_inference" code, that
# presently only handles single channel models.
- job: TrainInAzureMLViaSubmodule
dependsOn: CancelPreviousJobs
variables:
- name: model
value: 'BasicModel2Epochs1Channel'
- name: tag
value: 'Train1ChannelSubmodule'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_via_submodule.yml
parameters:
wait_for_completion: 'True'
max_run_duration: '30m'
- template: tests_after_training.yml
parameters:
pytest_mark: "inference or after_training"
test_run_title: tests_after_train_submodule
# Train a 2-element ensemble model
- job: TrainEnsemble
dependsOn: CancelPreviousJobs
variables:
- name: model
value: 'BasicModelForEnsembleTest'
- name: number_of_cross_validation_splits
value: 2
- name: tag
value: 'TrainEnsemble'
- name: more_switches
value: '--pl_deterministic --log_level=DEBUG --regression_test_folder=RegressionTestResults/PR_TrainEnsemble --regression_test_csv_tolerance=1e-5'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_template.yml
parameters:
wait_for_completion: 'True'
pytest_mark: ''
max_run_duration: '1h'
- template: tests_after_training.yml
parameters:
pytest_mark: after_training_ensemble_run
test_run_title: tests_after_training_ensemble_run
# Train a model on 2 nodes
- job: Train2Nodes
dependsOn: CancelPreviousJobs
variables:
- name: model
value: 'BasicModel2EpochsMoreData'
- name: tag
value: 'Train2Nodes'
- name: more_switches
value: '--log_level=DEBUG --pl_deterministic --num_nodes=2 --regression_test_folder=RegressionTestResults/PR_Train2Nodes'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_template.yml
parameters:
wait_for_completion: 'True'
pytest_mark: ''
max_run_duration: '1h'
- template: tests_after_training.yml
parameters:
pytest_mark: after_training_2node
test_run_title: tests_after_training_2node_run
- job: TrainHelloWorld
dependsOn: CancelPreviousJobs
variables:
- name: model
value: 'HelloWorld'
- name: tag
value: 'HelloWorldPR'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_template.yml
parameters:
wait_for_completion: 'True'
pytest_mark: ''
max_run_duration: '30m'
# Run HelloContainer on 2 nodes. HelloContainer uses native Lighting test set inference, which can get
# confused after doing multi-node training in the same script.
- job: TrainHelloContainer
dependsOn: CancelPreviousJobs
variables:
- name: model
value: 'HelloContainer'
- name: tag
value: 'HelloContainerPR'
- name: more_switches
value: '--pl_deterministic --num_nodes=2 --max_num_gpus=2 --regression_test_folder=RegressionTestResults/PR_HelloContainer'
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_template.yml
parameters:
wait_for_completion: 'True'
pytest_mark: ''
max_run_duration: '30m'
- template: tests_after_training.yml
parameters:
pytest_mark: after_training_hello_container
test_run_title: tests_after_training_hello_container
# Run the Lung model. This is a large model requiring a docker image with large memory. This tests against
# regressions in AML when requesting more than the default amount of memory. This needs to run with all subjects to
# trigger the bug, total runtime 10min
- job: TrainLung
dependsOn: CancelPreviousJobs
variables:
- name: model
value: 'Lung'
- name: tag
value: 'LungPR'
- name: more_switches
value: '--pl_deterministic --num_epochs=1 --feature_channels=16 --show_patch_sampling=0 --train_batch_size=4 --inference_on_val_set=False --inference_on_test_set=False '
pool:
vmImage: 'ubuntu-20.04'
steps:
- template: train_template.yml
parameters:
wait_for_completion: 'True'
pytest_mark: ''
max_run_duration: '30m'