Dockerfile.tpu 1.18 KB
Newer Older
1
ARG NIGHTLY_DATE="20240828"
2
3
4
ARG BASE_IMAGE="us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla:nightly_3.10_tpuvm_$NIGHTLY_DATE"

FROM $BASE_IMAGE
5
WORKDIR /workspace/vllm
6

7
# Install some basic utilities
8
9
10
RUN apt-get update && apt-get install -y \
    git \
    ffmpeg libsm6 libxext6 libgl1
11

12
# Install the TPU and Pallas dependencies.
13
14
15
16
RUN --mount=type=cache,target=/root/.cache/pip \
    python3 -m pip install torch_xla[tpu] -f https://storage.googleapis.com/libtpu-releases/index.html
RUN --mount=type=cache,target=/root/.cache/pip \
    python3 -m pip install torch_xla[pallas] -f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html -f https://storage.googleapis.com/jax-releases/jaxlib_nightly_releases.html
17

18
# Build vLLM.
19
20
21
22
23
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

24
ENV VLLM_TARGET_DEVICE="tpu"
25
26
27
28
29
RUN --mount=type=cache,target=/root/.cache/pip \
    --mount=type=bind,source=.git,target=.git \
    python3 -m pip install \
        cmake>=3.26 ninja packaging setuptools-scm>=8 wheel jinja2 \
        -r requirements-tpu.txt
30
RUN python3 setup.py develop
31
32

CMD ["/bin/bash"]