Skip to content

Commit 1ddb233

Browse files
committed
upgrade tpu tf to 2.18.0
1 parent 3cba809 commit 1ddb233

File tree

3 files changed

+2
-16
lines changed

3 files changed

+2
-16
lines changed

tpu/Dockerfile

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,8 @@ FROM $BASE_IMAGE
66
# See: https://docs.docker.com/engine/reference/builder/#understand-how-arg-and-from-interact
77
ARG PYTHON_WHEEL_VERSION
88
ARG PYTHON_VERSION_PATH
9-
ARG TF_LINUX_WHEEL_VERSION
109
ARG TORCH_LINUX_WHEEL_VERSION
1110
ARG TORCH_VERSION
12-
ARG TENSORFLOW_VERSION
13-
ARG TF_LIBTPU_VERSION
1411
ARG TORCHVISION_VERSION
1512
ARG TORCHAUDIO_VERSION
1613

@@ -68,17 +65,11 @@ RUN export PATH="${HOME}/.local/bin:${PATH}" && uv pip install --system -r /requ
6865
/tmp/clean-layer.sh
6966
ENV PATH="${HOME}/.local/bin:${PATH}"
7067

71-
# Tensorflow libtpu:
72-
RUN curl --output /usr/local/lib/python3.10/site-packages/libtpu/libtpu.so https://storage.googleapis.com/cloud-tpu-tpuvm-artifacts/libtpu/${TF_LIBTPU_VERSION}/libtpu.so
73-
7468
# Kaggle Model Hub patches:
7569
ADD patches/kaggle_module_resolver.py /usr/local/lib/${PYTHON_VERSION_PATH}/site-packages/tensorflow_hub/kaggle_module_resolver.py
7670
RUN sed -i '/from tensorflow_hub import uncompressed_module_resolver/a from tensorflow_hub import kaggle_module_resolver' /usr/local/lib/${PYTHON_VERSION_PATH}/site-packages/tensorflow_hub/config.py
7771
RUN sed -i '/_install_default_resolvers()/a \ \ registry.resolver.add_implementation(kaggle_module_resolver.KaggleFileResolver())' /usr/local/lib/${PYTHON_VERSION_PATH}/site-packages/tensorflow_hub/config.py
7872

79-
# Monkey-patch the default TPU to the local (TPU VM).
80-
RUN sed -i 's/tpu=None,/tpu="local",/' /usr/local/lib/${PYTHON_VERSION_PATH}/site-packages/tensorflow/python/distribute/cluster_resolver/tpu/tpu_cluster_resolver.py
81-
8273
# Set these env vars so that they don't produce errs calling the metadata server to load them:
8374
ENV TPU_ACCELERATOR_TYPE=v3-8
8475
ENV TPU_PROCESS_ADDRESSES=local
@@ -92,7 +83,6 @@ LABEL build-date=$BUILD_DATE
9283
ENV GIT_COMMIT=${GIT_COMMIT}
9384
ENV BUILD_DATE=${BUILD_DATE}
9485

95-
LABEL tensorflow-version=$TENSORFLOW_VERSION
9686
LABEL kaggle-lang=python
9787

9888
# Correlate current release with the git hash inside the kernel editor by running `!cat /etc/git_commit`.

tpu/config.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
BASE_IMAGE=python:3.10
22
PYTHON_WHEEL_VERSION=cp310
33
PYTHON_VERSION_PATH=python3.10
4-
# gsutil ls gs://cloud-tpu-tpuvm-artifacts/tensorflow
5-
# https://cloud.google.com/tpu/docs/supported-tpu-configurations#libtpu_versions
6-
TENSORFLOW_VERSION=2.16.1
7-
TF_LIBTPU_VERSION=1.10.1
84
TF_LINUX_WHEEL_VERSION=manylinux_2_17_x86_64.manylinux2014_x86_64
95
# gsutil ls gs://pytorch-xla-releases/wheels/tpuvm/* | grep libtpu | grep torch_xla | grep -v -E ".*rc[0-9].*" | sed 's/.*torch_xla-\(.*\)+libtpu.*/\1/' | sort -rV
106
# Supports nightly

tpu/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# TPU Utils
22
tpu-info
33
# Tensorflow packages
4-
https://storage.googleapis.com/cloud-tpu-tpuvm-artifacts/tensorflow/tf-${TENSORFLOW_VERSION}/tensorflow-${TENSORFLOW_VERSION}-${PYTHON_WHEEL_VERSION}-${PYTHON_WHEEL_VERSION}-${TF_LINUX_WHEEL_VERSION}.whl
4+
tensorflow-tpu>=2.18.0
5+
-f https://storage.googleapis.com/libtpu-tf-releases/index.html
56
tensorflow_hub
67
tensorflow-io
78
tensorflow-probability
@@ -36,7 +37,6 @@ albumentations
3637
diffusers
3738
einops
3839
fastparquet
39-
librosa
4040
matplotlib
4141
opencv-python
4242
opencv-python-headless

0 commit comments

Comments
 (0)