2025-04-10 14:30:49 +08:00
|
|
|
#
|
|
|
|
|
# Copyright (c) 2025 Huawei Technologies Co., Ltd. All Rights Reserved.
|
|
|
|
|
#
|
|
|
|
|
# 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.
|
2025-04-17 14:59:56 +08:00
|
|
|
# This file is a part of the vllm-ascend project.
|
2025-04-10 14:30:49 +08:00
|
|
|
#
|
|
|
|
|
|
2025-11-06 09:05:08 +08:00
|
|
|
FROM quay.io/ascend/cann:8.3.rc1-910b-openeuler24.03-py3.11
|
2025-04-10 14:30:49 +08:00
|
|
|
|
2025-04-12 10:24:53 +08:00
|
|
|
ARG PIP_INDEX_URL="https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple"
|
|
|
|
|
ARG COMPILE_CUSTOM_KERNELS=1
|
|
|
|
|
|
|
|
|
|
ENV COMPILE_CUSTOM_KERNELS=${COMPILE_CUSTOM_KERNELS}
|
|
|
|
|
|
2025-04-10 14:30:49 +08:00
|
|
|
RUN yum update -y && \
|
2025-04-28 11:45:46 +08:00
|
|
|
yum install -y python3-pip git vim wget net-tools gcc gcc-c++ make cmake numactl-devel && \
|
|
|
|
|
rm -rf /var/cache/yum
|
2025-04-10 14:30:49 +08:00
|
|
|
|
2025-04-12 10:24:53 +08:00
|
|
|
RUN pip config set global.index-url ${PIP_INDEX_URL}
|
|
|
|
|
|
2025-04-10 14:30:49 +08:00
|
|
|
WORKDIR /workspace
|
|
|
|
|
|
2025-05-06 05:44:18 +08:00
|
|
|
COPY . /vllm-workspace/vllm-ascend/
|
2025-04-10 14:30:49 +08:00
|
|
|
|
|
|
|
|
# Install vLLM
|
|
|
|
|
ARG VLLM_REPO=https://github.com/vllm-project/vllm.git
|
2025-10-09 10:41:19 +08:00
|
|
|
ARG VLLM_TAG=v0.11.0
|
2025-04-10 14:30:49 +08:00
|
|
|
|
2025-04-30 17:38:13 +08:00
|
|
|
RUN git clone --depth 1 $VLLM_REPO --branch $VLLM_TAG /vllm-workspace/vllm
|
2025-04-10 14:30:49 +08:00
|
|
|
# In x86, triton will be installed by vllm. But in Ascend, triton doesn't work correctly. we need to uninstall it.
|
2025-11-21 17:53:00 +08:00
|
|
|
RUN VLLM_TARGET_DEVICE="empty" python3 -m pip install -e /vllm-workspace/vllm/[audio] --extra-index https://download.pytorch.org/whl/cpu/ && \
|
2025-04-28 11:45:46 +08:00
|
|
|
python3 -m pip uninstall -y triton && \
|
|
|
|
|
python3 -m pip cache purge
|
2025-04-10 14:30:49 +08:00
|
|
|
|
2025-04-12 10:24:53 +08:00
|
|
|
# Install vllm-ascend
|
2025-06-16 23:09:53 +08:00
|
|
|
RUN export PIP_EXTRA_INDEX_URL=https://mirrors.huaweicloud.com/ascend/repos/pypi && \
|
|
|
|
|
source /usr/local/Ascend/ascend-toolkit/set_env.sh && \
|
2025-04-12 10:24:53 +08:00
|
|
|
source /usr/local/Ascend/nnal/atb/set_env.sh && \
|
2025-04-28 11:45:46 +08:00
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/Ascend/ascend-toolkit/latest/`uname -i`-linux/devlib && \
|
2025-09-02 20:09:09 +08:00
|
|
|
export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/usr/include/c++/12:/usr/include/c++/12/`uname -i`-openEuler-linux && \
|
2025-04-30 17:38:13 +08:00
|
|
|
python3 -m pip install -v -e /vllm-workspace/vllm-ascend/ --extra-index https://download.pytorch.org/whl/cpu/ && \
|
2025-04-28 11:45:46 +08:00
|
|
|
python3 -m pip cache purge
|
2025-04-12 10:24:53 +08:00
|
|
|
|
2025-04-10 14:30:49 +08:00
|
|
|
# Install modelscope (for fast download) and ray (for multinode)
|
2025-07-30 22:49:20 +08:00
|
|
|
RUN python3 -m pip install modelscope 'ray>=2.47.1' 'protobuf>3.20.0' && \
|
2025-04-28 11:45:46 +08:00
|
|
|
python3 -m pip cache purge
|
2025-04-10 14:30:49 +08:00
|
|
|
|
2025-05-06 05:44:18 +08:00
|
|
|
CMD ["/bin/bash"]
|