Dockerfile 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. # Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. ARG FROM_IMAGE_NAME=nvcr.io/nvidia/pytorch:22.06-py3
  15. FROM ${FROM_IMAGE_NAME}
  16. WORKDIR /workspace
  17. #RUN git clone https://github.com/NVIDIA/apex \
  18. # && cd apex \
  19. # && pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./
  20. # Install Python dependencies
  21. RUN pip install --upgrade --no-cache-dir pip \
  22. && pip install --no-cache-dir \
  23. sacrebleu \
  24. sentencepiece
  25. RUN pip install jupyter
  26. ARG DEBIAN_FRONTEND=noninteractive
  27. RUN apt-get update
  28. RUN apt-get install -y -q cmake pkg-config protobuf-compiler libprotobuf-dev libgoogle-perftools-dev
  29. RUN git clone https://github.com/google/sentencepiece.git /workspace/sentencepiece
  30. RUN cd /workspace/sentencepiece \
  31. && git checkout d4dd947 \
  32. && mkdir build \
  33. && cd build \
  34. && cmake .. \
  35. && make -j 8 \
  36. && make install \
  37. && ldconfig -v
  38. ENV PYTHONPATH=/workspace/translation/examples/translation/subword-nmt/
  39. WORKDIR /workspace/translation
  40. RUN git clone https://github.com/rsennrich/subword-nmt.git /workspace/translation/examples/translation/subword-nmt/
  41. RUN git clone https://github.com/NVIDIA/cutlass.git && cd cutlass && git checkout ed2ed4d6 && cd ..
  42. COPY . .
  43. RUN pip install -e .
  44. RUN pip install nvidia-pyindex
  45. RUN pip install nvidia-dllogger