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 29, 2024
1 parent 7810e73 commit 182d9b8
Show file tree
Hide file tree
Showing 14 changed files with 26 additions and 52 deletions.
4 changes: 0 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ build:cuda --@local_config_cuda//:enable_cuda
# CUDA: This config refers to building CUDA op kernels with clang.
build:cuda_clang --config=cuda
# Enable TensorRT optimizations https://developer.nvidia.com/tensorrt
build:cuda_clang --config=tensorrt
build:cuda_clang --action_env=TF_CUDA_CLANG="1"
build:cuda_clang --@local_config_cuda//:cuda_compiler=clang
# Select supported compute capabilities (supported graphics cards).
Expand Down Expand Up @@ -286,7 +285,6 @@ build:tpu --define=framework_shared_object=true
build:tpu --copt=-DLIBTPU_ON_GCE
build:tpu --define=enable_mlir_bridge=true

build:tensorrt --repo_env TF_NEED_TENSORRT=1

build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain
build:rocm --define=using_rocm_hipcc=true
Expand Down Expand Up @@ -533,7 +531,6 @@ build:rbe_linux_cuda --config=rbe_linux_cpu
# For Remote build execution -- GPU configuration
build:rbe_linux_cuda --repo_env=REMOTE_GPU_TESTING=1
build:rbe_linux_cuda --repo_env=TF_CUDA_CONFIG_REPO="@sigbuild-r2.16-clang_config_cuda"
build:rbe_linux_cuda --repo_env=TF_TENSORRT_CONFIG_REPO="@sigbuild-r2.16-clang_config_tensorrt"
build:rbe_linux_cuda --repo_env=TF_NCCL_CONFIG_REPO="@sigbuild-r2.16-clang_config_nccl"
test:rbe_linux_cuda --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"

Expand Down Expand Up @@ -676,7 +673,6 @@ build:unsupported_gpu_linux --config=unsupported_cpu_linux
build:unsupported_gpu_linux --action_env=TF_CUDA_VERSION="11"
build:unsupported_gpu_linux --action_env=TF_CUDNN_VERSION="8"
build:unsupported_gpu_linux --repo_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm_75,compute_80"
build:unsupported_gpu_linux --config=tensorrt
build:unsupported_gpu_linux --action_env=CUDA_TOOLKIT_PATH="/usr/local/cuda-11.2"
build:unsupported_gpu_linux --action_env=LD_LIBRARY_PATH="/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.1/lib64:/usr/local/tensorrt/lib"
build:unsupported_gpu_linux --action_env=GCC_HOST_COMPILER_PATH="/dt9/usr/bin/gcc"
Expand Down
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
20 changes: 13 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,17 @@ 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-plugin9=9.3.0+cuda12.3
libnvinfer9=9.3.0+cuda12.3
libnvinfer-dev=9.3.0+cuda12.3
libnvinfer-plugin-dev=9.3.0+cuda12.3


#libnvinfer-plugin8=8.6.1.6-1+cuda12.3
#libnvinfer8=8.6.1.6-1+cuda12.3
#libnvinfer-dev=8.6.1.6-1+cuda12.3
#libnvinfer-plugin-dev=8.6.1.6-1+cuda12.3

# 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 +64,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
4 changes: 0 additions & 4 deletions tensorflow/tools/toolchains/remote_config/configs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,7 @@ def initialize_rbe_configs():
"TF_CUDNN_VERSION": "8.9",
"TF_ENABLE_XLA": "1",
"TF_NEED_CUDA": "1",
"TF_NEED_TENSORRT": "1",
"TF_SYSROOT": "/dt9",
"TF_TENSORRT_VERSION": "8.6",
},
)

