Skip to content

Commit

Permalink
Make CI work and use cache speed up e2e test
Browse files Browse the repository at this point in the history
This patch make CI work and use cache speed up e2e test, including:
  1. Change push (post merge ci) and pull_request (pr ci) trigger branch to main
  2. Make mypy work by ignore base_communicator and clear unused deps
  3. Several improvements for vllm_ascend_test:
  - use cache (pip, ms, hf) speed up e2e test (25mins --> 5mins)
  - switch `git clone` command to `action/checkout` to speedup checkout and
  - Enable sv for pytest for better info dump
  - Remove network host to resole `docker: conflicting ontions: cannot attach both user-defined and non-user-definednetwork-modes`, which is a problem on docker 1.45 but not on 1.39.
  4. Adapt MLA decode optimizations: vllm-project/vllm@cabaf4e

Signed-off-by: Yikun Jiang <yikunkero@gmail.com>
  • Loading branch information
Yikun committed Feb 5, 2025
1 parent 2d67aca commit 103ef36
Show file tree
Hide file tree
Showing 10 changed files with 47 additions and 114 deletions.
65 changes: 0 additions & 65 deletions .github/mergify.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/actionlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ name: Lint GitHub Actions workflows
on:
push:
branches:
- "*"
- "main"
paths:
- '.github/workflows/*.ya?ml'
- '.github/workflows/actionlint.*'
- '.github/workflows/matchers/actionlint.json'
pull_request:
branches:
- "*"
- "main"
paths:
- '.github/workflows/*.ya?ml'
- '.github/workflows/actionlint.*'
Expand Down
33 changes: 15 additions & 18 deletions .github/workflows/mypy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ on:
# but only for the main branch
push:
branches:
- "*"
- "main"
paths:
- '**/*.py'
- '.github/workflows/mypy.yaml'
- 'tools/mypy.sh'
pull_request:
branches:
- "*"
- "main"
# This workflow is only relevant when one of the following files changes.
# However, we have github configured to expect and require this workflow
# to run and pass before github with auto-merge a pull request. Until github
Expand All @@ -54,23 +54,20 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mypy==1.11.1
pip install types-setuptools
pip install types-PyYAML
pip install types-requests
pip install types-setuptools
sudo apt-get update
sudo apt-get install -y git gcc-12 g++-12 libnuma-dev
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 10 --slave /usr/bin/g++ g++ /usr/bin/g++-12
pip install cmake>=3.26 wheel packaging ninja "setuptools-scm>=8" numpy
- name: Download and Install vllm cpu
# TODO (cmq): clone vllm-project/vllm:main instead of cosdt/vllm:apply_plugin
pip install -r requirements-dev.txt
- name: Checkout vllm-project/vllm repo
uses: actions/checkout@v4
with:
repository: vllm-project/vllm
path: vllm-empty

- name: Install vllm-project/vllm from source
working-directory: vllm-empty
run: |
git clone https://github.com/cosdt/vllm -b apply_plugin
cd vllm
pip install -r requirements-cpu.txt --extra-index-url https://download.pytorch.org/whl/cpu
VLLM_TARGET_DEVICE=cpu python setup.py install
pip install -r requirements-build.txt --extra-index-url https://download.pytorch.org/whl/cpu
VLLM_TARGET_DEVICE=empty pip install .
- name: Mypy
run: |
echo "::add-matcher::.github/workflows/matchers/mypy.json"
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ruff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ on:
# but only for the main branch
push:
branches:
- "*"
- "main"
paths:
- "**/*.py"
- requirements-lint.txt
- .github/workflows/matchers/ruff.json
- .github/workflows/ruff.yml
pull_request:
branches:
- "*"
- "main"

jobs:
ruff:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/shellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ name: Lint shell scripts
on:
push:
branches:
- "*"
- "main"
paths:
- '**/*.sh'
- '.github/workflows/shellcheck.yml'
pull_request:
branches:
- "*"
- "main"
paths:
- '**/*.sh'
- '.github/workflows/shellcheck.yml'
Expand Down
39 changes: 18 additions & 21 deletions .github/workflows/vllm_ascend_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# limitations under the License.
#

