-
Notifications
You must be signed in to change notification settings - Fork 29
461 lines (433 loc) · 20.1 KB
/
main.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
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
name: dipu ci
on:
workflow_dispatch:
push:
branches:
- main
- dev_v0.25
pull_request:
env:
CAMB_CI_PATH: '/mnt/lustre/share/parrotsci/github/cibuild/${{ github.repository }}'
CAMB_PARTATION: ${{ vars.CAMB_SLURM_PAR != '' && vars.CAMB_SLURM_PAR || 'camb_mlu370_m8' }}
CAMB_CLUSTER: CAMB
CAMB_TORCH_BASE_DIR: '/mnt/lustre/share/parrotsci/github/cibuild/pytorchbase'
CUDA_CI_PATH: '/mnt/cache/share/parrotsci/github/cibuild/${{ github.repository }}'
CUDA_PARTATION: ${{ vars.SH1988_SLURM_PAR != '' && vars.SH1988_SLURM_PAR || 'pat_rd -x SH-IDC1-10-198-8-60' }}
CUDA_CLUSTER: SH1988
ASCEND_CI_PATH: '/mnt/cache/share/deeplinkci/github/${{ github.repository }}'
ASCEND_CLUSTER: ASCEND
ASCEND_TORCH_DIR: '/mnt/cache/share/platform/cienv/pytorch'
CI_BUILD_FLAG: "ci_build_flag"
PYTORCH_COMMIT: ${{ vars.PYTORCH_COMMIT != '' && vars.PYTORCH_COMMIT || 'c263bd43e8e8502d4726643bc6fd046f0130ac0e' }} # pytorch tag 2.0
ALL_COVERAGE: ${{ (contains( github.ref, 'main') || startsWith(github.ref, 'refs/heads/v') || startsWith(github.ref, 'refs/heads/dev')) && 'ON' || 'OFF' }}
REQUIRE_COVERAGE: ${{ vars.REQUIRE_COVERAGE != '' && vars.REQUIRE_COVERAGE || '40' }}
REPO: ${{ github.event.repository.name }}
concurrency:
group: ${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
Rsync:
name: Rsync code
runs-on: github-poc-ci
steps:
- name: clone repo
run: |
set -ex
cd ${GITHUB_WORKSPACE} && rm -rf DIPU DIPU_DIOPI ${REPO}
if [ -n "${{ github.event.pull_request.head.repo.full_name }}" ] && [[ ! "${{ github.event.pull_request.head.repo.full_name }}" == *DeepLink-org* ]]; then
git clone ${{ github.event.pull_request.head.repo.ssh_url }}
cd ${GITHUB_WORKSPACE}/${{ github.event.repository.name }} && git checkout ${{ github.event.pull_request.head.sha }}
git remote add mainrepo [email protected]:${GITHUB_REPOSITORY}.git
git fetch mainrepo && git merge --no-edit mainrepo/${{ github.base_ref }}
else
git clone https://github.com/DeepLink-org/${REPO}.git && cd ${REPO}
if [ $GITHUB_EVENT_NAME == "pull_request" ]; then
echo "${{ github.base_ref }} "
git checkout ${{ github.event.pull_request.head.sha }} && git merge --no-edit origin/${{ github.base_ref }}
else
echo $GITHUB_EVENT_NAME
git checkout ${{ github.sha }}
fi
fi
cd ${GITHUB_WORKSPACE}/${REPO}/dipu && rm -rf third_party/kineto
git clone --reference /home/autolink/rsync/sourcecode/DeepLink-org/kineto https://github.com/DeepLink-org/kineto.git third_party/kineto
git submodule update --init && cd third_party/kineto && git submodule update --init
cd ${GITHUB_WORKSPACE} && cp -R ${REPO} ${REPO}_DIOPI
cd ${REPO}/dipu && bash /home/autolink/rsync/sourcecode/update_code.sh
rsync -a /home/autolink/rsync/sourcecode/mmlab_pack . && cd mmlab_pack
bash ../scripts/ci/ci_one_iter.sh clone
# dipu_diopi depend on latest target diopi branch, not diopi in submodule. here assume diopi and dipu use same 'target branch' " github.base_ref "
cd ${GITHUB_WORKSPACE}/${REPO}_DIOPI/dipu/third_party && rm -rf DIOPI && git clone https://github.com/DeepLink-org/DIOPI.git
if [ $GITHUB_EVENT_NAME == "pull_request" ]; then
cd ./DIOPI && git checkout ${{ github.base_ref }}
fi
- name: Rsync to Server
run: |
ssh ${CAMB_CLUSTER} "mkdir -p ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/source ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main"
rsync -a --delete ${GITHUB_WORKSPACE}/${REPO}/ ${CAMB_CLUSTER}:${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/source/
rsync -a --delete ${GITHUB_WORKSPACE}/${REPO}_DIOPI/ ${CAMB_CLUSTER}:${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main/
ssh ${CUDA_CLUSTER} "mkdir -p ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/source ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main"
rsync -a --delete ${GITHUB_WORKSPACE}/${REPO}/ ${CUDA_CLUSTER}:${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/source/
rsync -a --delete ${GITHUB_WORKSPACE}/${REPO}_DIOPI/ ${CUDA_CLUSTER}:${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main/
ssh ${ASCEND_CLUSTER} "mkdir -p ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/source ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main"
rsync -a --delete ${GITHUB_WORKSPACE}/${REPO}/ ${ASCEND_CLUSTER}:${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/source/
rsync -a --delete ${GITHUB_WORKSPACE}/${REPO}_DIOPI/ ${ASCEND_CLUSTER}:${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main/
Build-Camb:
name: Build-dipu-camb
needs: [Rsync]
runs-on: github-poc-ci
env:
MLU_REQUESTS: 1
steps:
- name: Build dipu
run: |
ssh ${CAMB_CLUSTER} """
set -ex
export USE_COVERAGE=ON
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && cp -R source ${GITHUB_JOB} && cd ${GITHUB_JOB}/dipu
export PYTORCH_DIR=${CAMB_TORCH_BASE_DIR}/${PYTORCH_COMMIT}
source scripts/ci/camb/ci_camb_env.sh
rsync -a /mnt/lustre/share_data/PAT/datasets/huggingface mmlab_pack/
srun --job-name=${GITHUB_JOB} --partition=${CAMB_PARTATION} --time=40 \
--gres=mlu:${MLU_REQUESTS} bash scripts/ci/camb/ci_camb_script.sh build_dipu \
|| ( cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 )
"""
Test-Camb:
name: Test-dipu-camb
needs: [Build-Camb]
runs-on: github-poc-ci
env:
MLU_REQUESTS: 1
steps:
- name: Run-test
run: |
ssh ${CAMB_CLUSTER} """
set -ex
export USE_COVERAGE=ON
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/ && cd Build-Camb/dipu
export PYTORCH_DIR=${CAMB_TORCH_BASE_DIR}/${PYTORCH_COMMIT}
source scripts/ci/camb/ci_camb_env.sh
srun --job-name=${GITHUB_JOB} --partition=${CAMB_PARTATION} --time=40 --gres=mlu:${MLU_REQUESTS} sh tests/run_camb_tests.sh
if [ "${ALL_COVERAGE}" = "ON" ]; then
sh /mnt/lustre/share/platform/dep/sonar/coverage_DIPU_camb.sh ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Camb ${GITHUB_RUN_NUMBER} || echo "get coverage fail"
fi
"""
- name: increment coverage check
if: ${{ contains( github.event_name, 'pull_request' ) && contains( github.base_ref, 'main' ) }}
run: |
ssh ${CAMB_CLUSTER} """
set -e
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Camb
rm -rf scripts
ln -s ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main/dipu/third_party/DIOPI/scripts scripts
source /mnt/cache/share/platform/env/camb_ci_diopi_impl
bash scripts/increment_coverage.sh ${REQUIRE_COVERAGE}
"""
Test-One-Iter-Camb:
name: Test-one-iter-camb
needs: [Build-Camb]
runs-on: github-poc-ci
env:
MLU_REQUESTS: 1
steps:
- name: build-some-env
run: |
ssh ${CAMB_CLUSTER} """
set -ex
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Camb/dipu
export PYTORCH_DIR=${CAMB_TORCH_BASE_DIR}/${PYTORCH_COMMIT}
echo "pytorch dir: \${PYTORCH_DIR}"
source scripts/ci/camb/ci_camb_env.sh
basic_path=${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Camb/dipu/mmlab_pack
export PYTHONPATH=\${basic_path}/mmengine:\$PYTHONPATH
export PYTHONPATH=\${basic_path}/mmcv:\$PYTHONPATH
export PYTHONPATH=\${pwd}:\$PYTHONPATH
cd mmlab_pack
srun --job-name=${GITHUB_RUN_NUMBER}_${GITHUB_JOB} --partition=${CAMB_PARTATION} --gres=mlu:${MLU_REQUESTS} sh ../scripts/ci/ci_one_iter.sh build_camb
"""
- name: run-one-iter-tools
run: |
ssh ${CAMB_CLUSTER} """
set -ex
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Camb/dipu
export PYTORCH_DIR=${CAMB_TORCH_BASE_DIR}/${PYTORCH_COMMIT}
echo "pytorch dir: \${PYTORCH_DIR}"
source scripts/ci/camb/ci_camb_env.sh
basic_path=${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Camb/dipu/mmlab_pack
source scripts/ci/ci_one_iter.sh export_pythonpath_camb \${basic_path}
cd mmlab_pack
rm -rf one_iter_data
python ../scripts/ci/ci_run_one_iter.py camb ${GITHUB_JOB} "mlu:${MLU_REQUESTS}" ${CAMB_PARTATION} && rm -rf one_iter_data || (rm -rf one_iter_data && exit 1)
"""
- name: Perform cleanup one iter data
if: always()
run: |
ssh ${CAMB_CLUSTER} """
set -ex
echo "${GITHUB_RUN_NUMBER}_${GITHUB_JOB}"
scancel -n "${GITHUB_RUN_NUMBER}_${GITHUB_JOB}"
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Camb/dipu/mmlab_pack
rm -rf one_iter_data
touch one_iter_data #用于占位,防止创建新的one_iter_data文件夹
"""
- name: Check for failure
if: ${{ failure() }}
run: exit 1
Build-Camb-Latest-Target:
name: Build-dipu-camb-latest-target
needs: [Rsync]
runs-on: github-poc-ci
env:
MLU_REQUESTS: 1
steps:
- name: Build dipu diopi-latest-target
run: |
ssh ${CAMB_CLUSTER} """
set -ex
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && cp -R source-main ${GITHUB_JOB} && cd ${GITHUB_JOB}/dipu
export PYTORCH_DIR=${CAMB_TORCH_BASE_DIR}/${PYTORCH_COMMIT}
source scripts/ci/camb/ci_camb_env.sh
srun --job-name=${GITHUB_JOB} --partition=${CAMB_PARTATION} --time=40 \
--gres=mlu:${MLU_REQUESTS} bash scripts/ci/camb/ci_camb_script.sh build_dipu \
|| ( cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 )
"""
Test-Camb-Latest-Target:
name: Test-dipu-camb-latest-target
needs: [Build-Camb-Latest-Target]
runs-on: github-poc-ci
env:
MLU_REQUESTS: 1
steps:
- name: Run-test
run: |
ssh ${CAMB_CLUSTER} """
set -ex
cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/ && cd Build-Camb-Latest-Target/dipu
export PYTORCH_DIR=${CAMB_TORCH_BASE_DIR}/${PYTORCH_COMMIT}
source scripts/ci/camb/ci_camb_env.sh
srun --job-name=${GITHUB_JOB} --partition=${CAMB_PARTATION} --time=40 --gres=mlu:${MLU_REQUESTS} sh tests/run_camb_tests.sh && rm -rf Build-Camb-Diopi \
|| ( cd ${CAMB_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf Build-Camb-Latest-Target && exit 1 )
"""
Build-Cuda:
name: Build-dipu-cuda
needs: [Rsync]
runs-on: github-poc-ci
env:
GPU_REQUESTS: 1
steps:
- name: Build dipu
run: |
ssh ${CUDA_CLUSTER} """
set -e
export USE_COVERAGE=ON
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R source ${GITHUB_JOB} && cd ${GITHUB_JOB}/dipu
source scripts/ci/nv/ci_nv_env.sh
rsync -a /mnt/lustre/share_data/PAT/datasets/huggingface mmlab_pack/
srun --job-name=${GITHUB_RUN_NUMBER}_${GITHUB_JOB} --partition=${CUDA_PARTATION} --gres=gpu:${GPU_REQUESTS} --time=30 bash scripts/ci/nv/ci_nv_script.sh build_dipu \
|| ( cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 )
"""
Test-Cuda:
name: Test-dipu-cuda
needs: [Build-Cuda]
runs-on: github-poc-ci
env:
GPU_REQUESTS: 1
steps:
- name: Run-test
run: |
ssh ${CUDA_CLUSTER} """
set -ex
export USE_COVERAGE=ON
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && cd Build-Cuda/dipu
source scripts/ci/nv/ci_nv_env.sh
srun --job-name=${GITHUB_RUN_NUMBER}_${GITHUB_JOB} --partition=${CUDA_PARTATION} --gres=gpu:${GPU_REQUESTS} --cpus-per-task=5 --mem=16G --time=70 sh tests/run_nv_tests.sh
if [ "${ALL_COVERAGE}" = "ON" ]; then
bash /mnt/cache/share/platform/dep/sonar/coverage_DIPU_nv.sh ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Cuda ${GITHUB_RUN_NUMBER} || echo "get coverage fail"
fi
"""
- name: increment coverage check
if: ${{ contains( github.event_name, 'pull_request' ) && contains( github.base_ref, 'main' ) }}
run: |
ssh ${CUDA_CLUSTER} """
set -e
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Cuda/
rm -rf scripts
ln -s ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/source-main/dipu/third_party/DIOPI/scripts scripts
source /mnt/cache/share/platform/env/pt2.0_diopi
bash scripts/increment_coverage.sh ${REQUIRE_COVERAGE}
"""
Test-One-Iter_Cuda:
name: Test-one-iter-cuda
needs: [Build-Cuda]
runs-on: github-poc-ci
env:
GPU_REQUESTS: 1
steps:
- name: build some env
run: |
ssh ${CUDA_CLUSTER} """
set -ex
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && cd Build-Cuda/dipu
source scripts/ci/nv/ci_nv_env.sh
basic_path=${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Cuda/dipu/mmlab_pack
export PYTHONPATH=\${basic_path}/mmengine:\$PYTHONPATH
export PYTHONPATH=\${basic_path}/mmcv:\$PYTHONPATH
export PYTHONPATH=\${pwd}:\$PYTHONPATH
cd mmlab_pack
srun --job-name=${GITHUB_RUN_NUMBER}_${GITHUB_JOB} --partition=${CUDA_PARTATION} --gres=gpu:${GPU_REQUESTS} --time=20 bash ../scripts/ci/ci_one_iter.sh build_cuda
"""
- name: run-one-iter-tools
run: |
ssh ${CUDA_CLUSTER} """
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && cd Build-Cuda/dipu
source scripts/ci/nv/ci_nv_env.sh
basic_path=${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Cuda/dipu/mmlab_pack
source scripts/ci/ci_one_iter.sh export_pythonpath_cuda \${basic_path}
cd mmlab_pack
rm -rf one_iter_data
python ../scripts/ci/ci_run_one_iter.py cuda ${GITHUB_RUN_NUMBER}_${GITHUB_JOB} "gpu:${GPU_REQUESTS}" ${CUDA_PARTATION} && rm -rf one_iter_data || (rm -rf one_iter_data && exit 1)
"""
- name: Perform cleanup one iter data
if: always()
run: |
ssh ${CUDA_CLUSTER} """
set -ex
echo "${GITHUB_RUN_NUMBER}_${GITHUB_JOB}"
scancel -n "${GITHUB_RUN_NUMBER}_${GITHUB_JOB}"
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Cuda/dipu/mmlab_pack
rm -rf one_iter_data
touch one_iter_data #用于占位,防止创建新的one_iter_data文件夹
"""
- name: Check for failure
if: ${{ failure() }}
run: exit 1
Build-Cuda-Latest-Target:
name: Build-dipu-cuda-latest-target
needs: [Rsync]
runs-on: github-poc-ci
env:
GPU_REQUESTS: 1
steps:
- name: Build dipu diopi-latest-target
run: |
ssh ${CUDA_CLUSTER} """
set -ex
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER} && rm -rf ${GITHUB_JOB} && cp -R source-main ${GITHUB_JOB} && cd ${GITHUB_JOB}/dipu
source scripts/ci/nv/ci_nv_env.sh
srun --job-name=${GITHUB_RUN_NUMBER}_${GITHUB_JOB} --partition=${CUDA_PARTATION} --gres=gpu:${GPU_REQUESTS} --cpus-per-task=5 --mem=16G --time=30 bash scripts/ci/nv/ci_nv_script.sh build_dipu \
|| ( cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 )
"""
Test-Cuda-Latest-Target:
name: Test-dipu-cuda-latest-target
needs: [Build-Cuda-Latest-Target]
runs-on: github-poc-ci
env:
GPU_REQUESTS: 1
steps:
- name: Run-test
run: |
ssh ${CUDA_CLUSTER} """
set -ex
cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && cd Build-Cuda-Latest-Target/dipu
source scripts/ci/nv/ci_nv_env.sh
srun --job-name=${GITHUB_RUN_NUMBER}_${GITHUB_JOB} --partition=${CUDA_PARTATION} --gres=gpu:${GPU_REQUESTS} --cpus-per-task=5 --mem=16G --time=60 sh tests/run_nv_tests.sh && cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf Build-Cuda-Latest-Target \
|| ( cd ${CUDA_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 )
"""
Build-PyTorch-For-Ascend:
name: Build-dipu-pytorch-for-ascend
needs: [Rsync]
runs-on: tps-ascend-ci
steps:
- name: Build PyTorch
run: |
set -ex
cd ${ASCEND_TORCH_DIR}
if [ "$(git rev-parse HEAD)" != "${PYTORCH_COMMIT}" ]; then
rm -rf build
fi
if [ ! -d "build" ]; then
source ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/source/dipu/scripts/ci/ascend/ci_ascend_env.sh
export CMAKE_PREFIX_PATH=${CONDA_PREFIX:-"$(dirname $(which conda))/../"}
BUILD_BINARY=0 USE_PRECOMPILED_HEADERS=1 BUILD_TEST=0 USE_CUDA=0 python setup.py build_ext -i || (rm -rf build && exit 1)
fi
Build-Ascend:
name: Build-dipu-ascend
needs: [Build-PyTorch-For-Ascend]
runs-on: tps-ascend-ci
steps:
- name: Build dipu
run: |
set -ex
cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && cp -R source ${GITHUB_JOB} && cd ${GITHUB_JOB}/dipu
source scripts/ci/ascend/ci_ascend_env.sh
bash scripts/ci/ascend/ci_ascend_script.sh build_dipu \
|| ( cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 )
Test-Ascend:
name: Test-dipu-ascend
needs: [Build-Ascend]
runs-on: tps-ascend-ci
steps:
- name: Run a test
run: |
set -ex
cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Ascend/dipu
source scripts/ci/ascend/ci_ascend_env.sh
bash tests/run_ascend_tests.sh
Test-One-Iter-Ascend:
name: Test-one-iter-ascend
needs: [Build-Ascend]
runs-on: tps-ascend-ci
steps:
- name: Build some env
run: |
set -ex
cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Ascend/dipu
source scripts/ci/ascend/ci_ascend_env.sh
basic_path=${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Ascend/dipu/mmlab_pack
source scripts/ci/ci_one_iter.sh export_pythonpath_ascend ${basic_path}
cd mmlab_pack
bash ../scripts/ci/ci_one_iter.sh build_ascend
- name: Run one iter tools
run: |
set -ex
cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Ascend/dipu
source scripts/ci/ascend/ci_ascend_env.sh
basic_path=${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Ascend/dipu/mmlab_pack
source scripts/ci/ci_one_iter.sh export_pythonpath_ascend ${basic_path}
cd mmlab_pack
rm -rf one_iter_data
python ../scripts/ci/ci_run_one_iter.py ascend "" "" "" && rm -rf one_iter_data || (rm -rf one_iter_data && exit 1)
- name: Perform cleanup one iter data
if: always()
run: |
set -ex
cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Ascend/dipu/mmlab_pack
rm -rf one_iter_data
touch one_iter_data #用于占位,防止创建新的one_iter_data文件夹
- name: Check for failure
if: ${{ failure() }}
run: exit 1
Build-Ascend-Latest-Target:
name: Build-dipu-ascend-latest-target
needs: [Build-PyTorch-For-Ascend]
runs-on: tps-ascend-ci
steps:
- name: Build dipu diopi-latest-target
run: |
set -ex
cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && cp -R source-main ${GITHUB_JOB} && cd ${GITHUB_JOB}/dipu
source scripts/ci/ascend/ci_ascend_env.sh
bash scripts/ci/ascend/ci_ascend_script.sh build_dipu \
|| ( cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf ${GITHUB_JOB} && exit 1 )
Test-Ascend-Latest-Target:
name: Test-dipu-ascend-latest-target
needs: [Build-Ascend-Latest-Target]
runs-on: tps-ascend-ci
steps:
- name: Run a test
run: |
set -ex
cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/Build-Ascend-Latest-Target/dipu
source scripts/ci/ascend/ci_ascend_env.sh
bash tests/run_ascend_tests.sh && cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf Build-Ascend-Latest-Target \
|| ( cd ${ASCEND_CI_PATH}/${GITHUB_RUN_NUMBER}/ && rm -rf Build-Ascend-Latest-Target && exit 1 )