You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
RUN pip install "jax[tpu]>=0.2.16" -f https://storage.googleapis.com/jax-releases/libtpu_releases.html && \
33
-
cp $DEFAULT_LIBTPU $JAX_LIBTPU && \
34
-
/tmp/clean-layer.sh
34
+
RUN cp $PIP_LIBTPU $PYTORCH_LIBTPU
35
35
36
36
# Monkey-patch TF, JAX & PYTORCH to load the correct libtpu.so when they are imported:
37
-
RUN sed -i "s|^\(\(.*\)libtpu.configure_library_path.*\)|\1\n\2os.environ['TPU_LIBRARY_PATH'] = '${PYTORCH_LIBTPU}'|" /opt/conda/lib/python3.7/site-packages/torch_xla/__init__.py && \
38
-
sed -i "s|^\(\(.*\)libtpu.configure_library_path.*\)|\1\n\2os.environ['TPU_LIBRARY_PATH'] = '${JAX_LIBTPU}'|" /opt/conda/lib/python3.7/site-packages/jax/_src/cloud_tpu_init.py && \
39
-
sed -i "1s/^/from jax._src.cloud_tpu_init import cloud_tpu_init\ncloud_tpu_init()\n/" /opt/conda/lib/python3.7/site-packages/tensorflow/__init__.py
37
+
RUN sed -i "s|^\(\(.*\)libtpu.configure_library_path.*\)|\1\n\2os.environ['TPU_LIBRARY_PATH'] = '${PYTORCH_LIBTPU}'|" /usr/local/lib/python3.8/site-packages/torch_xla/__init__.py && \
38
+
sed -i "s|^\(\(.*\)libtpu.configure_library_path.*\)|\1\n\2os.environ['TPU_LIBRARY_PATH'] = '${JAX_LIBTPU}'|" /usr/local/lib/python3.8/site-packages/jax/_src/cloud_tpu_init.py
39
+
40
+
# Packages needed by the Notebook editor:
41
+
RUN pip install papermill jupyterlab python-lsp-server[all] jupyterlab-lsp
40
42
41
43
# Set these env vars so that they don't produce errs calling the metadata server to load them:
42
44
ENV TPU_ACCELERATOR_TYPE=v3-8
43
-
ENV TPU_PROCESS_ADDRESSES=local
45
+
ENV TPU_PROCESS_ADDRESSES=local
46
+
47
+
# Metadata
48
+
ARG GIT_COMMIT=unknown
49
+
ARG BUILD_DATE=unknown
50
+
51
+
LABEL git-commit=$GIT_COMMIT
52
+
LABEL build-date=$BUILD_DATE
53
+
ENV GIT_COMMIT=${GIT_COMMIT}
54
+
ENV BUILD_DATE=${BUILD_DATE}
55
+
56
+
LABEL tensorflow-version=$TENSORFLOW_VERSION
57
+
LABEL kaggle-lang=python
58
+
59
+
# Correlate current release with the git hash inside the kernel editor by running `!cat /etc/git_commit`.
60
+
RUN echo "$GIT_COMMIT" > /etc/git_commit && echo "$BUILD_DATE" > /etc/build_date
0 commit comments