forked from FlagOpen/FlagGems
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (66 loc) · 2.49 KB
/
python-test.yaml
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: flag-gems-test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
container-unit-test:
runs-on: [self-hosted, docker]
timeout-minutes: 50
container:
image: localhost:5000/flag-gems-ci:v1.0
ports:
- 81
options: --gpus all --hostname flag-gems_cicd_ut
steps:
- name: checkout-code
uses: actions/checkout@v4
- name: unit_test-flag-gems
shell: bash
run: |
cmds=(
"CUDA_VISIBLE_DEVICES=0 pytest -s tests/test_unary_pointwise_ops.py &"
"CUDA_VISIBLE_DEVICES=0 pytest -s tests/test_pointwise_type_promotion.py &"
"CUDA_VISIBLE_DEVICES=1 pytest -s tests/test_binary_pointwise_ops.py &"
"CUDA_VISIBLE_DEVICES=1 pytest -s tests/test_tensor_constructor_ops.py &"
"CUDA_VISIBLE_DEVICES=1 pytest -s tests/test_distribution_ops.py &"
"CUDA_VISIBLE_DEVICES=2 pytest -s tests/test_blas_ops.py &"
"CUDA_VISIBLE_DEVICES=3 pytest -s tests/test_reduction_ops.py &"
"CUDA_VISIBLE_DEVICES=4 pytest -s tests/test_special_ops.py &"
"CUDA_VISIBLE_DEVICES=5 pytest -s tests/test_libentry.py &"
)
declare -a exit_statuses
for cmd in "${cmds[@]}"; do
eval "$cmd"
done
for job in $(jobs -p); do
wait $job
exit_statuses+=($?)
echo "Task $pid completed with exit status ${exit_statuses[-1]}"
done
echo "Exit statuses of all tasks: ${exit_statuses[@]}"
overall_status=0
for status in "${exit_statuses[@]}"; do
if [ $status -ne 0 ]; then
overall_status=1
break
fi
done
exit $overall_status
container-model-test:
runs-on: [self-hosted, docker]
timeout-minutes: 5
container:
image: localhost:5000/flag-gems-ci:v1.0
ports:
- 82
options: --gpus all --hostname flag-gems_cicd_model -v /home/flaggems_cicd/huggingface_cache_bert:/__w/_temp/_github_home/.cache/huggingface
steps:
- name: checkout-code
uses: actions/checkout@v4
- name: examples-flag-gems
run: |
CUDA_VISIBLE_DEVICES=5 pytest -s examples/model_bert_test.py