Expand Down Expand Up @@ -720,8 +718,6 @@ def initialize_rbe_configs():
"TF_CUDNN_VERSION": "8.9",
"TF_ENABLE_XLA": "1",
"TF_NEED_CUDA": "1",
"TF_NEED_TENSORRT": "1",
"TF_SYSROOT": "/dt9",
"TF_TENSORRT_VERSION": "8.6",
},
)
3 changes: 0 additions & 3 deletions tensorflow/tools/toolchains/remote_config/rbe_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ def _tensorflow_rbe_config(name, compiler, python_versions, os, rocm_version = N
"TF_CUDNN_VERSION": cudnn_version,
"TF_CUDA_VERSION": cuda_version,
"CUDNN_INSTALL_PATH": cudnn_install_path if cudnn_install_path != None else "/usr/lib/x86_64-linux-gnu",
"TF_NEED_TENSORRT": "1",
"TF_TENSORRT_VERSION": tensorrt_version if tensorrt_version != None else "",
"TENSORRT_INSTALL_PATH": tensorrt_install_path if tensorrt_install_path != None else "/usr/lib/x86_64-linux-gnu",
"GCC_HOST_COMPILER_PATH": compiler if not compiler.endswith("clang") else "",
"GCC_HOST_COMPILER_PREFIX": compiler_prefix if compiler_prefix != None else "/usr/bin",
"CLANG_CUDA_COMPILER_PATH": compiler if compiler.endswith("clang") else "",
Expand Down
4 changes: 0 additions & 4 deletions third_party/xla/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ build:cuda --@local_config_cuda//:enable_cuda
# CUDA: This config refers to building CUDA op kernels with clang.
build:cuda_clang --config=cuda
# Enable TensorRT optimizations https://developer.nvidia.com/tensorrt
build:cuda_clang --config=tensorrt
build:cuda_clang --action_env=TF_CUDA_CLANG="1"
build:cuda_clang --@local_config_cuda//:cuda_compiler=clang
# Select supported compute capabilities (supported graphics cards).
Expand Down Expand Up @@ -286,7 +285,6 @@ build:tpu --define=framework_shared_object=true
build:tpu --copt=-DLIBTPU_ON_GCE
build:tpu --define=enable_mlir_bridge=true

build:tensorrt --repo_env TF_NEED_TENSORRT=1

build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain
build:rocm --define=using_rocm_hipcc=true
Expand Down Expand Up @@ -533,7 +531,6 @@ build:rbe_linux_cuda --config=rbe_linux_cpu
# For Remote build execution -- GPU configuration
build:rbe_linux_cuda --repo_env=REMOTE_GPU_TESTING=1
build:rbe_linux_cuda --repo_env=TF_CUDA_CONFIG_REPO="@sigbuild-r2.16-clang_config_cuda"
build:rbe_linux_cuda --repo_env=TF_TENSORRT_CONFIG_REPO="@sigbuild-r2.16-clang_config_tensorrt"
build:rbe_linux_cuda --repo_env=TF_NCCL_CONFIG_REPO="@sigbuild-r2.16-clang_config_nccl"
test:rbe_linux_cuda --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"

Expand Down Expand Up @@ -676,7 +673,6 @@ build:unsupported_gpu_linux --config=unsupported_cpu_linux
build:unsupported_gpu_linux --action_env=TF_CUDA_VERSION="11"
build:unsupported_gpu_linux --action_env=TF_CUDNN_VERSION="8"
build:unsupported_gpu_linux --repo_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm_75,compute_80"
build:unsupported_gpu_linux --config=tensorrt
build:unsupported_gpu_linux --action_env=CUDA_TOOLKIT_PATH="/usr/local/cuda-11.2"
build:unsupported_gpu_linux --action_env=LD_LIBRARY_PATH="/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.1/lib64:/usr/local/tensorrt/lib"
build:unsupported_gpu_linux --action_env=GCC_HOST_COMPILER_PATH="/dt9/usr/bin/gcc"
Expand Down
4 changes: 0 additions & 4 deletions third_party/xla/third_party/tsl/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,6 @@ build:cuda --@local_config_cuda//:enable_cuda
# CUDA: This config refers to building CUDA op kernels with clang.
build:cuda_clang --config=cuda
# Enable TensorRT optimizations https://developer.nvidia.com/tensorrt
build:cuda_clang --config=tensorrt
build:cuda_clang --action_env=TF_CUDA_CLANG="1"
build:cuda_clang --@local_config_cuda//:cuda_compiler=clang
# Select supported compute capabilities (supported graphics cards).
Expand Down Expand Up @@ -286,7 +285,6 @@ build:tpu --define=framework_shared_object=true
build:tpu --copt=-DLIBTPU_ON_GCE
build:tpu --define=enable_mlir_bridge=true

build:tensorrt --repo_env TF_NEED_TENSORRT=1

build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain
build:rocm --define=using_rocm_hipcc=true
Expand Down Expand Up @@ -533,7 +531,6 @@ build:rbe_linux_cuda --config=rbe_linux_cpu
# For Remote build execution -- GPU configuration
build:rbe_linux_cuda --repo_env=REMOTE_GPU_TESTING=1
build:rbe_linux_cuda --repo_env=TF_CUDA_CONFIG_REPO="@sigbuild-r2.16-clang_config_cuda"
build:rbe_linux_cuda --repo_env=TF_TENSORRT_CONFIG_REPO="@sigbuild-r2.16-clang_config_tensorrt"
build:rbe_linux_cuda --repo_env=TF_NCCL_CONFIG_REPO="@sigbuild-r2.16-clang_config_nccl"
test:rbe_linux_cuda --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"

Expand Down Expand Up @@ -676,7 +673,6 @@ build:unsupported_gpu_linux --config=unsupported_cpu_linux
build:unsupported_gpu_linux --action_env=TF_CUDA_VERSION="11"
build:unsupported_gpu_linux --action_env=TF_CUDNN_VERSION="8"
build:unsupported_gpu_linux --repo_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm_75,compute_80"
build:unsupported_gpu_linux --config=tensorrt
build:unsupported_gpu_linux --action_env=CUDA_TOOLKIT_PATH="/usr/local/cuda-11.2"
build:unsupported_gpu_linux --action_env=LD_LIBRARY_PATH="/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.1/lib64:/usr/local/tensorrt/lib"
build:unsupported_gpu_linux --action_env=GCC_HOST_COMPILER_PATH="/dt9/usr/bin/gcc"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,7 @@ def initialize_rbe_configs():
"TF_CUDNN_VERSION": "8.9",
"TF_ENABLE_XLA": "1",
"TF_NEED_CUDA": "1",
"TF_NEED_TENSORRT": "1",
"TF_SYSROOT": "/dt9",
"TF_TENSORRT_VERSION": "8.6",
},
)

