Dockerfile.tpu 1.0 KB

1234567891011121314151617181920212223242526272829
  1. ARG NIGHTLY_DATE="20240726"
  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 aiohttp separately to avoid build errors.
  6. RUN pip install aiohttp
  7. # Install NumPy 1 instead of NumPy 2.
  8. RUN pip install "numpy<2"
  9. # Install the TPU and Pallas dependencies.
  10. RUN pip install torch_xla[tpu] -f https://storage.googleapis.com/libtpu-releases/index.html
  11. RUN 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
  12. # Fix FastAPI dependence
  13. RUN pip install "starlette<0.38.0"
  14. # Build Aphrodite.
  15. COPY . /workspace/aphrodite-engine
  16. ENV APHRODITE_TARGET_DEVICE="tpu"
  17. RUN cd /workspace/aphrodite-engine && python setup.py develop
  18. # Re-install outlines to avoid dependency errors.
  19. # The outlines version must follow requirements-common.txt.
  20. RUN pip uninstall outlines -y
  21. RUN pip install "outlines>=0.0.43"
  22. CMD ["/bin/bash"]