Skip to content

Commit

Permalink
add layer cleaning, drop uninstall pytorch which is not installe
Browse files Browse the repository at this point in the history
  • Loading branch information
djherbis committed May 13, 2022
1 parent 1e337de commit 98ebd1a
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions tpu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ COPY --from=libtpu /libtpu.so /lib

COPY --from=tensorflow_whl /tmp/tensorflow_pkg/tensorflow*.whl /tmp/tensorflow_pkg/
RUN pip install /tmp/tensorflow_pkg/tensorflow*.whl && \
rm -rf /tmp/tensorflow_pkg
rm -rf /tmp/tensorflow_pkg && \
/tmp/clean-layer.sh

# https://cloud.google.com/tpu/docs/pytorch-xla-ug-tpu-vm#changing_pytorch_version
RUN pip uninstall -y torch
RUN pip uninstall -y torch_xla
RUN pip install torch==1.10
RUN pip install torch_xla[tpuvm] -f https://storage.googleapis.com/tpu-pytorch/wheels/tpuvm/torch_xla-1.10-cp37-cp37m-linux_x86_64.whl
RUN pip uninstall -y torch && \
pip install torch==1.10 && \
pip install torch_xla[tpuvm] -f https://storage.googleapis.com/tpu-pytorch/wheels/tpuvm/torch_xla-1.10-cp37-cp37m-linux_x86_64.whl && \
/tmp/clean-layer.sh

# https://cloud.google.com/tpu/docs/jax-quickstart-tpu-vm#install_jax_on_your_cloud_tpu_vm
RUN pip install "jax[tpu]>=0.2.16" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
RUN pip install "jax[tpu]>=0.2.16" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html && \
/tmp/clean-layer.sh

0 comments on commit 98ebd1a

Please sign in to comment.