Expand Down Expand Up @@ -720,8 +718,6 @@ def initialize_rbe_configs():
"TF_CUDNN_VERSION": "8.9",
"TF_ENABLE_XLA": "1",
"TF_NEED_CUDA": "1",
"TF_NEED_TENSORRT": "1",
"TF_SYSROOT": "/dt9",
"TF_TENSORRT_VERSION": "8.6",
},
)
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ def _tensorflow_rbe_config(name, compiler, python_versions, os, rocm_version = N
"TF_CUDNN_VERSION": cudnn_version,
"TF_CUDA_VERSION": cuda_version,
"CUDNN_INSTALL_PATH": cudnn_install_path if cudnn_install_path != None else "/usr/lib/x86_64-linux-gnu",
"TF_NEED_TENSORRT": "1",
"TF_TENSORRT_VERSION": tensorrt_version if tensorrt_version != None else "",
"TENSORRT_INSTALL_PATH": tensorrt_install_path if tensorrt_install_path != None else "/usr/lib/x86_64-linux-gnu",
"GCC_HOST_COMPILER_PATH": compiler if not compiler.endswith("clang") else "",
"GCC_HOST_COMPILER_PREFIX": compiler_prefix if compiler_prefix != None else "/usr/bin",
"CLANG_CUDA_COMPILER_PATH": compiler if compiler.endswith("clang") else "",
Expand Down
4 changes: 0 additions & 4 deletions third_party/xla/tools/toolchains/remote_config/configs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -681,9 +681,7 @@ def initialize_rbe_configs():
"TF_CUDNN_VERSION": "8.9",
"TF_ENABLE_XLA": "1",
"TF_NEED_CUDA": "1",
"TF_NEED_TENSORRT": "1",
"TF_SYSROOT": "/dt9",
"TF_TENSORRT_VERSION": "8.6",
},
)

Expand Down Expand Up @@ -720,8 +718,6 @@ def initialize_rbe_configs():
"TF_CUDNN_VERSION": "8.9",
"TF_ENABLE_XLA": "1",
"TF_NEED_CUDA": "1",
"TF_NEED_TENSORRT": "1",
"TF_SYSROOT": "/dt9",
"TF_TENSORRT_VERSION": "8.6",
},
)
3 changes: 0 additions & 3 deletions third_party/xla/tools/toolchains/remote_config/rbe_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ def _tensorflow_rbe_config(name, compiler, python_versions, os, rocm_version = N
"TF_CUDNN_VERSION": cudnn_version,
"TF_CUDA_VERSION": cuda_version,
"CUDNN_INSTALL_PATH": cudnn_install_path if cudnn_install_path != None else "/usr/lib/x86_64-linux-gnu",
"TF_NEED_TENSORRT": "1",
"TF_TENSORRT_VERSION": tensorrt_version if tensorrt_version != None else "",
"TENSORRT_INSTALL_PATH": tensorrt_install_path if tensorrt_install_path != None else "/usr/lib/x86_64-linux-gnu",
"GCC_HOST_COMPILER_PATH": compiler if not compiler.endswith("clang") else "",
"GCC_HOST_COMPILER_PREFIX": compiler_prefix if compiler_prefix != None else "/usr/bin",
"CLANG_CUDA_COMPILER_PATH": compiler if compiler.endswith("clang") else "",
Expand Down

0 comments on commit 182d9b8

Please sign in to comment.