Skip to content

Commit

Permalink
To ensure that C++20 is fully supported in TensorFlow,
Browse files Browse the repository at this point in the history
Ubuntu image used in TF SIG Build Dockerfile upgraded from 20.04 to 22.04 (LTS).

PiperOrigin-RevId: 615889505
  • Loading branch information
tensorflower-gardener committed Mar 28, 2024
1 parent 354e90c commit b31a38a
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 19 deletions.
3 changes: 2 additions & 1 deletion ci/official/envs/ci_default
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ TFCI_DOCKER_ENABLE=
TFCI_DOCKER_IMAGE=
TFCI_DOCKER_PULL_ENABLE=
TFCI_DOCKER_REBUILD_ARGS=
TFCI_DOCKER_REBUILD_ENABLE=
# DO_NOT_SUBMIT - This should be disabled before merge
TFCI_DOCKER_REBUILD_ENABLE=1
TFCI_DOCKER_REBUILD_UPLOAD_ENABLE=
TFCI_GIT_DIR=
TFCI_INDEX_HTML_ENABLE=
Expand Down
5 changes: 1 addition & 4 deletions ci/official/utilities/rename_and_verify_wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ venv=$(mktemp -d)
"python${TFCI_PYTHON_VERSION}" -m venv "$venv"
python="$venv/bin/python3"
"$python" -m pip install *.whl $TFCI_PYTHON_VERIFY_PIP_INSTALL_ARGS
if [[ "$TFCI_WHL_IMPORT_TEST_ENABLE" == "1" ]]; then
"$python" -c 'import tensorflow as tf; t1=tf.constant([1,2,3,4]); t2=tf.constant([5,6,7,8]); print(tf.add(t1,t2).shape)'
"$python" -c 'import sys; import tensorflow as tf; sys.exit(0 if "keras" in tf.keras.__name__ else 1)'
fi
"$python" -c 'import tensorflow as tf; t1=tf.constant([1,2,3,4]); t2=tf.constant([5,6,7,8]); print(tf.add(t1,t2).shape)'
# VERY basic check to ensure the [and-cuda] package variant is installable.
# Checks TFCI_BAZEL_COMMON_ARGS for "gpu" or "cuda", implying that the test is
# relevant. All of the GPU test machines have CUDA installed via other means,
Expand Down
9 changes: 6 additions & 3 deletions tensorflow/tools/tf_sig_build_dockerfiles/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
FROM ubuntu:20.04 as builder
FROM ubuntu:22.04 as builder
################################################################################

# Install devtoolset build dependencies
Expand All @@ -16,7 +16,7 @@ COPY builder.devtoolset/glibc2.17-inline.patch /glibc2.17-inline.patch
RUN /build_devtoolset.sh devtoolset-9 /dt9

################################################################################
FROM nvidia/cuda:12.3.1-base-ubuntu20.04 as devel
FROM nvidia/cuda:12.3.1-base-ubuntu22.04 as devel
################################################################################
COPY --from=builder /dt9 /dt9

Expand All @@ -26,7 +26,9 @@ COPY setup.sources.sh /setup.sources.sh
COPY setup.packages.sh /setup.packages.sh
COPY setup.cuda.sh /setup.cuda.sh
COPY devel.packages.txt /devel.packages.txt
RUN /setup.sources.sh && /setup.packages.sh /devel.packages.txt && /setup.cuda.sh
RUN /setup.sources.sh
RUN /setup.packages.sh /devel.packages.txt
RUN /setup.cuda.sh

# Make sure clang is on the path
RUN ln -s /usr/lib/llvm-17/bin/clang /usr/bin/clang
Expand Down Expand Up @@ -60,6 +62,7 @@ RUN echo $CACHEBUSTER
ARG PYTHON_VERSION
COPY setup.python.sh /setup.python.sh
COPY devel.requirements.txt /devel.requirements.txt
RUN add-apt-repository ppa:deadsnakes/ppa && apt update -y
RUN /setup.python.sh $PYTHON_VERSION devel.requirements.txt

# Setup build and environment
Expand Down
17 changes: 10 additions & 7 deletions tensorflow/tools/tf_sig_build_dockerfiles/devel.packages.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,14 @@ libnccl2=2.19.3-1+cuda12.3
libcudnn8-dev=8.9.6.50-1+cuda12.2
libcudnn8=8.9.6.50-1+cuda12.2
# TensorRT: See https://docs.nvidia.com/deeplearning/sdk/tensorrt-install-guide/index.html#maclearn-net-repo-install-rpm
libnvinfer-plugin8=8.6.1.6-1+cuda12.0
libnvinfer8=8.6.1.6-1+cuda12.0
libnvinfer-dev=8.6.1.6-1+cuda12.0
libnvinfer-plugin-dev=8.6.1.6-1+cuda12.0
libnvinfer-plugin10=10.0.0.6-1+cuda12.4
# 8.6.1.6-1+cuda12.0
libnvinfer10=10.0.0.6-1+cuda12.4
# 8.6.1.6-1+cuda12.0
libnvinfer-dev=10.0.0.6-1+cuda12.4
# 8.6.1.6-1+cuda12.0
libnvinfer-plugin-dev=10.0.0.6-1+cuda12.4
# 8.6.1.6-1+cuda12.0

# This can be removed once NVIDIA publishes a cuda-12.3.2 Docker image.
# For now it ensures that we install at least version 12.3.107 of PTXAS,
Expand Down Expand Up @@ -57,10 +61,9 @@ libtool
libzmq3-dev
mlocate
moreutils
openjdk-11-jdk
openjdk-11-jre-headless
openjdk-21-jdk
openjdk-21-jre-headless
pkg-config
python3-dev
python3-setuptools
rsync
software-properties-common
Expand Down
8 changes: 4 additions & 4 deletions tensorflow/tools/tf_sig_build_dockerfiles/setup.sources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ cat >/etc/apt/sources.list.d/custom.list <<SOURCES
deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /
# More Python versions: Deadsnakes
deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main
deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal main
deb http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main
deb-src http://ppa.launchpad.net/deadsnakes/ppa/ubuntu jammy main
# LLVM/Clang repository
deb http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main
deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-17 main
deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
deb-src http://apt.llvm.org/jammy/ llvm-toolchain-jammy-17 main
SOURCES

0 comments on commit b31a38a

Please sign in to comment.