Dockerfile.neuron 1.3 KB

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