Dockerfile.neuron 1.47 KB
Newer Older
1
# default base image
2
3
# https://gallery.ecr.aws/neuron/pytorch-inference-neuronx
ARG BASE_IMAGE="public.ecr.aws/neuron/pytorch-inference-neuronx:2.1.2-neuronx-py310-sdk2.20.2-ubuntu20.04"
4
5
6
7
8
9

FROM $BASE_IMAGE

RUN echo "Base image is $BASE_IMAGE"

# Install some basic utilities
10
11
12
13
14
15
RUN apt-get update && \
    apt-get install -y \
        git \
        python3 \
        python3-pip \
        ffmpeg libsm6 libxext6 libgl1
16
17
18
19
20

### Mount Point ###
# When launching the container, mount the code directory to /app
ARG APP_MOUNT=/app
VOLUME [ ${APP_MOUNT} ]
21
WORKDIR ${APP_MOUNT}/vllm
22
23
24
25
26

RUN python3 -m pip install --upgrade pip
RUN python3 -m pip install --no-cache-dir fastapi ninja tokenizers pandas
RUN python3 -m pip install sentencepiece transformers==4.36.2 -U
RUN python3 -m pip install transformers-neuronx --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
27
RUN python3 -m pip install --pre neuronx-cc==2.15.* --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
28

29
30
31
32
COPY . .
ARG GIT_REPO_CHECK=0
RUN --mount=type=bind,source=.git,target=.git \
    if [ "$GIT_REPO_CHECK" != 0 ]; then bash tools/check_repo.sh ; fi
33

34
RUN python3 -m pip install -U \
35
        'cmake>=3.26' ninja packaging 'setuptools-scm>=8' wheel jinja2 \
36
        -r requirements-neuron.txt
37

38
ENV VLLM_TARGET_DEVICE neuron
39
RUN --mount=type=bind,source=.git,target=.git \
40
    pip install --no-build-isolation -v -e .
41

youkaichao's avatar
youkaichao committed
42
43
44
# install development dependencies (for testing)
RUN python3 -m pip install -e tests/vllm_test_utils

45
CMD ["/bin/bash"]