Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,6 @@ jobs:
env:
TAG_PREFIX: "openmmlab/lmdeploy"
TAG: "openmmlab/lmdeploy:ascend"
PYTHON_VERSION: '3.10'
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand Down Expand Up @@ -188,5 +187,5 @@ jobs:
- name: Build and push Docker image
run: |
echo $TAG
docker build . -t ${TAG} -f docker/Dockerfile.ascend --platform linux/arm64 --build-arg PYTHON_VERSION=${PYTHON_VERSION}
docker build . -t ${TAG} -f docker/Dockerfile_ascend_a3 --platform linux/arm64
docker push $TAG
4 changes: 1 addition & 3 deletions .github/workflows/test_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,6 @@ jobs:
permissions:
pull-requests: write
runs-on: ubuntu-22.04-arm
env:
PYTHON_VERSION: '3.10'
steps:
- name: Checkout repository
uses: actions/checkout@v3
Expand All @@ -93,7 +91,7 @@ jobs:
git config --local --unset "http.https://github.com/.extraheader"
- name: Build Docker image
run: |
docker build . -t lmdeploy:ascend -f docker/Dockerfile.ascend --build-arg PYTHON_VERSION=${PYTHON_VERSION}
docker build . -t lmdeploy:ascend -f docker/Dockerfile_ascend_a3
# - name: Test image with lmdeploy check_env
# run: |
# docker images
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ repos:
rev: v2.1.0
hooks:
- id: codespell
args: ["--skip=third_party/*,*.ipynb,*.proto,src/turbomind/*,docker/Dockerfile.ascend,docs/en/get_started/ascend/get_started.md,docs/zh_cn/get_started/ascend/get_started.md"]
args: ["--skip=third_party/*,*.ipynb,*.proto,src/turbomind/*,docker/Dockerfile_ascend*,docs/en/get_started/ascend/get_started.md,docs/zh_cn/get_started/ascend/get_started.md"]


- repo: https://github.com/myint/docformatter
Expand Down
28 changes: 0 additions & 28 deletions docker/Dockerfile.ascend

This file was deleted.

28 changes: 28 additions & 0 deletions docker/Dockerfile_ascend_a2_300i
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# DOCKER_BUILDKIT=1 docker build --build-arg ASCEND_DEVICE_TYPE=ascend_a2 \
# --build-arg DLINFER_TAG=main --build-arg LMDEPLOY_TAG=main --network=host \
# -t lmdeploy_dlinfer:a2 -f Dockerfile_ascend_a2_300i .
ARG ASCEND_DEVICE_TYPE=ascend_a2
ARG ASCEND_HUB=swr.cn-south-1.myhuaweicloud.com/ascendhub

FROM ${ASCEND_HUB}/cann:8.3.rc1.alpha002-910b-ubuntu22.04-py3.11 AS ascend_a2_base
FROM ${ASCEND_HUB}/cann:8.3.rc1.alpha002-310p-ubuntu22.04-py3.11 AS ascend_300i_base

FROM ${ASCEND_DEVICE_TYPE}_base AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update -y && \
apt install -y libjemalloc-dev git && \
apt clean && rm -rf /var/lib/apt/lists/*

ENV HCCL_CONNECT_TIMEOUT=7200 \
PYTORCH_NPU_ALLOC_CONF="expandable_segments:True" \
HCCL_OP_EXPANSION_MODE="AIV" \
LD_PRELOAD=/usr/lib/aarch64-linux-gnu/libjemalloc.so:$LD_PRELOAD

ARG DLINFER_TAG=main
ARG LMDEPLOY_TAG=main
RUN --mount=type=cache,target=/root/.cache \
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn && \
pip install --no-cache-dir torch==2.8.0 torch-npu==2.8.0rc1 torchvision==0.23.0 && \
TORCH_DEVICE_BACKEND_AUTOLOAD=0 DEVICE=ascend pip install git+https://github.com/DeepLink-org/dlinfer.git@${DLINFER_TAG} && \
LMDEPLOY_TARGET_DEVICE=ascend pip install git+https://github.com/InternLM/lmdeploy.git@${LMDEPLOY_TAG}
27 changes: 27 additions & 0 deletions docker/Dockerfile_ascend_a3
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# DOCKER_BUILDKIT=1 docker build --build-arg ASCEND_DEVICE=ascend_a3 \
# --build-arg DLINFER_TAG=main --build-arg LMDEPLOY_TAG=main --network=host \
# -t lmdeploy_dlinfer:a3 -f Dockerfile_ascend_a3 .
ARG ASCEND_DEVICE_TYPE=ascend_a3
ARG ASCEND_HUB=swr.cn-south-1.myhuaweicloud.com/ascendhub

FROM ${ASCEND_HUB}/cann:8.3.rc1.alpha002-a3-openeuler24.03-py3.11 AS ascend_a3_base

FROM ${ASCEND_DEVICE_TYPE}_base AS builder
ENV DEBIAN_FRONTEND=noninteractive
RUN dnf update -y && \
dnf install -y jemalloc jemalloc-devel && \
dnf clean all && rm -rf /var/cache/dnf

ENV HCCL_CONNECT_TIMEOUT=7200 \
PYTORCH_NPU_ALLOC_CONF="expandable_segments:True" \
HCCL_OP_EXPANSION_MODE="AIV" \
LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD

ARG DLINFER_TAG=main
ARG LMDEPLOY_TAG=main
RUN --mount=type=cache,target=/root/.cache \
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple && \
pip config set global.trusted-host pypi.tuna.tsinghua.edu.cn && \
pip install --no-cache-dir torch==2.8.0 torch-npu==2.8.0rc1 torchvision==0.23.0 && \
TORCH_DEVICE_BACKEND_AUTOLOAD=0 DEVICE=ascend pip install git+https://github.com/DeepLink-org/dlinfer.git@${DLINFER_TAG} && \
LMDEPLOY_TARGET_DEVICE=ascend pip install git+https://github.com/InternLM/lmdeploy.git@${LMDEPLOY_TAG}
Loading