Dockerfile.neuron 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. # default base image
  2. ARG BASE_IMAGE="public.ecr.aws/neuron/pytorch-inference-neuronx:2.1.2-neuronx-py310-sdk2.19.1-ubuntu20.04"
  3. FROM $BASE_IMAGE
  4. RUN echo "Base image is $BASE_IMAGE"
  5. # Install some basic utilities
  6. RUN apt-get update \
  7. && apt-get install python3 python3-pip -y \
  8. && apt-get install -y ffmpeg libsm6 libxext6 libgl1
  9. ### Mount Point ###
  10. # When launching the container, mount the code directory to /app
  11. ARG APP_MOUNT=/app
  12. VOLUME [ ${APP_MOUNT} ]
  13. WORKDIR ${APP_MOUNT}
  14. RUN python3 -m pip install --upgrade pip
  15. RUN python3 -m pip install --no-cache-dir fastapi ninja tokenizers pandas
  16. RUN python3 -m pip install sentencepiece transformers==4.36.2 -U
  17. RUN python3 -m pip install transformers-neuronx --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
  18. RUN python3 -m pip install --pre neuronx-cc==2.12.* --extra-index-url=https://pip.repos.neuron.amazonaws.com -U
  19. COPY ./aphrodite /app/aphrodite-engine/aphrodite
  20. COPY ./setup.py /app/aphrodite-engine/setup.py
  21. COPY ./requirements-common.txt /app/aphrodite-engine/requirements-common.txt
  22. COPY ./requirements-neuron.txt /app/aphrodite-engine/requirements-neuron.txt
  23. RUN cd /app/aphrodite-engine \
  24. && python3 -m pip install -U -r requirements-neuron.txt
  25. ENV APHRODITE_TARGET_DEVICE="neuron"
  26. RUN cd /app/aphrodite-engine \
  27. && pip install -e . \
  28. && cd ..
  29. RUN pip install triton
  30. CMD ["/bin/bash"]