1515 default : ' main'
1616 benchmark_type :
1717 required : true
18- description : ' Set benchmark type. Default is "["generation ", "throughput", "api_server"]"'
18+ description : ' Set benchmark type. Default is "["longtext ", "throughput", "api_server"]"'
1919 type : string
20- default : " ['apiserver', 'throughput']"
20+ default : " ['apiserver', 'throughput', 'longtext' ]"
2121 offline_mode :
2222 required : true
2323 description : ' Whether start a offline mode, if true, you should prepare code and whl package by yourself'
2727env :
2828 HOST_PIP_CACHE_DIR : /nvme/github-actions/pip-cache
2929 HOST_LOCALTIME : /usr/share/zoneinfo/Asia/Shanghai
30- OUTPUT_FOLDER : cuda12.4_dist_ ${{ github.run_id }}
30+ OUTPUT_FOLDER : cuda12.8_dist_ ${{ github.run_id }}
3131 REPORT_DIR : /nvme/qa_test_models/benchmark-reports/${{ github.run_id }}
32+ ALLURE_REPORT_DIR : /nvme/qa_test_models/benchmark-reports/allure_report/${{ github.run_id }}
33+ TEST_CODE_PATH : /nvme/qa_test_models/test_pkg/lmdeploy/${{ github.run_id }}
34+ OFFLINE_CODE_PATH : /nvme/qa_test_models/offline_pkg/lmdeploy
3235 ACTIONS_ALLOW_USE_UNSECURE_NODE_VERSION : true
33- FAIL_CONFIG : ${{ github.run_attempt != 1 && '--lf --lfnf none' || '--lf'}}
3436
3537jobs :
3638 linux-build :
4244 env :
4345 PYTHON_VERSION : ${{ matrix.pyver }}
4446 PLAT_NAME : manylinux2014_x86_64
45- DOCKER_TAG : cuda12.4
47+ DOCKER_TAG : cuda12.8
4648 steps :
4749 - name : Checkout repository
4850 uses : actions/checkout@v3
@@ -67,25 +69,16 @@ jobs:
6769 retention-days : 1
6870 name : my-artifact-${{ github.run_id }}-${{ matrix.pyver }}
6971
70-
71- benchmark :
72+ download_pkgs :
7273 needs : linux-build
73- if : ${{github.event_name == 'schedule' || !cancelled()}}
74+ if : ${{!cancelled()}}
7475 runs-on : [self-hosted, linux-a100]
75- strategy :
76- fail-fast : false
77- matrix :
78- benchmark_type : ${{fromJSON(github.event.inputs.benchmark_type)}}
79- timeout-minutes : 480
76+ timeout-minutes : 50
8077 container :
8178 image : openmmlab/lmdeploy:latest-cu12.8
8279 options : " --gpus=all --ipc=host --user root -e PIP_CACHE_DIR=/root/.cache/pip -e NVIDIA_DISABLE_REQUIRE=1 --pull never"
8380 volumes :
84- - /nvme/github-actions/pip-cache:/root/.cache/pip
85- - /nvme/github-actions/packages:/root/packages
8681 - /nvme/qa_test_models:/nvme/qa_test_models
87- - /mnt/shared:/mnt/shared
88- - /mnt/bigdisk:/mnt/bigdisk
8982 - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro
9083 steps :
9184 - name : Clone repository
@@ -94,42 +87,82 @@ jobs:
9487 with :
9588 repository : ${{ github.event.inputs.repo_org || 'InternLM/lmdeploy' }}
9689 ref : ${{github.event.inputs.repo_ref || 'main'}}
90+ - name : Copy repository
91+ if : ${{github.event_name == 'schedule' || !inputs.offline_mode}}
92+ run : rm -rf ${{env.TEST_CODE_PATH}} && mkdir ${{env.TEST_CODE_PATH}} && cp -r . ${{env.TEST_CODE_PATH}}
9793 - name : Copy repository - offline
9894 if : ${{inputs.offline_mode}}
99- run : cp -r /nvme/qa_test_models/offline_pkg/lmdeploy/. .
95+ run : rm -rf ${{env.TEST_CODE_PATH}} && mkdir ${{env.TEST_CODE_PATH}} && cp -r ${{env.OFFLINE_CODE_PATH}}/. ${{env.TEST_CODE_PATH}}
10096 - name : Download Artifacts
10197 if : ${{github.event_name == 'schedule' || !inputs.offline_mode}}
10298 uses : actions/download-artifact@v4
10399 with :
104100 name : my-artifact-${{ github.run_id }}-py310
101+ - name : Copy Artifacts
102+ if : ${{github.event_name == 'schedule' || !inputs.offline_mode}}
103+ run : rm ${{env.TEST_CODE_PATH}}/lmdeploy-*.whl -f && cp lmdeploy-*.whl ${{env.TEST_CODE_PATH}}
104+ - name : Copy Artifacts - offline
105+ if : ${{inputs.offline_mode}}
106+ run : rm ${{env.TEST_CODE_PATH}}/lmdeploy-*.whl -f && cp ${{env.OFFLINE_CODE_PATH}}/lmdeploy-*.whl ${{env.TEST_CODE_PATH}}
107+ - name : Mark as start
108+ run : |
109+ mkdir ${{env.REPORT_DIR}} -p
110+ echo "starttime=$(date +%s)" > ${{env.REPORT_DIR}}/status.txt
111+
112+ benchmark :
113+ needs : download_pkgs
114+ if : ${{github.event_name == 'schedule' || !cancelled()}}
115+ runs-on : [self-hosted, linux-a100]
116+ strategy :
117+ fail-fast : false
118+ matrix :
119+ benchmark_type : ${{fromJSON(github.event.inputs.benchmark_type)}}
120+ gpu_num : ['gpu_num_1', 'gpu_num_2', 'gpu_num_4', 'gpu_num_8']
121+ include :
122+ - n : 8
123+ gpu_num : gpu_num_1
124+ - n : 4
125+ gpu_num : gpu_num_2
126+ - n : 2
127+ gpu_num : gpu_num_4
128+ - n : 1
129+ gpu_num : gpu_num_8
130+ timeout-minutes : 480
131+ container :
132+ image : openmmlab/lmdeploy:latest-cu12
133+ options : " --gpus=all --ipc=host --user root -e PIP_CACHE_DIR=/root/.cache/pip -e NVIDIA_DISABLE_REQUIRE=1 --pull never"
134+ volumes :
135+ - /nvme/github-actions/pip-cache:/root/.cache/pip
136+ - /nvme/github-actions/packages:/root/packages
137+ - /nvme/qa_test_models:/nvme/qa_test_models
138+ - /nvme/huggingface_hub:/nvme/huggingface_hub
139+ - /mnt/121:/mnt/121
140+ - /mnt/bigdisk:/mnt/bigdisk
141+ - /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime:ro
142+ steps :
143+ - name : Copy repository and Artifacts
144+ run : |
145+ cp -r ${{env.TEST_CODE_PATH}}/. .
146+ mkdir ${{env.REPORT_DIR}} -p
147+ echo "starttime=$(date +%s)" > ${{env.REPORT_DIR}}/status.txt
105148 - name : Install lmdeploy - dependency
106149 run : |
107150 python3 -m pip install -r /nvme/qa_test_models/offline_pkg/requirements.txt
108151 - name : Install lmdeploy
109- if : ${{github.event_name == 'schedule' || !inputs.offline_mode}}
110152 run : |
111153 python3 -m pip uninstall lmdeploy -y && python3 -m pip install lmdeploy-*.whl --no-deps
112154 python3 -m pip install -r requirements/test.txt
113- - name : Install lmdeploy - offline
114- if : ${{inputs.offline_mode}}
115- run : |
116- python3 -m pip install /nvme/qa_test_models/offline_pkg/py310/lmdeploy-*.whl --no-deps
117- python3 -m pip install -r requirements/test.txt
118155 - name : Check env
119156 run : |
120157 python3 -m pip list
121158 lmdeploy check_env
122- mkdir ${{env.REPORT_DIR}}/allure-results/.pytest_cache -p
123- ln -s ${{env.REPORT_DIR}}/allure-results/.pytest_cache autotest
124159 - name : Run other benchmark
125160 run : |
126- pytest autotest/benchmark/test_${{matrix.benchmark_type}}_performance.py -n 8 --run_id ${{ github.run_id }} -m 'gpu_num_1 and not pr_test' ${{env.FAIL_CONFIG}} --alluredir=${{env.REPORT_DIR}}/allure-results || true
127- pytest autotest/benchmark/test_${{matrix.benchmark_type}}_performance.py -n 4 --run_id ${{ github.run_id }} -m 'gpu_num_2 and not pr_test' ${{env.FAIL_CONFIG}} --alluredir=${{env.REPORT_DIR}}/allure-results || true
128- pytest autotest/benchmark/test_${{matrix.benchmark_type}}_performance.py -n 2 --run_id ${{ github.run_id }} -m 'gpu_num_4 and not pr_test' ${{env.FAIL_CONFIG}} --alluredir=${{env.REPORT_DIR}}/allure-results || true
129- pytest autotest/benchmark/test_${{matrix.benchmark_type}}_performance.py --run_id ${{ github.run_id }} -m 'gpu_num_8 and not pr_test' ${{env.FAIL_CONFIG}} --alluredir=${{env.REPORT_DIR}}/allure-results
161+ pytest autotest/benchmark/test_${{matrix.benchmark_type}}_performance.py -n ${{matrix.n}} --run_id ${{ github.run_id }} -m '${{matrix.gpu_num}} and not pr_test' --alluredir=${{env.ALLURE_REPORT_DIR}}
130162 - name : Clear workfile
131163 if : always()
132164 run : |
165+ echo "status=done" >> ${{env.REPORT_DIR}}/status.txt
133166 chmod -R 777 $REPORT_DIR
134167 export workdir=$(pwd)
135168 cd ..
@@ -157,5 +190,6 @@ jobs:
157190 ref : ${{github.event.inputs.repo_ref || 'main'}}
158191 - name : Get overview
159192 run : |
193+ echo "status=done" >> ${{env.REPORT_DIR}}/status.txt
160194 pip install pandas fire mmengine
161195 python3 .github/scripts/action_tools.py generate_benchmark_report $REPORT_DIR
0 commit comments