Skip to content

Commit db86f0d

Browse files
committed
[CI] Add unit test framework
Signed-off-by: wangxiyuan <wangxiyuan1007@gmail.com>
1 parent 47b507b commit db86f0d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+637
-578
lines changed

.github/workflows/vllm_ascend_test.yaml

Lines changed: 81 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,47 @@ jobs:
108108
echo "::add-matcher::.github/workflows/matchers/mypy.json"
109109
tools/mypy.sh 1 ${{ matrix.python-version }}
110110
111+
ut:
112+
needs: [lint]
113+
if: ${{ needs.lint.result == 'success' }}
114+
runs-on: ubuntu-latest
115+
strategy:
116+
matrix:
117+
vllm_version: [main, v0.9.1]
118+
python-version: ["3.10"]
119+
steps:
120+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
121+
- name: Set up Python ${{ matrix.python-version }}
122+
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
123+
with:
124+
python-version: ${{ matrix.python-version }}
125+
- name: Checkout vllm-project/vllm repo
126+
uses: actions/checkout@v4
127+
with:
128+
repository: vllm-project/vllm
129+
ref: ${{ matrix.vllm_version }}
130+
path: ./vllm-empty
131+
132+
- name: Install vllm-project/vllm from source
133+
working-directory: ./vllm-empty
134+
run: |
135+
VLLM_TARGET_DEVICE=empty pip install -e .
136+
137+
- name: Checkout vllm-project/vllm-ascend repo
138+
uses: actions/checkout@v4
139+
140+
- name: Install vllm-project/vllm-ascend
141+
run: |
142+
pip install -r requirements-dev.txt
143+
pip install -v -e .
144+
145+
- name: Run unit test for V1 Engine
146+
env:
147+
VLLM_USE_V1: 1
148+
VLLM_WORKER_MULTIPROC_METHOD: spawn
149+
run: |
150+
pytest -sv tests/unit
151+
111152
e2e:
112153
needs: [lint]
113154
if: ${{ needs.lint.result == 'success' }}
@@ -173,65 +214,63 @@ jobs:
173214
pip install -r requirements-dev.txt
174215
pip install -v -e .
175216
176-
- name: Run vllm-project/vllm-ascend test for V1 Engine
217+
- name: Run e2e test for V1 Engine
177218
env:
178219
VLLM_USE_V1: 1
179220
VLLM_WORKER_MULTIPROC_METHOD: spawn
180221
run: |
181222
if [[ "${{ matrix.os }}" == "linux-arm64-npu-1" ]]; then
182-
VLLM_USE_MODELSCOPE=True pytest -sv tests/singlecard/test_offline_inference.py
223+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/singlecard/test_offline_inference.py
183224
# guided decoding doesn't work, fix it later
184-
# pytest -sv tests/singlecard/test_guided_decoding.py.py
185-
# test_ascend_config.py should be ran separately because it will regenerate the global config many times.
186-
pytest -sv tests/singlecard/test_ascend_config.py
187-
pytest -sv tests/singlecard/test_camem.py
188-
pytest -sv tests/singlecard/core/test_ascend_scheduler.py
189-
pytest -sv tests/singlecard/core/test_ascend_scheduler_e2e.py
190-
pytest -sv tests/singlecard/ \
191-
--ignore=tests/singlecard/test_offline_inference.py \
192-
--ignore=tests/singlecard/test_guided_decoding.py \
193-
--ignore=tests/singlecard/test_ascend_config.py \
194-
--ignore=tests/singlecard/test_camem.py \
195-
--ignore=tests/singlecard/core/test_ascend_scheduler.py \
196-
--ignore=tests/singlecard/core/test_ascend_scheduler_e2e.py
225+
# pytest -sv tests/e2e/singlecard/test_guided_decoding.py.py
226+
pytest -sv tests/e2e/singlecard/test_camem.py
227+
pytest -sv tests/e2e/singlecard/core/test_ascend_scheduler.py
228+
pytest -sv tests/e2e/singlecard/core/test_ascend_scheduler_e2e.py
229+
pytest -sv tests/e2e/singlecard/ \
230+
--ignore=tests/e2e/singlecard/test_offline_inference.py \
231+
--ignore=tests/e2e/singlecard/test_guided_decoding.py \
232+
--ignore=tests/e2e/singlecard/test_ascend_config.py \
233+
--ignore=tests/e2e/singlecard/test_camem.py \
234+
--ignore=tests/e2e/singlecard/core/test_ascend_scheduler.py \
235+
--ignore=tests/e2e/singlecard/core/test_ascend_scheduler_e2e.py
197236
else
198-
pytest -sv tests/multicard/test_ilama_lora_tp2.py
237+
pytest -sv tests/e2e/multicard/test_ilama_lora_tp2.py
199238
# To avoid oom, we need to run the test in a single process.
200-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_QwQ
201-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek
202-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_topk
203-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_W8A8
204-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/ --ignore=tests/multicard/test_ilama_lora_tp2.py --ignore=tests/multicard/test_offline_inference_distributed.py
239+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_QwQ
240+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek
241+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_topk
242+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_W8A8
243+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/ --ignore=tests/e2e/multicard/test_ilama_lora_tp2.py --ignore=tests/e2e/multicard/test_offline_inference_distributed.py
205244
fi
206245
207-
- name: Run vllm-project/vllm-ascend test on V0 engine
246+
- name: Run e2e test on V0 engine
208247
if: ${{ github.event_name == 'schedule' }}
209248
env:
210249
VLLM_USE_V1: 0
211250
run: |
212251
if [[ "${{ matrix.os }}" == "linux-arm64-npu-1" ]]; then
213-
VLLM_USE_MODELSCOPE=True pytest -sv tests/singlecard/test_offline_inference.py
252+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/singlecard/test_offline_inference.py
214253
# guided decoding doesn't work, fix it later
215-
# pytest -sv tests/singlecard/test_guided_decoding.py.py
216-
pytest -sv tests/singlecard/test_camem.py
254+
# pytest -sv tests/e2e/singlecard/test_guided_decoding.py.py
255+
pytest -sv tests/e2e/singlecard/test_camem.py
217256
# test_ascend_config.py should be ran separately because it will regenerate the global config many times.
218-
pytest -sv tests/singlecard/test_ascend_config.py
219-
pytest -sv tests/singlecard/test_prompt_embedding.py
220-
pytest -sv tests/singlecard/ \
221-
--ignore=tests/singlecard/test_offline_inference.py \
222-
--ignore=tests/singlecard/test_guided_decoding.py \
223-
--ignore=tests/singlecard/test_camem.py \
224-
--ignore=tests/singlecard/test_ascend_config.py \
225-
--ignore=tests/singlecard/test_prompt_embedding.py \
226-
--ignore=tests/singlecard/core/test_ascend_scheduler.py \
227-
--ignore=tests/singlecard/core/test_ascend_scheduler_e2e.py
257+
pytest -sv tests/e2e/singlecard/test_ascend_config.py
258+
pytest -sv tests/e2e/singlecard/test_prompt_embedding.py
259+
pytest -sv tests/e2e/singlecard/ \
260+
--ignore=tests/e2e/singlecard/test_offline_inference.py \
261+
--ignore=tests/e2e/singlecard/test_guided_decoding.py \
262+
--ignore=tests/e2e/singlecard/test_camem.py \
263+
--ignore=tests/e2e/singlecard/test_ascend_config.py \
264+
--ignore=tests/e2e/singlecard/test_prompt_embedding.py \
265+
--ignore=tests/e2e/singlecard/core/test_ascend_scheduler.py \
266+
--ignore=tests/e2e/singlecard/core/test_ascend_scheduler_e2e.py
228267
else
229-
pytest -sv tests/multicard/test_ilama_lora_tp2.py
230-
# Fixme: run VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py will raise error.
268+
pytest -sv tests/e2e/multicard/test_ilama_lora_tp2.py
269+
# Fixme: run VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py will raise error.
231270
# To avoid oom, we need to run the test in a single process.
232-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_QwQ
233-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek
234-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_topk
235-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_W8A8
236-
VLLM_USE_MODELSCOPE=True pytest -sv tests/multicard/ --ignore=tests/multicard/test_ilama_lora_tp2.py --ignore=tests/multicard/test_offline_inference_distributed.py
271+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_QwQ
272+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek
273+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_topk
274+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/test_offline_inference_distributed.py::test_models_distributed_DeepSeek_W8A8
275+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/multicard/ --ignore=tests/e2e/multicard/test_ilama_lora_tp2.py --ignore=tests/e2e/multicard/test_offline_inference_distributed.py
237276
fi

