-
Notifications
You must be signed in to change notification settings - Fork 6k
668 lines (634 loc) · 27.2 KB
/
H-Coverage.yml
File metadata and controls
668 lines (634 loc) · 27.2 KB
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
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
name: CI-H
on:
pull_request:
types: [opened, synchronize]
branches: [develop, release/**]
permissions: read-all
concurrency:
group: ${{ github.event.pull_request.number }}-${{ github.workflow }}
cancel-in-progress: true
env:
PR_ID: ${{ github.event.pull_request.number }}
COMMIT_ID: ${{ github.event.pull_request.head.sha }}
TASK: paddle-CI-${{ github.event.pull_request.number }}-coverage
ci_scripts: /paddle/ci
BRANCH: ${{ github.base_ref }}
work_dir: /paddle
PADDLE_ROOT: /paddle
GIT_PR_ID: ${{ github.event.pull_request.number }}
CI_name: h-coverage
CFS_DIR: /home/data/cfs
no_proxy: "bcebos.com,apiin.im.baidu.com,gitee.com,aliyun.com,.baidu.com,.tuna.tsinghua.edu.cn"
fleet_branch: "release/0.2"
defaults:
run:
shell: bash
jobs:
clone:
name: Coverage clone
uses: ./.github/workflows/_Clone-linux.yml
with:
workflow-name: "coverage"
clone_dir: h-ci
check-bypass:
name: Check bypass
needs: [clone]
if: needs.clone.outputs.can-skip != 'true'
uses: ./.github/workflows/check-bypass.yml
with:
workflow-name: h-ci
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
build:
name: Coverage build
needs: [clone, check-bypass]
if: needs.clone.outputs.can-skip != 'true' && needs.check-bypass.outputs.can-skip != 'true'
runs-on:
group: GZ_BD-CPU
timeout-minutes: 120
outputs:
can-skip: ${{ needs.check-bypass.outputs.can-skip }}
steps:
- name: Check docker image and run container
env:
CACHE_DIR: "/root/.cache/coverage"
CCACHE_DIR: "/home/data/shared/.ccache/l1" # L1 cache on machine shared dir
CCACHE_SECONDARY_STORAGE: "file:///home/data/cfs/.ccache/l2" # L2 cache on cfs
FLAGS_fraction_of_gpu_memory_to_use: 0.15
CTEST_PARALLEL_LEVEL: 2
WITH_GPU: "ON"
CUDA_ARCH_NAME: Hopper
WITH_AVX: "ON"
PADDLE_VERSION: 0.0.0
CUDA_VISIBLE_DEVICES: 0,1
WITH_DISTRIBUTE: "ON"
LITE_GIT_TAG: develop
WITH_UNITY_BUILD: "ON"
WITH_FA_BUILD_WITH_CACHE: "ON"
PY_VERSION: "3.10"
INFERENCE_DEMO_INSTALL_DIR: /root/.cache/coverage
CCACHE_MAXSIZE: 50G
CCACHE_LIMIT_MULTIPLE: 0.8
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
container_name=${TASK}-build-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker_image=ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:cuda129-coverage-test
docker run -d -t --name ${container_name} \
-v "/home/data/cfs:/home/data/cfs" \
-v "/home/data/cfs/.cache:/root/.cache" \
-v "/home/data/shared:/home/data/shared" \
-v "/dev/shm:/dev/shm" \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}:/paddle \
-e CI_name \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
-e work_dir \
-e PADDLE_ROOT \
-e GIT_PR_ID \
-e CACHE_DIR \
-e CCACHE_DIR \
-e CCACHE_SECONDARY_STORAGE \
-e ci_scripts \
-e FLAGS_fraction_of_gpu_memory_to_use \
-e CTEST_PARALLEL_LEVEL \
-e WITH_GPU \
-e CUDA_ARCH_NAME \
-e WITH_AVX \
-e PADDLE_VERSION \
-e WITH_DISTRIBUTE \
-e LITE_GIT_TAG \
-e WITH_UNITY_BUILD \
-e WITH_FA_BUILD_WITH_CACHE \
-e PY_VERSION \
-e INFERENCE_DEMO_INSTALL_DIR \
-e CCACHE_MAXSIZE \
-e CCACHE_LIMIT_MULTIPLE \
-e GITHUB_TOKEN \
-e GITHUB_API_TOKEN \
-e CFS_DIR \
-e no_proxy \
-w /paddle --network host ${docker_image}
- name: Download paddle.tar.gz and update test branch
timeout-minutes: 30
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
rm -rf * .[^.]*
set -e
echo "Downloading Paddle.tar.gz"
wget -q --tries=5 --no-proxy https://paddle-github-action.bj.bcebos.com/PR/h-ci/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
echo "Extracting Paddle.tar.gz"
tar -xf Paddle.tar.gz --strip-components=1
rm Paddle.tar.gz
git config --global --add safe.directory "*"
git remote -v
set +e
git remote add upstream https://github.com/PaddlePaddle/Paddle.git
set -e
git config pull.rebase false
git checkout test
echo "Pull upstream $BRANCH"
source ${{ github.workspace }}/../../../proxy
bash ci/git_pull.sh $BRANCH
git submodule update
'
- name: Build
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
flashattn_version=$(git submodule status|grep flashattn|awk "{print \$1}"|sed "s#-##g")
echo flashattn_version:$flashattn_version
url="https://xly-devops.bj.bcebos.com/gpups/flash-attention/cu90/flashattn_libs_${flashattn_version}.tar"
echo url:$url
url_return=`curl -s -o /dev/null -w "%{http_code}" $url`
if [ "$url_return" != "200" ];then
echo "flashattn cache not found, please contact umiswing"
exit 7
fi
mkdir -p ${CFS_DIR}/.cache/coverage
mkdir -p ${CFS_DIR}/.ccache/coverage
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda-12.9/compat
source ${{ github.workspace }}/../../../proxy
bash ${ci_scripts}/cmake-predownload.sh
pip install -r python/requirements.txt
mkdir -p build && cd build
ccache -z
cmake .. -DPY_VERSION=3.10 -DWITH_GPU=ON -DWITH_DISTRIBUTE=ON -DWITH_TESTING=ON -DCUDA_ARCH_NAME=Manual -DCUDA_ARCH_BIN="90" -DFA_JOB_POOLS_COMPILE=1 -DWITH_CUDNN_FRONTEND=ON -DON_INFER=OFF -DWITH_NVSHMEM=ON
make -j20
EXIT_CODE=$?
ccache -s
exit $EXIT_CODE
'
- name: Clean up env
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
source ~/.bashrc
source ${ci_scripts}/utils.sh; clean_build_files
rm -rf $(find . -name "*.a")
rm -rf $(find . -name "*.o")
rm -rf lib.linux-x86_64-3.9
find ./ -name "eager_generator" -or -name "kernel_signature_generator" -or -name "eager_legacy_op_function_generator" | xargs rm -rf
rm -rf ./python/build/lib.linux-x86_64-3.9/
cd "${work_dir}/build/third_party" && find $(ls | grep -v "dlpack" | grep -v "install" | grep -v "eigen3" | grep -v "gflags") -type f ! -name "*.so" -a ! -name "libdnnl.so*" -delete
cd /
tar --use-compress-program="pzstd -1" -cf Paddle.tar.gz paddle
'
- name: Upload coverage product
env:
home_path: ${{ github.workspace }}/..
bos_file: ${{ github.workspace }}/../bos_retry/BosClient.py
paddle_whl: paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
echo "::group::Install bce-python-sdk"
python -m pip install bce-python-sdk==0.8.74
echo "::endgroup::"
export AK=paddle
export SK=paddle
if [ ! -f "${{ env.bos_file }}" ]; then
wget -q --no-proxy -O ${{ env.home_path }}/bos_retry.tar.gz https://xly-devops.bj.bcebos.com/home/bos_retry.tar.gz --no-check-certificate
mkdir ${{ env.home_path }}/bos_retry
tar xf ${{ env.home_path }}/bos_retry.tar.gz -C ${{ env.home_path }}/bos_retry
fi
cd /paddle
mv /Paddle.tar.gz .
cp ./build/python/dist/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl .
echo "Uploading Paddle.tar.gz"
python ${{ env.bos_file }} Paddle.tar.gz paddle-github-action/PR/h-coverage/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
echo "Uploading coverage wheel"
python ${{ env.bos_file }} ${{ env.paddle_whl }} paddle-github-action/PR/h-coverage/${{ env.PR_ID }}/${{ env.COMMIT_ID }}
echo "End Upload"
'
- name: Terminate and delete the container
if: always()
run: |
set +e
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
docker stop ${{ env.container_name }}
docker rm ${{ env.container_name }}
test:
name: Coverage test
needs: [build]
if: needs.build.outputs.can-skip != 'true'
runs-on:
group: H-Coverage
timeout-minutes: 120
steps:
- name: Determine the runner
run: |
runner_name=`(echo $PWD|awk -F '/' '{print $3}')`
echo $runner_name
wget -q https://xly-devops.bj.bcebos.com/utils.sh
source utils.sh
determine_gpu_runner ${runner_name}
- name: Check docker image and run container
env:
CACHE_DIR: "/root/.cache/coverage"
CCACHE_DIR: "/root/.ccache/coverage"
FLAGS_fraction_of_gpu_memory_to_use: 0.15
CTEST_PARALLEL_LEVEL: 2
WITH_GPU: "ON"
CUDA_ARCH_NAME: Hopper
WITH_AVX: "ON"
COVERALLS_UPLOAD: "ON"
PADDLE_VERSION: 0.0.0
WITH_DISTRIBUTE: "ON"
WITH_UNITY_BUILD: "ON"
PY_VERSION: "3.10"
WITH_SHARED_PHI: "ON"
GPU_DEVICES: ${{ env.GPU_DEVICES }}
WITH_CINN: "ON"
INFERENCE_DEMO_INSTALL_DIR: /root/.cache/coverage
CCACHE_MAXSIZE: 200G
CCACHE_LIMIT_MULTIPLE: 0.8
FLAGS_PIR_OPTEST: "TRUE"
ON_INFER: "ON"
COVERAGE_FILE: ${{ github.workspace }}/build/python-coverage.data
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker_image=ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:cuda129-coverage-test
docker run -d -t --gpus "\"device=${GPU_DEVICES}\"" --name ${container_name} \
-v "/home/data/cfs:/home/data/cfs" \
-v "/home/data/cfs/.cache:/root/.cache" \
-v "/home/data/cfs/.ccache:/root/.ccache" \
-v "/dev/shm:/dev/shm" \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}:/paddle \
-e CI_name \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
-e work_dir \
-e PADDLE_ROOT \
-e GIT_PR_ID \
-e CACHE_DIR \
-e CCACHE_DIR \
-e ci_scripts \
-e FLAGS_fraction_of_gpu_memory_to_use \
-e CTEST_PARALLEL_LEVEL \
-e WITH_GPU \
-e CUDA_ARCH_NAME \
-e WITH_AVX \
-e WITH_COVERAGE \
-e COVERALLS_UPLOAD \
-e PADDLE_VERSION \
-e WITH_DISTRIBUTE \
-e WITH_UNITY_BUILD \
-e PY_VERSION \
-e WITH_SHARED_PHI \
-e WITH_CINN \
-e INFERENCE_DEMO_INSTALL_DIR \
-e CCACHE_MAXSIZE \
-e CCACHE_LIMIT_MULTIPLE \
-e FLAGS_PIR_OPTEST \
-e ON_INFER \
-e COVERAGE_FILE \
-e GITHUB_TOKEN \
-e GITHUB_API_TOKEN \
-e CFS_DIR \
-e no_proxy \
-w /paddle --network host ${docker_image}
- name: Download paddle.tar.gz and update test branch
timeout-minutes: 30
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
rm -rf * .[^.]*
set -e
echo "Downloading Paddle.tar.gz from cfs"
wget -q --tries=5 --no-proxy https://paddle-github-action.bj.bcebos.com/PR/h-coverage/${PR_ID}/${COMMIT_ID}/Paddle.tar.gz --no-check-certificate
echo "Extracting Paddle.tar.gz"
tar --use-compress-program="pzstd -1" -xf Paddle.tar.gz --strip-components=1
rm Paddle.tar.gz
'
- name: Test
id: unit_test
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
source ${{ github.workspace }}/../../../proxy
pip install build//python/dist/*.whl --no-deps
pip install -r python/unittest_py/requirements.txt
bash $ci_scripts/h-test.sh
'
- name: FA Test
if: (success() || failure()) && steps.unit_test.conclusion != 'skipped'
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
source ${{ github.workspace }}/../../../proxy
cd test/test_flashmask_ci
bash run.sh
'
- name: Terminate and delete the container
if: always()
run: |
set +e
rm Paddle.tar.gz
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
docker stop ${{ env.container_name }}
docker rm ${{ env.container_name }}
fleet-build:
name: Build Fleet whl
needs: [build]
if: needs.build.outputs.can-skip != 'true'
runs-on:
group: GZ_BD-CPU
timeout-minutes: 60
env:
TASK: fleet-ci-paddle-build-whl-${{ github.event.pull_request.number }}
docker_image: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:cuda129-coverage-test"
steps:
- name: Check docker image and run container
env:
CCACHE_DIR: "/home/data/shared/.ccache/l1" # L1 cache on machine shared dir
CCACHE_SECONDARY_STORAGE: "file:///home/data/cfs/.ccache/l2" # L2 cache on cfs
CCACHE_MAXSIZE: 50G
CCACHE_LIMIT_MULTIPLE: 0.8
CCACHE_STATSLOG: /paddle/build/.stats.log
CCACHE_SLOPPINESS: clang_index_store,time_macros,include_file_mtime
run: |
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker pull $docker_image
docker run -d -t --name ${container_name} \
-v "/dev/shm:/dev/shm" \
-v "/home/data/cfs:/home/data/cfs" \
-v "/home/data/shared:/home/data/shared" \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}:/paddle \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
-e PADDLE_ROOT \
-e ci_scripts \
-e no_proxy \
-e fleet_branch \
-e CI_name \
-e CCACHE_DIR \
-e CCACHE_SECONDARY_STORAGE \
-e CCACHE_MAXSIZE \
-e CCACHE_LIMIT_MULTIPLE \
-e CCACHE_STATSLOG \
-e CCACHE_SLOPPINESS \
-w /paddle --network host ${docker_image}
- name: uv build whl
run: |
docker exec -t ${{ env.container_name }} /bin/bash -ce '
rm -rf * .[^.]*
set -x
source ${{ github.workspace }}/../../../proxy
git clone https://github.com/PaddlePaddle/PaddleFleet.git .
git config --global --add safe.directory /paddle
git config user.name "PaddleCI"
git config user.email "paddle_ci@example.com"
git config pull.rebase false
if [ "${BRANCH}" != "develop" ]; then
git checkout $fleet_branch
echo "Checked out fleet branch: $fleet_branch"
else
git checkout develop
echo "Checked out fleet branch: develop"
fi
mkdir -p /home/.cache/pip
pip cache dir
echo "Install uv"
export UV_HTTP_TIMEOUT=300
pip install uv coverage==7.6.1 bce-python-sdk==0.8.74 wrapt
echo "uv build"
git submodule update --init --recursive
export LD_LIBRARY_PATH=/usr/local/cuda-12.9/compat:$LD_LIBRARY_PATH
export IS_NVIDIA=True
export PADDLEFLEET_VERSION=0.0.0
uv build --wheel -v
'
- name: upload whl to BOS
run: |
docker exec -t ${{ env.container_name }} /bin/bash -ce '
export AK=paddle
export SK=paddle
cd /
if [ ! -f "bos/BosClient.py" ]; then
wget -q --no-proxy -O bos_new.tar.gz https://xly-devops.bj.bcebos.com/home/bos_new.tar.gz --no-check-certificate
mkdir bos
tar xf bos_new.tar.gz -C bos
fi
target_path="paddle-github-action/PR/paddlefleet/${{ env.PR_ID }}/${{ env.COMMIT_ID }}"
tar zcf paddldfleet.tar.gz paddle
python /bos/BosClient.py paddldfleet.tar.gz ${target_path}
'
- name: Terminate and delete the container
if: always()
run: |
set +e
docker exec -t ${{ env.container_name }} /bin/bash -c 'bash ci/clean_uv_cache.sh; rm -rf * .[^.]*'
docker rm -f ${{ env.container_name }}
fleet_single_card_test:
name: Fleet Unit test (single card)
needs: [build, fleet-build]
if: needs.build.outputs.can-skip != 'true'
runs-on:
group: Fleet-H-single-card
timeout-minutes: 60
env:
PIP_CACHE_DIR: /root/.cache/pip
CACHE_DIR: /root/.cache
TASK: paddle-fleet-CI-${{ github.event.pull_request.number }}-single-card-test
steps:
- name: Determine the runner
run: |
gpu_id=$(( $(echo $PWD | awk -F'/' '{print $3}' | awk -F'-' '{print $2}') + 3 ))
echo GPU_DEVICES="$gpu_id" >> $GITHUB_ENV
- name: Check docker image and run container
env:
GPU_DEVICES: ${{ env.GPU_DEVICES }}
docker_image: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:cuda129-coverage-test"
run: |
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker pull $docker_image
docker run -d -t --name ${container_name} --gpus "\"device=${GPU_DEVICES}\"" --shm-size=32G \
-v "/dev/shm:/dev/shm" \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}/../../../proxy:/root/proxy \
-v /ssd1/paddle-1/action_cache:/root/.cache \
-v ${{ github.workspace }}:/paddle \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
-e PADDLE_ROOT \
-e ci_scripts \
-e CACHE_DIR \
-e no_proxy \
-e CI_name \
-e PIP_CACHE_DIR \
-e work_dir \
-e GITHUB_SHA="${{ github.event.pull_request.head.sha }}" \
-e GITHUB_HEAD_REF="${{ github.head_ref }}" \
-e GITHUB_BASE_SHA="${{ github.event.pull_request.base.sha }}" \
-e GITHUB_REPO_NAME="${{ github.repository }}" \
-e GITHUB_EVENT_PULL_REQUEST_NUMBER="${{ github.event.pull_request.number }}" \
-e GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
-e GITHUB_RUN_ID="${{ github.run_id }}" \
-w /paddle --network host ${docker_image}
- name: Install PaddleFleet
run: |
docker exec -t ${{ env.container_name }} /bin/bash -ce '
rm -rf * .[^.]*
source /root/proxy
pip install uv coverage==7.6.1 bce-python-sdk==0.8.74 wrapt
wget -q --tries=5 --no-proxy --no-check-certificate https://paddle-github-action.cdn.bcebos.com/PR/paddlefleet/${PR_ID}/${COMMIT_ID}/paddldfleet.tar.gz
tar -xf paddldfleet.tar.gz --strip-components=1
git config --global --add safe.directory /paddle
pip install dist/paddlefleet-0.0.0-cp310-cp310-linux_x86_64.whl --extra-index-url=https://www.paddlepaddle.org.cn/packages/stable/cu129/ --extra-index-url=https://www.paddlepaddle.org.cn/packages/nightly/cu129/
echo "paddlefleet commit:"
python -c "import paddlefleet; print(paddlefleet.version.commit)"
'
- name: Download paddle.tar.gz and install paddle whl
timeout-minutes: 30
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
set -e
mkdir -p /PaddlePaddle
cd /PaddlePaddle
echo "Downloading Paddle.tar.gz from cfs"
wget -q --tries=5 --no-proxy https://paddle-github-action.bj.bcebos.com/PR/h-coverage/${PR_ID}/${COMMIT_ID}/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl --no-check-certificate
export UV_SKIP_WHEEL_FILENAME_CHECK=1 #This environment variable allows installing the latest commit-level whl package of Paddle.
export UV_NO_SYNC=1 # This environment variable prevents uv sync from being executed when running un run.
export UV_HTTP_TIMEOUT=300
pip uninstall paddlepaddle-gpu -y
pip install paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl --force-reinstall --extra-index-url=https://www.paddlepaddle.org.cn/packages/nightly/cu129/
'
- name: Single card test
run: |
docker exec -t ${{ env.container_name }} /bin/bash -xce '
pwd
if [ "${BRANCH}" != "develop" ]; then
git checkout $fleet_branch
echo "Checked out fleet branch: $fleet_branch"
else
git checkout develop
echo "Checked out fleet branch: develop"
fi
export UV_SKIP_WHEEL_FILENAME_CHECK=1 #This environment variable allows installing the latest commit-level whl package of Paddle.
export UV_NO_SYNC=1 # This environment variable prevents uv sync from being executed when running un run.
export UV_HTTP_TIMEOUT=300
python -c "import paddle; print(paddle.version.commit)"
timeout 15m bash ci/single_card_test.sh
single_card_exit_code=$?
if [[ "$single_card_exit_code" != "0" ]]; then
echo -e "::error:: \033[31mSingle card test failed.\033[0m"
exit 1
else
echo -e "\033[32mSingle card test succeeded.\033[0m"
fi
'
- name: Terminate and delete the container
if: always()
run: |
set +e
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
docker rm -f ${{ env.container_name }}
fleet-multi-card_test:
name: Fleet Unit test (multi-card)
needs: [build, fleet-build]
if: needs.build.outputs.can-skip != 'true'
runs-on:
group: Fleet-H-multi-card
timeout-minutes: 60
env:
PIP_CACHE_DIR: /root/.cache/pip
TASK: paddle-fleet-CI-${{ github.event.pull_request.number }}-multi-card_test
docker_image: "ccr-2vdh3abv-pub.cnc.bj.baidubce.com/paddlepaddle/paddle:cuda129-coverage-test"
steps:
- name: Check docker image and run container
run: |
container_name=${TASK}-$(date +%Y%m%d-%H%M%S)
echo "container_name=${container_name}" >> ${{ github.env }}
docker pull $docker_image
docker run -d -t --gpus all --name ${container_name} \
-v "/dev/shm:/dev/shm" \
-v ${{ github.workspace }}/../../..:${{ github.workspace }}/../../.. \
-v ${{ github.workspace }}/../../../proxy:/root/proxy \
-v ${{ github.workspace }}/../../../.cache:/root/.cache \
-v ${{ github.workspace }}:/paddle \
-e BRANCH \
-e PR_ID \
-e COMMIT_ID \
-e PADDLE_ROOT \
-e ci_scripts \
-e CACHE_DIR \
-e fleet_branch \
-e no_proxy \
-e CI_name \
-e PIP_CACHE_DIR \
-e work_dir \
-e GITHUB_SHA="${{ github.event.pull_request.head.sha }}" \
-e GITHUB_HEAD_REF="${{ github.head_ref }}" \
-e GITHUB_BASE_SHA="${{ github.event.pull_request.base.sha }}" \
-e GITHUB_REPO_NAME="${{ github.repository }}" \
-e GITHUB_EVENT_NAME="${{ github.event_name }}" \
-e GITHUB_EVENT_PULL_REQUEST_NUMBER="${{ github.event.pull_request.number }}" \
-e GITHUB_TOKEN="${{ secrets.GITHUB_TOKEN }}" \
-e GITHUB_RUN_ID="${{ github.run_id }}" \
-w /paddle --network host ${docker_image}
- name: Install PaddleFleet
run: |
docker exec -t ${{ env.container_name }} /bin/bash -ce '
rm -rf * .[^.]*
source /root/proxy
pip install uv coverage==7.6.1 bce-python-sdk==0.8.74 wrapt
wget -q --tries=5 --no-proxy --no-check-certificate https://paddle-github-action.cdn.bcebos.com/PR/paddlefleet/${PR_ID}/${COMMIT_ID}/paddldfleet.tar.gz
tar -xf paddldfleet.tar.gz --strip-components=1
git config --global --add safe.directory /paddle
pip install dist/paddlefleet-0.0.0-cp310-cp310-linux_x86_64.whl --extra-index-url=https://www.paddlepaddle.org.cn/packages/stable/cu129/ --extra-index-url=https://www.paddlepaddle.org.cn/packages/nightly/cu129/
echo "paddlefleet commit:"
python -c "import paddlefleet; print(paddlefleet.version.commit)"
'
- name: Download paddle.tar.gz and install paddle whl
timeout-minutes: 30
run: |
docker exec -t ${{ env.container_name }} /bin/bash -c '
set -e
mkdir -p /PaddlePaddle
cd /PaddlePaddle
echo "Downloading Paddle.tar.gz from cfs"
wget -q --tries=5 --no-proxy https://paddle-github-action.bj.bcebos.com/PR/h-coverage/${PR_ID}/${COMMIT_ID}/paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl --no-check-certificate
export UV_SKIP_WHEEL_FILENAME_CHECK=1 #This environment variable allows installing the latest commit-level whl package of Paddle.
export UV_NO_SYNC=1 # This environment variable prevents uv sync from being executed when running un run.
export UV_HTTP_TIMEOUT=300
pip uninstall paddlepaddle-gpu -y
pip install paddlepaddle_gpu-0.0.0-cp310-cp310-linux_x86_64.whl --force-reinstall --extra-index-url=https://www.paddlepaddle.org.cn/packages/nightly/cu129/
'
- name: Multi-card test
run: |
docker exec -t ${{ env.container_name }} /bin/bash -ce '
export PYTHONPATH=$(pwd)
if [ "${BRANCH}" != "develop" ]; then
git checkout $fleet_branch
echo "Checked out fleet branch: $fleet_branch"
else
git checkout develop
echo "Checked out fleet branch: develop"
fi
python -c "import paddle; print(paddle.version.commit)"
export UV_SKIP_WHEEL_FILENAME_CHECK=1 #This environment variable allows installing the latest commit-level whl package of Paddle.
export UV_NO_SYNC=1 # This environment variable prevents uv sync from being executed when running un run.
export UV_HTTP_TIMEOUT=300
timeout 20m bash ci/multi-card_test.sh
multi_card_exit_code=$?
if [[ "$multi_card_exit_code" != "0" ]]; then
echo -e "::error:: \033[31mMulti card test failed.\033[0m"
exit 1
else
echo -e "\033[32mMulti card test succeeded.\033[0m"
fi
'
- name: Terminate and delete the container
if: always()
run: |
set +e
docker exec -t ${{ env.container_name }} /bin/bash -c 'rm -rf * .[^.]*'
docker rm -f ${{ env.container_name }}