name: 'vllm_ascend_ut'
name: 'e2e test'

on:
push:
Expand All @@ -42,19 +42,19 @@ defaults:

jobs:
test:
name: run ut for vllm_ascend
runs-on: npu-arm64 # actionlint-ignore: runner-label
name: vLLM Ascend test (self-host)
runs-on: ascend-arm64 # actionlint-ignore: runner-label

container:
image: quay.io/ascend/cann:8.0.rc3.beta1-910b-ubuntu22.04-py3.10
volumes:
- /usr/local/dcmi:/usr/local/dcmi
- /usr/local/bin/npu-smi:/usr/local/bin/npu-smi
- /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/
- /data/disk1/actions-runner/_work/_repo/vllm:/root/vllm
# Use self-host cache speed up pip and model download
- /home/action/actions-runner/_work/cache:/github/home/.cache/
options: >-
--network host
--device /dev/davinci1
--device /dev/davinci6
--device /dev/davinci_manager
--device /dev/devmm_svm
--device /dev/hisi_hdc
Expand All @@ -70,7 +70,7 @@ jobs:
sed -i 's|ports.ubuntu.com|mirrors.tuna.tsinghua.edu.cn|g' /etc/apt/sources.list
pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple
- name: Checkout
- name: Checkout vllm-project/vllm-ascend repo
uses: actions/checkout@v4

- name: Install system dependencies
Expand All @@ -82,28 +82,25 @@ jobs:
run: |
pip install -r requirements-dev.txt
# This is the base vllm master code cached in the container to speed up
# the test. There are two branch by default:
# - up-main: the latest code of vllm
# - apply_plugin: the code of vllm with the plugin applied
- name: copy vllm
run: |
cp -r /root/vllm /root/vllm-empty
- name: Checkout vllm-project/vllm repo
uses: actions/checkout@v4
with:
repository: vllm-project/vllm
path: ./vllm-empty

- name: Install vLLM from source
working-directory: /root/vllm-empty
- name: Install vllm-project/vllm from source
working-directory: ./vllm-empty
run: |
git checkout up-main
VLLM_TARGET_DEVICE=empty pip install -e .
- name: Install vllm_ascend
- name: Install vllm-project/vllm-ascend
run: |
pip install -e .
- name: Run test
- name: Run vllm-project/vllm-ascend test
run: |
pytest tests
pytest -sv tests
- name: Run vLLM native test
- name: Run vllm-project/vllm test
run: |
bash tools/npu-vllm-test.sh
4 changes: 2 additions & 2 deletions .github/workflows/yapf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ on:
# but only for the main branch
push:
branches:
- "*"
- "main"
paths:
- "**/*.py"
- .github/workflows/yapf.yml
pull_request:
branches:
- "*"
- "main"
paths:
- "**/*.py"
- .github/workflows/yapf.yml
Expand Down
4 changes: 4 additions & 0 deletions mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ ignore_missing_imports = True

[mypy-transformers.*]
ignore_missing_imports = True

; Remove this after https://github.com/vllm-project/vllm/pull/11324 merged
[mypy-vllm.distributed.device_communicators.base_communicator]
ignore_missing_imports = True
2 changes: 1 addition & 1 deletion tools/npu-vllm-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

set -o pipefail

TEST_DIR="/root/vllm-empty/tests"
TEST_DIR="./vllm-empty/tests"
TEST_FILES=(
test_sequence.py
# test_utils.py
Expand Down
2 changes: 1 addition & 1 deletion vllm_ascend/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def check_and_update_config(cls, vllm_config: VllmConfig) -> None:

@classmethod
def get_attn_backend_cls(cls, selected_backend, head_size, dtype,
kv_cache_dtype, block_size, use_v1):
kv_cache_dtype, block_size, use_v1, use_mla):
return "vllm_ascend.attention.AscendAttentionBackend"

@classmethod
Expand Down

0 comments on commit 103ef36

Please sign in to comment.