.github/workflows/vllm_ascend_test_long_term.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ jobs:
9696
run: |
9797
if [[ "${{ matrix.os }}" == "linux-arm64-npu-1" ]]; then
9898
# spec decode test
99-
VLLM_USE_MODELSCOPE=True pytest -sv tests/long_term/spec_decode/e2e/test_v1_mtp_correctness.py
99+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/long_term/spec_decode/e2e/test_v1_mtp_correctness.py
100100
# TODO: revert me when test_v1_spec_decode.py::test_ngram_correctness is fixed
101-
# VLLM_USE_MODELSCOPE=True pytest -sv tests/long_term/spec_decode/e2e/test_v1_spec_decode.py
102-
VLLM_USE_MODELSCOPE=True pytest -sv tests/long_term/spec_decode/e2e/test_mtp_correctness.py # it needs a clean process
103-
pytest -sv tests/long_term/spec_decode --ignore=tests/long_term/spec_decode/e2e/test_mtp_correctness.py --ignore=tests/long_term/spec_decode/e2e/test_v1_spec_decode.py --ignore=tests/long_term/spec_decode/e2e/test_v1_mtp_correctness.py
104-
pytest -sv tests/long_term/test_accuracy.py
101+
# VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/long_term/spec_decode/e2e/test_v1_spec_decode.py
102+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/long_term/spec_decode/e2e/test_mtp_correctness.py # it needs a clean process
103+
pytest -sv tests/e2e/long_term/spec_decode --ignore=tests/e2e/long_term/spec_decode/e2e/test_mtp_correctness.py --ignore=tests/e2e/long_term/spec_decode/e2e/test_v1_spec_decode.py --ignore=tests/e2e/long_term/spec_decode/e2e/test_v1_mtp_correctness.py
104+
pytest -sv tests/e2e/long_term/test_accuracy.py
105105
else
106-
VLLM_USE_MODELSCOPE=True pytest -sv tests/long_term/test_deepseek_v2_lite_tp2_accuracy.py
106+
VLLM_USE_MODELSCOPE=True pytest -sv tests/e2e/long_term/test_deepseek_v2_lite_tp2_accuracy.py
107107
fi

0 commit comments

Comments
 (0)