diff --git a/density_functional_approximation_dm21/.bazelrc b/density_functional_approximation_dm21/.bazelrc index e9e2f12..badac13 100644 --- a/density_functional_approximation_dm21/.bazelrc +++ b/density_functional_approximation_dm21/.bazelrc @@ -1,4 +1,4 @@ -# The following configuration has been taken from the TensorFlow 2.5.1 release. +# The following configuration has been taken from the TensorFlow 2.11.0 release. # # TensorFlow Bazel configuration file. # This file tries to group and simplify build options for TensorFlow @@ -24,10 +24,6 @@ # # Compiler options: # cuda_clang: Use clang when building CUDA code. -# c++17: Build with C++17 options (links with libc++) -# c++1z: Build with C++17 options (links with libc++) -# c++17_gcc: Build with C++17 options (links with stdlibc++) -# c++1z_gcc: Build with C++17 options (links with stdlibc++) # avx_linux: Build with avx instruction set on linux. # avx2_linux: Build with avx2 instruction set on linux. # native_arch_linux: Build with instruction sets available to the host machine on linux @@ -43,6 +39,7 @@ # asan: Build with the clang address sanitizer # msan: Build with the clang memory sanitizer # ubsan: Build with the clang undefined behavior sanitizer +# dbg: Build with debug info # # # TF version options; @@ -68,31 +65,34 @@ # rbe_linux: General RBE options used on all linux builds. # rbe_win: General RBE options used on all windows builds. # -# rbe_cpu_linux: RBE options to build with only CPU support. -# rbe_linux_cuda_nvcc_py*: RBE options to build with GPU support using nvcc. +# rbe_cpu_linux: RBE options to build with only CPU support. +# rbe_linux_cuda_nvcc_py*: RBE options to build with GPU support using nvcc. # -# rbe_linux_py2: Linux Python 2 RBE config. -# rbe_linux_py3: Linux Python 3 RBE config +# rbe_linux_py3: Linux Python 3 RBE config # # rbe_win_py37: Windows Python 3.7 RBE config # rbe_win_py38: Windows Python 3.8 RBE config +# rbe_win_py39: Windows Python 3.9 RBE config +# rbe_win_py310: Windows Python 3.10 RBE config # # tensorflow_testing_rbe_linux: RBE options to use RBE with tensorflow-testing project on linux # tensorflow_testing_rbe_win: RBE options to use RBE with tensorflow-testing project on windows # +# rbe_lite_linux: RBE options to build TF Lite. +# # Embedded Linux options (experimental and only tested with TFLite build yet) # elinux: General Embedded Linux options shared by all flavors. # elinux_aarch64: Embedded Linux options for aarch64 (ARM64) CPU support. # elinux_armhf: Embedded Linux options for armhf (ARMv7) CPU support. # # Release build options (for all operating systems) -# release_base: Common options for all builds on all operating systems. -# release_gpu_base: Common options for GPU builds on Linux and Windows. -# release_cpu_linux: Toolchain and CUDA options for Linux CPU builds. -# release_cpu_macos: Toolchain and CUDA options for MacOS CPU builds. -# release_gpu_linux: Toolchain and CUDA options for Linux GPU builds. -# release_cpu_windows: Toolchain and CUDA options for Windows CPU builds. -# release_gpu_windows: Toolchain and CUDA options for Windows GPU builds. +# release_base: Common options for all builds on all operating systems. +# release_gpu_base: Common options for GPU builds on Linux and Windows. +# release_cpu_linux: Toolchain and CUDA options for Linux CPU builds. +# release_cpu_macos: Toolchain and CUDA options for MacOS CPU builds. +# release_gpu_linux: Toolchain and CUDA options for Linux GPU builds. +# release_cpu_windows: Toolchain and CUDA options for Windows CPU builds. +# release_gpu_windows: Toolchain and CUDA options for Windows GPU builds. # Default build options. These are applied first and unconditionally. @@ -100,10 +100,7 @@ # nothing in a bazelrc will default to a monolithic build. The following line # opts in to modular op registration support by default. build --define framework_shared_object=true - -# For workaround https://github.com/bazelbuild/bazel/issues/8772 with Bazel >= 0.29.1 -build --java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain -build --host_java_toolchain=@tf_toolchains//toolchains/java:tf_java_toolchain +build --define tsl_protobuf_header_only=true build --define=use_fast_cpp_protos=true build --define=allow_oversize_protos=true @@ -114,6 +111,7 @@ build -c opt # Make Bazel print out all options from rc files. build --announce_rc +# TODO(mihaimaruseac): Document this option or remove if no longer needed build --define=grpc_no_ares=true # See https://github.com/bazelbuild/bazel/issues/7362 for information on what @@ -130,20 +128,29 @@ build --define=grpc_no_ares=true # archives in -whole_archive -no_whole_archive. build --noincompatible_remove_legacy_whole_archive -# These are bazel 2.0's incompatible flags. Tensorflow needs to use bazel 2.0.0 -# to use cc_shared_library, as part of the Tensorflow Build Improvements RFC: -# https://github.com/tensorflow/community/pull/179 -# build --noincompatible_prohibit_aapt1 - +# TODO(mihaimaruseac): Document this option or remove if no longer needed build --enable_platform_specific_config # Enable XLA support by default. build --define=with_xla_support=true +# TODO(mihaimaruseac): Document this option or remove if no longer needed build --config=short_logs +# TODO(mihaimaruseac): Document this option or remove if no longer needed build --config=v2 +# Disable AWS/HDFS support by default +build --define=no_aws_support=true +build --define=no_hdfs_support=true + +# TF now has `cc_shared_library` targets, so it needs the experimental flag +# TODO(rostam): Remove when `cc_shared_library` is enabled by default +build --experimental_cc_shared_library + +# cc_shared_library ensures no library is linked statically more than once. +build --experimental_link_static_libraries_once=false + # Default options should come above this line. # Allow builds using libc++ as a linker library @@ -181,6 +188,7 @@ build:macos --copt=-DGRPC_BAZEL_BUILD # Settings for MacOS on ARM CPUs. build:macos_arm64 --cpu=darwin_arm64 +build:macos_arm64 --macos_minimum_os=11.0 # iOS configs for each architecture and the fat binary builds. build:ios --apple_platform_type=ios @@ -190,6 +198,8 @@ build:ios_armv7 --config=ios build:ios_armv7 --cpu=ios_armv7 build:ios_arm64 --config=ios build:ios_arm64 --cpu=ios_arm64 +build:ios_sim_arm64 --config=ios +build:ios_sim_arm64 --cpu=ios_sim_arm64 build:ios_i386 --config=ios build:ios_i386 --cpu=ios_i386 build:ios_x86_64 --config=ios @@ -202,6 +212,8 @@ build:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64 # By default, TensorFlow will build with a dependence on # //tensorflow:libtensorflow_framework.so. build:monolithic --define framework_shared_object=false +build:monolithic --define tsl_protobuf_header_only=false +build:monolithic --experimental_link_static_libraries_once=false # b/229868128 # Please note that MKL on MacOS or windows is still not supported. # If you would like to use a local MKL instead of downloading, please set the @@ -218,13 +230,16 @@ build:mkl_threadpool --define=build_with_mkl_opensource=true build:mkl_threadpool -c opt # Config setting to build oneDNN with Compute Library for the Arm Architecture (ACL). -# This build is for the inference regime only. -build:mkl_aarch64 --define=build_with_mkl_aarch64=true --define=enable_mkl=true -build:mkl_aarch64 --define=tensorflow_mkldnn_contraction_kernel=0 -build:mkl_aarch64 --define=build_with_mkl_opensource=true +build:mkl_aarch64 --define=build_with_mkl_aarch64=true build:mkl_aarch64 --define=build_with_openmp=true +build:mkl_aarch64 --define=build_with_acl=true build:mkl_aarch64 -c opt +# Config setting to build oneDNN with Compute Library for the Arm Architecture (ACL). +# with Eigen threadpool support +build:mkl_aarch64_threadpool --define=build_with_mkl_aarch64=true +build:mkl_aarch64_threadpool -c opt + # This config refers to building CUDA op kernels with nvcc. build:cuda --repo_env TF_NEED_CUDA=1 build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain @@ -237,6 +252,14 @@ build:cuda_clang --@local_config_cuda//:cuda_compiler=clang # Debug config build:dbg -c dbg +# Only include debug info for files under tensorflow/, excluding kernels, to +# reduce the size of the debug info in the binary. This is because if the debug +# sections in the ELF binary are too large, errors can occur. See +# https://github.com/tensorflow/tensorflow/issues/48919. +# Users can still include debug info for a specific kernel, e.g. with: +# --config=dbg --per_file_copt=+tensorflow/core/kernels/identity_op.*@-g +build:dbg --per_file_copt=+.*,-tensorflow.*@-g0 +build:dbg --per_file_copt=+tensorflow/core/kernels.*@-g0 # for now, disable arm_neon. see: https://github.com/tensorflow/tensorflow/issues/33360 build:dbg --cxxopt -DTF_LITE_DISABLE_X86_NEON # AWS SDK must be compiled in release mode. see: https://github.com/tensorflow/tensorflow/issues/37498 @@ -248,8 +271,11 @@ build:tpu --define=with_tpu_support=true build:tensorrt --repo_env TF_NEED_TENSORRT=1 build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain -build:rocm --define=using_rocm=true --define=using_rocm_hipcc=true +build:rocm --define=using_rocm_hipcc=true +build:rocm --define=tensorflow_mkldnn_contraction_kernel=0 build:rocm --repo_env TF_NEED_ROCM=1 +# Disable unused-result on rocm builds. +build:rocm --copt="-Wno-error=unused-result" # Options extracted from configure script build:numa --define=with_numa_support=true @@ -266,30 +292,53 @@ build:stackdriver_support --define=stackdriver_support=true build:dynamic_kernels --define=dynamic_loaded_kernels=true build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS -# Build TF with C++ 17 features. -build:c++17 --cxxopt=-std=c++1z -build:c++17 --cxxopt=-stdlib=libc++ -build:c++1z --config=c++17 -build:c++17_gcc --cxxopt=-std=c++1z -build:c++1z_gcc --config=c++17_gcc - # Don't trigger --config= when cross-compiling. build:android --noenable_platform_specific_config build:ios --noenable_platform_specific_config -# Suppress C++ compiler warnings, otherwise build logs become 10s of MBs. +# Suppress all C++ compiler warnings, otherwise build logs become 10s of MBs. build:android --copt=-w build:ios --copt=-w -build:linux --copt=-w build:linux --host_copt=-w build:macos --copt=-w build:windows --copt=/W0 +build:windows --host_copt=/W0 + +# Suppress most C++ complier warnings to reduce log size but allow +# for specific warnings to still be present. +build:linux --copt="-Wno-all" +build:linux --copt="-Wno-extra" +build:linux --copt="-Wno-deprecated" +build:linux --copt="-Wno-deprecated-declarations" +build:linux --copt="-Wno-ignored-attributes" +build:linux --copt="-Wno-unknown-warning" +build:linux --copt="-Wno-array-parameter" +build:linux --copt="-Wno-stringop-overflow" +build:linux --copt="-Wno-array-bounds" + +# Add unused-result as an error on Linux. +build:linux --copt="-Wunused-result" +build:linux --copt="-Werror=unused-result" + +# On Windows, `__cplusplus` is wrongly defined without this switch +# See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ +build:windows --copt=/Zc:__cplusplus +build:windows --host_copt=/Zc:__cplusplus # Tensorflow uses M_* math constants that only get defined by MSVC headers if # _USE_MATH_DEFINES is defined. build:windows --copt=/D_USE_MATH_DEFINES build:windows --host_copt=/D_USE_MATH_DEFINES +# Windows has a relatively short command line limit, which TF has begun to hit. +# See https://docs.bazel.build/versions/main/windows.html +build:windows --features=compiler_param_file + +# Speed Windows compile times. Available in VS 16.4 (we are on 16.11). See +# https://groups.google.com/a/tensorflow.org/d/topic/build/SsW98Eo7l3o/discussion +build:windows --copt=/d2ReducedOptimizeHugeFunctions +build:windows --host_copt=/d2ReducedOptimizeHugeFunctions + # Default paths for TF_SYSTEM_LIBS build:linux --define=PREFIX=/usr build:linux --define=LIBDIR=$(PREFIX)/lib @@ -337,13 +386,22 @@ build:windows --linkopt=/OPT:REF build:windows --host_linkopt=/OPT:REF build:windows --linkopt=/OPT:ICF build:windows --host_linkopt=/OPT:ICF -build:windows --experimental_strict_action_env=true # Verbose failure logs when something goes wrong build:windows --verbose_failures +# Work around potential issues with large command lines on windows. +# See: https://github.com/bazelbuild/bazel/issues/5163 +build:windows --features=compiler_param_file + # On windows, we never cross compile build:windows --distinct_host_configuration=false +# On linux, don't cross compile by default +build:linux --distinct_host_configuration=false + +# Do not risk cache corruption. See: +# https://github.com/bazelbuild/bazel/issues/3360 +build:linux --experimental_guard_against_concurrent_changes # Configure short or long logs build:short_logs --output_filter=DONT_MATCH_ANYTHING @@ -364,7 +422,7 @@ build:v1 --define=tf_api_version=1 --action_env=TF2_BEHAVIOR=0 build:v2 --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1 # Disable XLA on mobile. -build:xla --define=with_xla_supprt=true # TODO: remove, it's on by default. +build:xla --define=with_xla_support=true # TODO: remove, it's on by default. build:android --define=with_xla_support=false build:ios --define=with_xla_support=false @@ -383,7 +441,7 @@ build:rbe --bes_timeout=600s build:rbe --define=EXECUTOR=remote build:rbe --distinct_host_configuration=false build:rbe --flaky_test_attempts=3 -build:rbe --jobs=200 +build:rbe --jobs=800 build:rbe --remote_executor=grpcs://remotebuildexecution.googleapis.com build:rbe --remote_timeout=3600 build:rbe --spawn_strategy=remote,worker,standalone,local @@ -392,13 +450,10 @@ test:rbe --test_env=USER=anon # workers: build:rbe --remote_download_toplevel -build:rbe_linux --config=rbe -build:rbe_linux --action_env=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" -build:rbe_linux --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 -build:rbe_linux --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8 -build:rbe_linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 -build:rbe_linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8 +build:rbe_linux_base --config=rbe +build:rbe_linux_base --action_env=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin" +build:rbe_linux --config=rbe_linux_base # Non-rbe settings we should include because we do not run configure build:rbe_linux --config=avx_linux # TODO(gunan): Check why we need this specified in rbe, but not in other builds. @@ -407,14 +462,22 @@ build:rbe_linux --host_linkopt=-lrt build:rbe_linux --linkopt=-lm build:rbe_linux --host_linkopt=-lm +# Use the GPU toolchain until the CPU one is ready. +# https://github.com/bazelbuild/bazel/issues/13623 +build:rbe_cpu_linux_base --host_crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" +build:rbe_cpu_linux_base --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" +build:rbe_cpu_linux_base --extra_toolchains="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64" +build:rbe_cpu_linux_base --extra_execution_platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_cpu_linux_base --host_platform="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_cpu_linux_base --platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" + build:rbe_cpu_linux --config=rbe_linux -build:rbe_cpu_linux --host_crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain" -build:rbe_cpu_linux --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain" -build:rbe_cpu_linux --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:cc-toolchain-k8" -build:rbe_cpu_linux --extra_execution_platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" -build:rbe_cpu_linux --extra_execution_platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" -build:rbe_cpu_linux --host_platform="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" -build:rbe_cpu_linux --platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform" +build:rbe_cpu_linux --config=rbe_cpu_linux_base + +build:rbe_lite_linux --config=rbe_linux_base +build:rbe_lite_linux --config=rbe_cpu_linux_base +build:rbe_lite_linux --config=rbe_linux_py3_base +build:rbe_lite_linux --noexperimental_check_desugar_deps build:rbe_linux_cuda_base --config=rbe_linux build:rbe_linux_cuda_base --config=cuda @@ -422,89 +485,89 @@ build:rbe_linux_cuda_base --config=tensorrt build:rbe_linux_cuda_base --action_env=TF_CUDA_VERSION=11 build:rbe_linux_cuda_base --action_env=TF_CUDNN_VERSION=8 build:rbe_linux_cuda_base --repo_env=REMOTE_GPU_TESTING=1 -test:rbe_linux_cuda_base --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64" +# TensorRT 7 for CUDA 11.1 is compatible with CUDA 11.2, but requires +# libnvrtc.so.11.1. See https://github.com/NVIDIA/TensorRT/issues/1064. +# TODO(b/187962120): Remove when upgrading to TensorRT 8. +test:rbe_linux_cuda_base --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/cuda-11.1/lib64" build:rbe_linux_cuda11.2_nvcc_base --config=rbe_linux_cuda_base -build:rbe_linux_cuda11.2_nvcc_base --host_crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" -build:rbe_linux_cuda11.2_nvcc_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" -build:rbe_linux_cuda11.2_nvcc_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64" -build:rbe_linux_cuda11.2_nvcc_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" -build:rbe_linux_cuda11.2_nvcc_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" -build:rbe_linux_cuda11.2_nvcc_base --platforms="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" -build:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda" -build:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_tensorrt" -build:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_nccl" -build:rbe_linux_cuda11.2_nvcc_py3.6 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.6" -build:rbe_linux_cuda11.2_nvcc_py3.7 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.7" -build:rbe_linux_cuda11.2_nvcc_py3.8 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.8" -build:rbe_linux_cuda11.2_nvcc_py3.9 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9" +build:rbe_linux_cuda11.2_nvcc_base --host_crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda11.2_nvcc_base --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda11.2_nvcc_base --extra_toolchains="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64" +build:rbe_linux_cuda11.2_nvcc_base --extra_execution_platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_linux_cuda11.2_nvcc_base --host_platform="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_linux_cuda11.2_nvcc_base --platforms="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda" +build:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_tensorrt" +build:rbe_linux_cuda11.2_nvcc_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_nccl" +build:rbe_linux_cuda11.2_nvcc_py3.7 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.7" +build:rbe_linux_cuda11.2_nvcc_py3.8 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.8" +build:rbe_linux_cuda11.2_nvcc_py3.9 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9" +build:rbe_linux_cuda11.2_nvcc_py3.10 --config=rbe_linux_cuda11.2_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.10" # Map default to CUDA 11.2. -build:rbe_linux_cuda_nvcc_py36 --config=rbe_linux_cuda11.2_nvcc_py3.6 build:rbe_linux_cuda_nvcc_py37 --config=rbe_linux_cuda11.2_nvcc_py3.7 build:rbe_linux_cuda_nvcc_py38 --config=rbe_linux_cuda11.2_nvcc_py3.8 build:rbe_linux_cuda_nvcc_py39 --config=rbe_linux_cuda11.2_nvcc_py3.9 +build:rbe_linux_cuda_nvcc_py310 --config=rbe_linux_cuda11.2_nvcc_py3.10 # Deprecated configs that people might still use. -build:rbe_linux_cuda_nvcc --config=rbe_linux_cuda_nvcc_py36 +build:rbe_linux_cuda_nvcc --config=rbe_linux_cuda_nvcc_py39 build:rbe_gpu_linux --config=rbe_linux_cuda_nvcc build:rbe_linux_cuda_clang_base --config=rbe_linux_cuda_base build:rbe_linux_cuda_clang_base --repo_env TF_CUDA_CLANG=1 build:rbe_linux_cuda_clang_base --@local_config_cuda//:cuda_compiler=clang -build:rbe_linux_cuda_clang_base --crosstool_top="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" -build:rbe_linux_cuda_clang_base --extra_toolchains="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64" -build:rbe_linux_cuda_clang_base --extra_execution_platforms="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" -build:rbe_linux_cuda_clang_base --host_platform="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" -build:rbe_linux_cuda_clang_base --platforms="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" -build:rbe_linux_cuda_clang_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda" -build:rbe_linux_cuda_clang_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_tensorrt" -build:rbe_linux_cuda_clang_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_nccl" -build:rbe_linux_cuda_clang_py27 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python2.7" -build:rbe_linux_cuda_clang_py35 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.5" -build:rbe_linux_cuda_clang_py36 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.6" -build:rbe_linux_cuda_clang_py37 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.7" -build:rbe_linux_cuda_clang_py38 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.8" +build:rbe_linux_cuda_clang_base --crosstool_top="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" +build:rbe_linux_cuda_clang_base --extra_toolchains="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain-linux-x86_64" +build:rbe_linux_cuda_clang_base --extra_execution_platforms="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_linux_cuda_clang_base --host_platform="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_linux_cuda_clang_base --platforms="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_platform//:platform" +build:rbe_linux_cuda_clang_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda" +build:rbe_linux_cuda_clang_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_tensorrt" +build:rbe_linux_cuda_clang_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_nccl" +build:rbe_linux_cuda_clang_py37 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.7" +build:rbe_linux_cuda_clang_py38 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.8" +build:rbe_linux_cuda_clang_py39 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9" +build:rbe_linux_cuda_clang_py310 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-clang_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.10" # ROCm +build:rbe_linux_rocm_base --config=rocm build:rbe_linux_rocm_base --config=rbe_linux -build:rbe_linux_rocm_base --repo_env=TF_NEED_ROCM=1 -build:rbe_linux_rocm_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm//crosstool:toolchain" -build:rbe_linux_rocm_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm//crosstool:toolchain-linux-x86_64" -build:rbe_linux_rocm_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform" -build:rbe_linux_rocm_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform" -build:rbe_linux_rocm_base --platforms="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform" -build:rbe_linux_rocm_base --action_env=TF_ROCM_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm" -build:rbe_linux_rocm_base --define=using_rocm_hipcc=true -build:rbe_linux_rocm_py2.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python2.7" -build:rbe_linux_rocm_py3.5 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.5" -build:rbe_linux_rocm_py3.6 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.6" -build:rbe_linux_rocm_py3.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.7" -build:rbe_linux_rocm_py3.8 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.8" +build:rbe_linux_rocm_base --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-rocm_config_rocm//crosstool:toolchain" +build:rbe_linux_rocm_base --extra_toolchains="@ubuntu20.04-gcc9_manylinux2014-rocm_config_rocm//crosstool:toolchain-linux-x86_64" +build:rbe_linux_rocm_base --extra_execution_platforms="@ubuntu20.04-gcc9_manylinux2014-rocm_config_platform//:platform" +build:rbe_linux_rocm_base --host_platform="@ubuntu20.04-gcc9_manylinux2014-rocm_config_platform//:platform" +build:rbe_linux_rocm_base --platforms="@ubuntu20.04-gcc9_manylinux2014-rocm_config_platform//:platform" +build:rbe_linux_rocm_base --action_env=TF_ROCM_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_rocm" +build:rbe_linux_rocm_py3.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.7" +build:rbe_linux_rocm_py3.8 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.8" +build:rbe_linux_rocm_py3.9 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.9" +build:rbe_linux_rocm_py3.10 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-rocm_config_python3.10" # Linux CPU -build:rbe_linux_py2 --config=rbe_linux -build:rbe_linux_py2 --repo_env=PYTHON_BIN_PATH="/usr/bin/python2" -build:rbe_linux_py2 --python_path="/usr/bin/python2" -build:rbe_linux_py2 --repo_env=TF_PYTHON_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/py" build:rbe_linux_py3 --config=rbe_linux -build:rbe_linux_py3 --python_path="/usr/bin/python3" -build:rbe_linux_py3 --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-manylinux2010-py3_config_python" +build:rbe_linux_py3 --config=rbe_linux_py3_base +build:rbe_linux_py3_base --python_path="/usr/local/bin/python3.9" +build:rbe_linux_py3_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_python3.9" build:rbe_win --config=rbe -build:rbe_win --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/win/tf_win_08062020:toolchain" -build:rbe_win --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/win/tf_win_08062020:cc-toolchain-x64_windows" -build:rbe_win --host_javabase="@org_tensorflow//third_party/toolchains/preconfig/win:windows_jdk8" -build:rbe_win --javabase="@org_tensorflow//third_party/toolchains/preconfig/win:windows_jdk8" -build:rbe_win --extra_execution_platforms="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019" -build:rbe_win --host_platform="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019" -build:rbe_win --platforms="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019" +build:rbe_win --crosstool_top="//tensorflow/tools/toolchains/win/tf_win_06152022:toolchain" +build:rbe_win --extra_toolchains="//tensorflow/tools/toolchains/win/tf_win_06152022:cc-toolchain-x64_windows" +build:rbe_win --extra_execution_platforms="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019" +build:rbe_win --host_platform="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019" +build:rbe_win --platforms="//tensorflow/tools/toolchains/win:rbe_windows_ltsc2019" build:rbe_win --shell_executable=C:\\tools\\msys64\\usr\\bin\\bash.exe +build:rbe_win --experimental_strict_action_env=true # TODO(gunan): Remove once we use MSVC 2019 with latest patches. build:rbe_win --define=override_eigen_strong_inline=true -build:rbe_win --jobs=100 + +# Don't build the python zip archive in the RBE build. +build:rbe_win --remote_download_minimal +build:rbe_win --enable_runfiles +build:rbe_win --nobuild_python_zip build:rbe_win_py37 --config=rbe build:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO="@windows_py37_config_python" @@ -513,13 +576,27 @@ build:rbe_win_py37 --python_path=C:\\Python37\\python.exe build:rbe_win_py38 --config=rbe build:rbe_win_py38 --repo_env=PYTHON_BIN_PATH=C:\\Python38\\python.exe build:rbe_win_py38 --repo_env=PYTHON_LIB_PATH=C:\\Python38\\lib\\site-packages -build:rbe_win_py38 --repo_env=TF_PYTHON_CONFIG_REPO=@org_tensorflow//third_party/toolchains/preconfig/win_1803/py38 +build:rbe_win_py38 --repo_env=TF_PYTHON_CONFIG_REPO=//tensorflow/tools/toolchains/win_1803/py38 build:rbe_win_py38 --python_path=C:\\Python38\\python.exe +build:rbe_win_py39 --config=rbe +build:rbe_win_py39 --repo_env=PYTHON_BIN_PATH=C:\\Python39\\python.exe +build:rbe_win_py39 --repo_env=PYTHON_LIB_PATH=C:\\Python39\\lib\\site-packages +build:rbe_win_py39 --repo_env=TF_PYTHON_CONFIG_REPO=//tensorflow/tools/toolchains/win_1803/py39 +build:rbe_win_py39 --python_path=C:\\Python39\\python.exe + +build:rbe_win_py310 --config=rbe +build:rbe_win_py310 --repo_env=PYTHON_BIN_PATH=C:\\Python310\\python.exe +build:rbe_win_py310 --repo_env=PYTHON_LIB_PATH=C:\\Python310\\lib\\site-packages +build:rbe_win_py310 --repo_env=TF_PYTHON_CONFIG_REPO=//tensorflow/tools/toolchains/win_1803/py310 +build:rbe_win_py310 --python_path=C:\\Python310\\python.exe + # These you may need to change for your own GCP project. build:tensorflow_testing_rbe --project_id=tensorflow-testing common:tensorflow_testing_rbe_linux --remote_instance_name=projects/tensorflow-testing/instances/default_instance build:tensorflow_testing_rbe_linux --config=tensorflow_testing_rbe +# Build GPU binaries for the RBE test machines (Tesla T4s). +build:tensorflow_testing_rbe_linux --repo_env=TF_CUDA_COMPUTE_CAPABILITIES=sm_75 common:tensorflow_testing_rbe_win --remote_instance_name=projects/tensorflow-testing/instances/windows build:tensorflow_testing_rbe_win --config=tensorflow_testing_rbe @@ -529,8 +606,11 @@ build:elinux --crosstool_top=@local_config_embedded_arm//:toolchain build:elinux --host_crosstool_top=@bazel_tools//tools/cpp:toolchain build:elinux_aarch64 --config=elinux build:elinux_aarch64 --cpu=aarch64 +build:elinux_aarch64 --distinct_host_configuration=true build:elinux_armhf --config=elinux build:elinux_armhf --cpu=armhf +build:elinux_armhf --distinct_host_configuration=true +build:elinux_armhf --copt -mfp16-format=ieee # END TF REMOTE BUILD EXECUTION OPTIONS # Config-specific options should come above this line. @@ -549,7 +629,7 @@ test:release_base --test_size_filters=small,medium build:release_cpu_linux --config=release_base build:release_cpu_linux --config=avx_linux -build:release_cpu_linux --crosstool_top=@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda11.2:toolchain +build:release_cpu_linux --crosstool_top="@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain" test:release_cpu_linux --test_env=LD_LIBRARY_PATH build:release_cpu_macos --config=release_base @@ -564,16 +644,13 @@ build:release_gpu_linux --config=release_cpu_linux build:release_gpu_linux --config=release_gpu_base build:release_gpu_linux --config=tensorrt build:release_gpu_linux --action_env=CUDA_TOOLKIT_PATH="/usr/local/cuda-11.2" -build:release_gpu_linux --action_env=LD_LIBRARY_PATH="/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/tensorrt/lib" -build:release_gpu_linux --action_env=GCC_HOST_COMPILER_PATH="/usr/bin/gcc-5" -build:release_gpu_linux --crosstool_top=@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda11.2:toolchain +build:release_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:release_gpu_linux --action_env=GCC_HOST_COMPILER_PATH="/dt9/usr/bin/gcc" +build:release_gpu_linux --crosstool_top=@ubuntu20.04-gcc9_manylinux2014-cuda11.2-cudnn8.1-tensorrt7.2_config_cuda//crosstool:toolchain build:release_cpu_windows --config=release_base build:release_cpu_windows --config=avx_win build:release_cpu_windows --define=no_tensorflow_py_deps=true -# First available in VS 16.4. Speeds Windows compile times by a lot. See -# https://groups.google.com/a/tensorflow.org/d/topic/build/SsW98Eo7l3o/discussion -build:release_cpu_windows --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions build:release_gpu_windows --config=release_cpu_windows build:release_gpu_windows --config=release_gpu_base @@ -592,7 +669,7 @@ build:asan --linkopt -fsanitize=address # CC=clang bazel build --config msan build:msan --strip=never build:msan --copt -fsanitize=memory -build:msan --copt -DADDRESS_SANITIZER +build:msan --copt -DMEMORY_SANITIZER build:msan --copt -g build:msan --copt -O3 build:msan --copt -fno-omit-frame-pointer @@ -602,8 +679,15 @@ build:msan --linkopt -fsanitize=memory # CC=clang bazel build --config ubsan build:ubsan --strip=never build:ubsan --copt -fsanitize=undefined +build:ubsan --copt -DUNDEFINED_BEHAVIOR_SANITIZER build:ubsan --copt -g build:ubsan --copt -O3 build:ubsan --copt -fno-omit-frame-pointer build:ubsan --linkopt -fsanitize=undefined build:ubsan --linkopt -lubsan + +# Disable TFRT integration for now unless --config=tfrt is specified. +build --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils +# TODO(b/240450920): We are in the process of migrating JitRt backend to XLA +# and while we are doing this we can't keep it buildable/testable in OSS. +build:tfrt --deleted_packages=tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/jit/python_binding,tensorflow/compiler/mlir/tfrt/jit/transforms,tensorflow/compiler/mlir/tfrt/python_tests,tensorflow/compiler/mlir/tfrt/tests,tensorflow/compiler/mlir/tfrt/tests/ir,tensorflow/compiler/mlir/tfrt/tests/analysis,tensorflow/compiler/mlir/tfrt/tests/jit,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_tfrt,tensorflow/compiler/mlir/tfrt/tests/lhlo_to_jitrt,tensorflow/compiler/mlir/tfrt/tests/tf_to_corert,tensorflow/compiler/mlir/tfrt/tests/tf_to_tfrt_data,tensorflow/compiler/mlir/tfrt/tests/saved_model,tensorflow/compiler/mlir/tfrt/transforms/lhlo_gpu_to_tfrt_gpu,tensorflow/core/runtime_fallback,tensorflow/core/runtime_fallback/conversion,tensorflow/core/runtime_fallback/kernel,tensorflow/core/runtime_fallback/opdefs,tensorflow/core/runtime_fallback/runtime,tensorflow/core/runtime_fallback/util,tensorflow/core/tfrt/common,tensorflow/core/tfrt/eager,tensorflow/core/tfrt/eager/backends/cpu,tensorflow/core/tfrt/eager/backends/gpu,tensorflow/core/tfrt/eager/core_runtime,tensorflow/core/tfrt/eager/cpp_tests/core_runtime,tensorflow/core/tfrt/gpu,tensorflow/core/tfrt/run_handler_thread_pool,tensorflow/core/tfrt/runtime,tensorflow/core/tfrt/saved_model,tensorflow/core/tfrt/graph_executor,tensorflow/core/tfrt/saved_model/tests,tensorflow/core/tfrt/tpu,tensorflow/core/tfrt/utils diff --git a/density_functional_approximation_dm21/.bazelversion b/density_functional_approximation_dm21/.bazelversion new file mode 100644 index 0000000..03f488b --- /dev/null +++ b/density_functional_approximation_dm21/.bazelversion @@ -0,0 +1 @@ +5.3.0 diff --git a/density_functional_approximation_dm21/README.md b/density_functional_approximation_dm21/README.md index f8d8bf3..6ca5253 100644 --- a/density_functional_approximation_dm21/README.md +++ b/density_functional_approximation_dm21/README.md @@ -113,15 +113,14 @@ be found in the paper (reference below). Note that the results in our paper also include D3 corrections, which must be [included separately](https://pyscf.org/user/dft.html#dispersion-corrections). - ### Best practices for using the neural functionals. In this section, we suggest some tips for using the neural functionals in a way similar to how they were used for benchmarking in the paper. The tensorflow -network that we used is running at single precision, and as such it is very -hard to converge calculations to the high convergence thresholds which are -default in pyscf. For example, the following script should allow users to -run an atomization energy calculation for methane. +network that we used is running at single precision, and as such it is very hard +to converge calculations to the high convergence thresholds which are default in +pyscf. For example, the following script should allow users to run an +atomization energy calculation for methane. ```python import density_functional_approximation_dm21 as dm21 @@ -178,17 +177,16 @@ print({'CH4': energies[0], 'C': energies[1], 'H': energies[2]}) ``` This script should produce three energies (in Hartrees) for the water molecule -and the two atoms of -`{'CH4': -40.51785372584538, 'C': -37.84542045526023, 'H': -0.5011533955627797}` -, this leads to an atomization energy of 419.06 kcal/mol, which is then -corrected with the D3(BJ) correction for methane (1.20 kcal/mol) to yield a -predicted atomization energy of 420.26 kcal/mol. Comparing this to the -literature value of 420.42, leads us to deduce an error of around 0.2 kcal/mol. - -It should also be noted that if a closed shell system is run unrestricted it -can give a small difference between spin densities and eigenvalues with a -negligible effect on the energy. +and the two atoms of `{'CH4': -40.51785372584538, 'C': -37.84542045526023, 'H': +-0.5011533955627797}` , this leads to an atomization energy of 419.06 kcal/mol, +which is then corrected with the D3(BJ) correction for methane (1.20 kcal/mol) +to yield a predicted atomization energy of 420.26 kcal/mol. Comparing this to +the literature value of 420.42, leads us to deduce an error of around 0.2 +kcal/mol. +It should also be noted that if a closed shell system is run unrestricted it can +give a small difference between spin densities and eigenvalues with a negligible +effect on the energy. ## Using DM21 from C++ @@ -210,10 +208,10 @@ library is provided in `cc/dm21_aot_compiled_example.cc`. This requires a link-time dependency on parts of the `xla_compiled_cpu_runtime_standalone` library, which are not included in the compiled functional library. The easiest way to build this is to use [Bazel](https://bazel.build). The first step is to -[install Bazel](https://docs.bazel.build/versions/4.2.0/install.html). +[install Bazel](https://docs.bazel.build/versions/5.3.0/install.html). [Bazelisk](https://docs.bazel.build/versions/main/install-bazelisk.html) is another way to install Bazel if a native installer is not available. The -following has been tested with Bazel 4.2.0. It is best to continue working +following has been tested with Bazel 5.3.0. It is best to continue working inside a virtual environment. Assuming the above installation steps using `git clone` have been followed, and @@ -221,7 +219,7 @@ Assuming the above installation steps using `git clone` have been followed, and ``` pip install -r requirements_aot_compilation.txt -bazel run --experimental_repo_remote_exec :run_dm21_aot_compiled_example +bazel run --experimental_cc_shared_library --experimental_repo_remote_exec :run_dm21_aot_compiled_example ``` where the `pip install` command is only required if a fresh virtual environment diff --git a/density_functional_approximation_dm21/WORKSPACE.bazel b/density_functional_approximation_dm21/WORKSPACE.bazel index 02455dc..939a850 100644 --- a/density_functional_approximation_dm21/WORKSPACE.bazel +++ b/density_functional_approximation_dm21/WORKSPACE.bazel @@ -20,25 +20,16 @@ pip_install( http_archive( name = "io_abseil_py", - strip_prefix = "abseil-py-pypi-v0.15.0", - urls = ["https://github.com/abseil/abseil-py/archive/pypi-v0.15.0.tar.gz"], -) - -http_archive( - name = "six_archive", - build_file = "@io_abseil_py//third_party:six.BUILD", - strip_prefix = "six-1.12.0", - urls = [ - "https://pypi.python.org/packages/source/s/six/six-1.12.0.tar.gz", - ], + strip_prefix = "abseil-py-1.4.0", + urls = ["https://github.com/abseil/abseil-py/archive/refs/tags/v1.4.0.tar.gz"], ) http_archive( name = "org_tensorflow", patch_args = ["-p1"], patches = ["tf_bazel.patch"], - strip_prefix = "tensorflow-2.10.0", - urls = ["https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.10.0.tar.gz"], + strip_prefix = "tensorflow-2.11.0", + urls = ["https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.11.0.tar.gz"], ) # The cascade of load() statements and tf_workspace?() calls works around the diff --git a/density_functional_approximation_dm21/external/tf_bazel.patch b/density_functional_approximation_dm21/external/tf_bazel.patch index a31df8f..57eb0ce 100644 --- a/density_functional_approximation_dm21/external/tf_bazel.patch +++ b/density_functional_approximation_dm21/external/tf_bazel.patch @@ -6,23 +6,36 @@ Subject: [PATCH] Set dependencies for saved_model_compile_aot rule, tensorflow, and absl version. --- - tensorflow/compiler/tf2xla/BUILD | 2 +- - tensorflow/python/tools/tools.bzl | 4 ++-- - 2 files changed, 3 insertions(+), 3 deletions(-) + tensorflow/compiler/tf2xla/BUILD | 2 +- + tensorflow/compiler/xla/mlir/ir/runtime/BUILD | 1 + + tensorflow/python/tools/tools.bzl | 4 ++-- + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tensorflow/compiler/tf2xla/BUILD b/tensorflow/compiler/tf2xla/BUILD index cfe63b16675..cd273aaf29e 100644 --- a/tensorflow/compiler/tf2xla/BUILD +++ b/tensorflow/compiler/tf2xla/BUILD @@ -235,7 +235,7 @@ cc_library( - copts = runtime_copts() + tf_openmp_copts(), - features = ["fully_static_link"], + "-parse_headers", + ], linkstatic = 1, - visibility = [":friends"], + visibility = ["//visibility:public"], # Note, we specifically removed MKL and multithreaded dependencies so the # standalone does not require the MKL binary blob or threading libraries. # +diff --git a/tensorflow/compiler/xla/mlir/ir/runtime/BUILD b/tensorflow/compiler/xla/mlir/ir/runtime/BUILD +index 8c693fa5d49..bf95a3de622 100644 +--- a/tensorflow/compiler/xla/mlir/ir/runtime/BUILD ++++ b/tensorflow/compiler/xla/mlir/ir/runtime/BUILD +@@ -90,6 +90,7 @@ cc_library( + "rt_ops.h", + ], + compatible_with = get_compatible_with_cloud(), ++ visibility = ["//visibility:public"], + deps = [ + ":rt_inc_gen", + "//tensorflow/compiler/xla/runtime:constraints", diff --git a/tensorflow/python/tools/tools.bzl b/tensorflow/python/tools/tools.bzl index db886746006..bc597e29de9 100644 --- a/tensorflow/python/tools/tools.bzl diff --git a/density_functional_approximation_dm21/requirements.txt b/density_functional_approximation_dm21/requirements.txt index 53d2b77..1d14a05 100644 --- a/density_functional_approximation_dm21/requirements.txt +++ b/density_functional_approximation_dm21/requirements.txt @@ -1,9 +1,9 @@ -absl-py==0.13.0 -attrs==21.2.0 -h5py==3.7.0 -numpy==1.23.4 +absl-py==1.4.0 +attrs==22.2.0 +h5py==3.8.0 +numpy==1.24.1 pyscf==2.1.1 pytest==6.2.4 scipy==1.9.3 -tensorflow==2.10.0 +tensorflow==2.11.0 tensorflow-hub==0.12.0 diff --git a/density_functional_approximation_dm21/requirements_aot_compilation.txt b/density_functional_approximation_dm21/requirements_aot_compilation.txt index 58bb630..6675e6f 100644 --- a/density_functional_approximation_dm21/requirements_aot_compilation.txt +++ b/density_functional_approximation_dm21/requirements_aot_compilation.txt @@ -1,3 +1,3 @@ Keras-Preprocessing==1.1.2 -numpy==1.23.4 -tensorflow-estimator==2.10.0 +numpy==1.24.1 +tensorflow-estimator==2.11.0