-
Notifications
You must be signed in to change notification settings - Fork 617
add ascend_a3 Dockerfile #4097
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
add ascend_a3 Dockerfile #4097
Changes from 2 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
470929b
add ascend_a3 Dockerfile
yao-fengchen d53c8df
fix lint
yao-fengchen 522b6ee
refactor ascend Dockerfile
yao-fengchen 9ceb454
rename ascend Dockerfile
yao-fengchen d6d6b29
fix lint
yao-fengchen c08de14
fix a2_300i build err
yao-fengchen d98215f
update base_image of a2 and 300i
yao-fengchen 741b8a3
update
yao-fengchen 3a7a0b7
fix ci
yao-fengchen 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
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,40 @@ | ||
| # DOCKER_BUILDKIT=1 docker build --network=host -t lmdeploy_dlinfer:a3 -f Dockerfile.ascend_a3 . | ||
| ARG ASCEND_DEVICE=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}_base AS builder | ||
| ENV LMDEPLOY_TARGET_DEVICE=ascend | ||
| WORKDIR /opt/lmdeploy | ||
| COPY lmdeploy /opt/lmdeploy | ||
| 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 -U pip build && \ | ||
| python -m build -w -o /wheels -v . | ||
|
|
||
| ENV DEVICE=ascend | ||
| ENV TORCH_DEVICE_BACKEND_AUTOLOAD=0 | ||
| WORKDIR /opt/dlinfer | ||
| COPY dlinfer /opt/dlinfer | ||
lvhan028 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| RUN python -m build -w -o /wheels -v . | ||
|
|
||
| FROM ${ASCEND_DEVICE}_base AS final | ||
| ENV DEBIAN_FRONTEND=noninteractive | ||
| RUN dnf update -y && \ | ||
| dnf install -y jemalloc jemalloc-devel && \ | ||
| dnf clean all | ||
|
|
||
| ENV HCCL_CONNECT_TIMEOUT=7200 | ||
| ENV PYTORCH_NPU_ALLOC_CONF="expandable_segments:True" | ||
| ENV HCCL_OP_EXPANSION_MODE="AIV" | ||
| ENV LD_PRELOAD=/usr/lib64/libjemalloc.so.2:$LD_PRELOAD | ||
|
|
||
| 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 | ||
|
|
||
| RUN --mount=type=cache,target=/wheels,from=builder,source=/wheels \ | ||
| pip install --no-cache-dir /wheels/*.whl | ||
Oops, something went wrong.
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.
copy . /opt/lmdeployThere 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.
I will refactor it.