Repository navigation
118 lines (101 loc) · 3.47 KB
/
Copy pathmain.yml
File metadata and controls
118 lines (101 loc) · 3.47 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
name: dlinfer main test ci
on:
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
env:
CI_PATH: "${HOME}/GitHub/${{ github.repository }}/${GITHUB_RUN_NUMBER}"
LMDEPLOY_PATH: "${HOME}/GitHub/lmdeploy"
LMDEPLOY_COMMIT_OR_BRANCH: 'main'
REPORT_DIR: "${HOME}/GitHub/ci_log/test_reports"
TEST_LMDEPLOY_E2E_LOG_PATH: "${HOME}/Github/ci_log/logs"
TEST_LMDEPLOY_E2E_MODEL_PATH: "${HOME}/Github/model"
TEST_LMDEPLOY_E2E_LOCAL_PIC1: "${HOME}/Github/pic/tiger.jpeg"
TEST_LMDEPLOY_E2E_LOCAL_PIC2: "${HOME}/Github/pic/human-pose.jpg"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
AscendEndtoEndTests:
if: github.repository == 'DeepLink-org/dlinfer'
runs-on: [self-hosted, 910B]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Create custom directory
run: |
set -ex
echo ${{ env.CI_PATH }}
mkdir -p ${{ env.CI_PATH }}
- name: Clean custom directory
run: |
set -ex
if [ -d "${{ env.CI_PATH }}" ]; then
rm -rf ${{ env.CI_PATH }}/*
rm -rf ${{ env.CI_PATH }}/.github
fi
- name: Move code to custom directory
run: |
set -ex
mv $GITHUB_WORKSPACE/* ${{ env.CI_PATH }}/
mv $GITHUB_WORKSPACE/.github ${{ env.CI_PATH }}/
- name: Build and install dlinfer
run: |
set -ex
source /usr/local/Ascend/ascend-toolkit/set_env.sh
cd ${{ env.CI_PATH }}
pip uninstall -y dlinfer-ascend
pip install -r requirements/ascend/full.txt
DEVICE=ascend python3 setup.py develop --user
- name: Make and clean directory for lmdeploy
run: |
set -ex
echo ${{env.LMDEPLOY_PATH }}
if [ -d "${{env.LMDEPLOY_PATH }}" ]; then
rm -rf ${{env.LMDEPLOY_PATH }}
mkdir -p ${{env.LMDEPLOY_PATH }}
fi
- name: Clone lmdeploy
run: |
set -ex
git clone https://github.com/InternLM/lmdeploy.git ${{ env.LMDEPLOY_PATH }}
cd ${{ env.LMDEPLOY_PATH }} && git checkout ${{ env.LMDEPLOY_COMMIT_OR_BRANCH }}
# git apply ${{env.CI_PATH }}/.github/ci/fix-exit-multi-npu.patch
- name: RunTests
run: |
set -ex
source /usr/local/Ascend/ascend-toolkit/set_env.sh
export PYTHONPATH=${{env.LMDEPLOY_PATH }}:$PYTHONPATH
cd ${{env.CI_PATH }}/tests
export DLINFER_TEST_DIR=${{env.CI_PATH }}/tests
echo $PYTHONPATH && pwd
export HCCL_EXEC_TIMEOUT=600
export ASCEND_RT_VISIBLE_DEVICES=6,7
pytest ./ -m 'lmdeploy' -s -x --alluredir=allure-results --clean-alluredir
- name: Generate reports
if: always()
run: |
if [ ! -d ${{ env.REPORT_DIR }} ]; then
mkdir -p ${{ env.REPORT_DIR }}
fi
export date_today="$(date +'%Y%m%d-%H%M%S')"
export report_dir="${{ env.REPORT_DIR }}/$date_today"
echo "Save report to $report_dir"
cd ${{env.CI_PATH }}/tests
mv allure-results $report_dir
- name: Uninstall dlinfer
if: always()
run: |
pip uninstall -y dlinfer-ascend
- name: Clear workfile
if: always()
run: |
export workdir=$(pwd)
cd ..
rm -rf $workdir
mkdir $workdir
chmod -R 777 $workdir