-
Notifications
You must be signed in to change notification settings - Fork 558
Add openEuler based container image for vLLM Ascend #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
dcb56d4
Change quick start readme
wxsIcey a6433e1
Add openEuler Dockerfile and yml
wxsIcey 7b8ca47
Reset readme
wxsIcey 224e3c4
Change openeuler image tag
wxsIcey aacdf66
Change quick start readme
wxsIcey d558328
fix
wxsIcey 5480cf4
fix
wxsIcey caf7c00
fix
wxsIcey b9e7bf8
Change Dockerfile
wxsIcey 60783c1
Remove tsinnghua source
wxsIcey 36ec83c
fix
wxsIcey fe78c9f
fix
wxsIcey 580a995
fix
wxsIcey 57d848e
fix
wxsIcey fef3829
fix
wxsIcey 125e273
fix
wxsIcey 93e9d62
fix
wxsIcey e3e7455
fix
wxsIcey 593ca06
fix
wxsIcey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| name: 'image' | ||
| # This is a docker build check and publish job: | ||
| # 1. PR Triggered docker image build check | ||
| # - is for image build check | ||
| # - Enable on main/*-dev branch | ||
| # - push: ${{ github.event_name != 'pull_request' }} ==> false | ||
| # 2. branches push trigger image publish | ||
| # - is for branch/dev/nightly image | ||
| # - commits are merge into main/*-dev ==> vllm-ascend:main / vllm-ascend:*-dev | ||
| # 3. tags push trigger image publish | ||
| # - is for final release image | ||
| # - Publish when tag with v* (pep440 version) ===> vllm-ascend:v1.2.3-openeuler|latest / vllm-ascend:v1.2.3rc1-openeuler | ||
| on: | ||
| pull_request: | ||
| branches: | ||
| - 'main' | ||
| - '*-dev' | ||
| paths: | ||
| - '.github/workflows/image_openeuler.yml' | ||
| - 'Dockerfile.openEuler' | ||
| - 'vllm_ascend/**' | ||
| push: | ||
| # Publish image when tagging, the Dockerfile in tag will be build as tag image | ||
| branches: | ||
| - 'main' | ||
| - '*-dev' | ||
| tags: | ||
| - 'v*' | ||
| paths: | ||
| - '.github/workflows/image_openeuler.yml' | ||
| - 'Dockerfile.openEuler' | ||
| - 'vllm_ascend/**' | ||
|
|
||
| jobs: | ||
| build: | ||
| name: vllm-ascend openEuler image | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Print | ||
| run: | | ||
| lscpu | ||
|
|
||
| - name: Docker meta | ||
| id: meta | ||
| uses: docker/metadata-action@v5 | ||
| with: | ||
| # TODO(yikun): add more hub image and a note on release policy for container image | ||
| images: | | ||
| quay.io/ascend/vllm-ascend | ||
| # Note for test case | ||
| # https://github.com/marketplace/actions/docker-metadata-action#typeref | ||
| # 1. branch job pulish per main/*-dev branch commits | ||
| # 2. main and dev pull_request is build only, so the tag pr-N-openeuler is fine | ||
| # 3. only pep440 matched tag will be published: | ||
| # - v0.7.1 --> v0.7.1-openeuler, latest | ||
| # - pre/post/dev: v0.7.1rc1-openeuler/v0.7.1rc1-openeuler/v0.7.1rc1.dev1-openeuler/v0.7.1.post1-openeuler, no latest | ||
| # which follow the rule from vLLM with prefix v | ||
| # TODO(yikun): the post release might be considered as latest release | ||
| tags: | | ||
| type=ref,event=branch,suffix=-openeuler | ||
| type=ref,event=pr,suffix=-openeuler | ||
| type=pep440,pattern={{raw}}-openeuler | ||
|
|
||
| - name: Free up disk space | ||
| uses: jlumbroso/free-disk-space@54081f138730dfa15788a46383842cd2f914a1be # v1.3.1 | ||
| with: | ||
| tool-cache: true | ||
| docker-images: false | ||
|
|
||
| - name: Build - Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| # TODO(yikun): remove this after https://github.com/docker/setup-qemu-action/issues/198 resolved | ||
| with: | ||
| image: tonistiigi/binfmt:qemu-v7.0.0-28 | ||
|
|
||
| - name: Build - Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@v3 | ||
|
|
||
| - name: Publish - Login to Quay Container Registry | ||
| if: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} | ||
| uses: docker/login-action@v3 | ||
| with: | ||
| registry: quay.io | ||
| username: ${{ vars.QUAY_USERNAME }} | ||
| password: ${{ secrets.QUAY_PASSWORD }} | ||
|
|
||
| - name: Build and push | ||
| uses: docker/build-push-action@v6 | ||
| with: | ||
| platforms: linux/amd64,linux/arm64 | ||
| cache-from: type=gha | ||
| cache-to: type=gha,mode=max | ||
| # only trigger when tag, branch/main push | ||
| push: ${{ github.event_name == 'push' && github.repository_owner == 'vllm-project' }} | ||
| labels: ${{ steps.meta.outputs.labels }} | ||
| tags: ${{ steps.meta.outputs.tags }} | ||
| file: Dockerfile.openEuler |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| # | ||
| # Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved. | ||
| # This file is a part of the vllm-ascend project. | ||
| # | ||
| # Licensed under the Apache License, Version 2.0 (the "License"); | ||
| # you may not use this file except in compliance with the License. | ||
| # You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, software | ||
| # distributed under the License is distributed on an "AS IS" BASIS, | ||
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| # See the License for the specific language governing permissions and | ||
| # limitations under the License. | ||
| # | ||
|
|
||
| FROM quay.io/ascend/cann:8.0.0-910b-openeuler22.03-py3.10 | ||
|
|
||
| RUN yum update -y && \ | ||
| yum install -y python3-pip git vim wget net-tools && \ | ||
| rm -rf /var/cache/yum &&\ | ||
| rm -rf /tmp/* | ||
|
|
||
| WORKDIR /workspace | ||
|
|
||
| COPY . /workspace/vllm-ascend/ | ||
|
|
||
| # Install vLLM | ||
| ARG VLLM_REPO=https://github.com/vllm-project/vllm.git | ||
| ARG VLLM_TAG=main | ||
|
|
||
| RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /workspace/vllm | ||
| RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install /workspace/vllm/ --extra-index https://download.pytorch.org/whl/cpu/ | ||
| # In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it. | ||
| RUN python3 -m pip uninstall -y triton | ||
|
|
||
| # Install vllm-ascend | ||
| RUN python3 -m pip install /workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ | ||
|
|
||
| # Install torch-npu | ||
| RUN bash /workspace/vllm-ascend/pta_install.sh | ||
|
|
||
| # Install modelscope (for fast download) and ray (for multinode) | ||
| RUN python3 -m pip install modelscope ray | ||
|
|
||
| CMD ["/bin/bash"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -8,6 +8,9 @@ | |||||
|
|
||||||
| ## Setup environment using container | ||||||
|
|
||||||
| :::::{tab-set} | ||||||
| ::::{tab-item} Ubuntu OS | ||||||
|
|
||||||
| ```{code-block} bash | ||||||
| :substitutions: | ||||||
|
|
||||||
|
|
@@ -30,6 +33,34 @@ docker run --rm \ | |||||
| -p 8000:8000 \ | ||||||
| -it $IMAGE bash | ||||||
| ``` | ||||||
| :::: | ||||||
|
|
||||||
| ::::{tab-item} openEuler OS | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| ```{code-block} bash | ||||||
| :substitutions: | ||||||
|
|
||||||
| # Update DEVICE according to your device (/dev/davinci[0-7]) | ||||||
| export DEVICE=/dev/davinci0 | ||||||
| # Update the vllm-ascend image | ||||||
| export IMAGE=quay.io/ascend/vllm-ascend:|vllm_ascend_version|-openeuler | ||||||
| docker run --rm \ | ||||||
| --name vllm-ascend \ | ||||||
| --device $DEVICE \ | ||||||
| --device /dev/davinci_manager \ | ||||||
| --device /dev/devmm_svm \ | ||||||
| --device /dev/hisi_hdc \ | ||||||
| -v /usr/local/dcmi:/usr/local/dcmi \ | ||||||
| -v /usr/local/bin/npu-smi:/usr/local/bin/npu-smi \ | ||||||
| -v /usr/local/Ascend/driver/lib64/:/usr/local/Ascend/driver/lib64/ \ | ||||||
| -v /usr/local/Ascend/driver/version.info:/usr/local/Ascend/driver/version.info \ | ||||||
| -v /etc/ascend_install.info:/etc/ascend_install.info \ | ||||||
| -v /root/.cache:/root/.cache \ | ||||||
| -p 8000:8000 \ | ||||||
| -it $IMAGE bash | ||||||
| ``` | ||||||
| :::: | ||||||
| ::::: | ||||||
|
|
||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. missing:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Modified |
||||||
| ## Usage | ||||||
|
|
||||||
|
|
||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.