Dockerfile.tpu 1.0 KB

123456789101112131415161718192021222324252627
  1. ARG NIGHTLY_DATE="20240808"
  2. ARG BASE_IMAGE="us-central1-docker.pkg.dev/tpu-pytorch-releases/docker/xla:nightly_3.10_tpuvm_$NIGHTLY_DATE"
  3. FROM $BASE_IMAGE
  4. WORKDIR /workspace
  5. # Install some basic utilities
  6. RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 libgl1
  7. # Install the TPU and Pallas dependencies.
  8. RUN python3 -m pip install torch_xla[tpu] -f https://storage.googleapis.com/libtpu-releases/index.html
  9. RUN 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
  10. # Build Aphrodite.
  11. COPY . /workspace/aphrodite-engine
  12. ENV APHRODITE_TARGET_DEVICE="tpu"
  13. RUN cd /workspace/aphrodite-engine && python3 -m pip install -r requirements-tpu.txt
  14. RUN cd /workspace/aphrodite-engine && python3 setup.py develop
  15. # Re-install outlines to avoid dependency errors.
  16. # The outlines version must follow requirements-common.txt.
  17. RUN pip uninstall outlines -y
  18. RUN pip install "outlines>=0.0.43"
  19. RUN pip install triton
  20. CMD ["/bin/bash"]