Skip to content
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

build: update ascend dockerfile #2421

Merged
merged 3 commits into from
Sep 6, 2024

Conversation

CyCle1024
Copy link
Collaborator

Motivation

Using dlinfer instead of deeplink.framework in Dockerfile build for device=ascend

Modification

Update Dockerfile_aarch64_ascend, using pip3 install dlinfer-ascend==0.1.0 to support ascend,
torch_npu is used internally.

BC-breaking (Optional)

Does the modification introduce changes that break the backward-compatibility of the downstream repositories?
If so, please describe how it breaks the compatibility and how the downstream projects should modify their code to keep compatibility with this PR.

Use cases (Optional)

If this PR introduces a new feature, it is better to list some use cases here, and update the documentation.

Checklist

  1. Pre-commit or other linting tools are used to fix the potential lint issues.
  2. The modification is covered by complete unit tests. If not, please add more unit tests to ensure the correctness.
  3. If the modification has a dependency on downstream projects of a newer version, this PR should be tested with all supported versions of downstream projects.
  4. The documentation has been modified accordingly, like docstring or example tutorials.

@CyCle1024 CyCle1024 force-pushed the ccy/update_ascend_dockerfile branch from 15277e5 to c0dd202 Compare September 4, 2024 11:13
@CyCle1024 CyCle1024 force-pushed the ccy/update_ascend_dockerfile branch from c0dd202 to 0afd76c Compare September 4, 2024 12:30
@CyCle1024 CyCle1024 marked this pull request as ready for review September 4, 2024 12:31
git checkout ${LMDEPLOY_TAG_OR_COMMIT} && \
WORKDIR /opt/lmdeploy

COPY autotest /opt/lmdeploy/autotest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that src has nothing to do with ascend inference.
But user might modify code and would like to commit to github.
So please keep it as a whole package

COPY . /opt/lmdeploy

WORKDIR /opt/lmdeploy

Copy link
Collaborator Author

@CyCle1024 CyCle1024 Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

COPY . /opt/lmdeploy could bring all ascend *.run files into docker images (about 3.8GB extra size for CANN 8.0.RC3.alpha001), I could not find a good way to exclude the ascend files.
Actually, there is an experimental syntax for Dockerfile that excludes certain patterns link

COPY --excludes *.run . /opt/lmdeploy

It's experimental and I have not tested yet, and may have extra requirements for docker version

Copy link
Collaborator Author

@CyCle1024 CyCle1024 Sep 5, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand that src has nothing to do with ascend inference. But user might modify code and would like to commit to github. So please keep it as a whole package

COPY . /opt/lmdeploy

WORKDIR /opt/lmdeploy

I think it's ok if extra 3.8GB size for ascend image is acceptable.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lvhan028 using a new multi-stage build avoid copy run file into final image, please review

@lvhan028 lvhan028 merged commit 62ac4f1 into InternLM:main Sep 6, 2024
3 checks passed
@CyCle1024 CyCle1024 deleted the ccy/update_ascend_dockerfile branch October 17, 2024 04:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants