• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# TensorFlow Bazel configuration file.
2# This file tries to group and simplify build options for TensorFlow
3#
4# ----CONFIG OPTIONS----
5# Android options:
6#    android:
7#    android_arm:
8#    android_arm64:
9#    android_x86:
10#    android_x86_64:
11#
12# iOS options:
13#     ios:
14#     ios_armv7:
15#     ios_arm64:
16#     ios_i386:
17#     ios_x86_64:
18#     ios_fat:
19#
20# Macosx options
21#     darwin_arm64:
22#
23# Compiler options:
24#     cuda_clang:             Use clang when building CUDA code.
25#     c++17:                  Build with C++17 options (links with libc++)
26#     c++1z:                  Build with C++17 options (links with libc++)
27#     c++17_gcc:              Build with C++17 options (links with stdlibc++)
28#     c++1z_gcc:              Build with C++17 options (links with stdlibc++)
29#     avx_linux:              Build with avx instruction set on linux.
30#     avx2_linux:             Build with avx2 instruction set on linux.
31#     native_arch_linux:      Build with instruction sets available to the host machine on linux
32#     avx_win:                Build with avx instruction set on windows
33#     avx2_win:               Build with avx2 instruction set on windows
34#
35# Other build options:
36#     short_logs:       Only log errors during build, skip warnings.
37#     verbose_logs:     Show all compiler warnings during build.
38#     monolithic:       Build all TF C++ code into a single shared object.
39#     dynamic_kernels:  Try to link all kernels dynamically (experimental).
40#     libc++:           Link against libc++ instead of stdlibc++
41#     asan:             Build with the clang address sanitizer
42#     msan:             Build with the clang memory sanitizer
43#     ubsan:            Build with the clang undefined behavior sanitizer
44#
45#
46# TF version options;
47#     v1: Build TF V1 (without contrib)
48#     v2: Build TF v2
49#
50# Feature and Third party library support options:
51#     xla:          Build TF with XLA
52#     tpu:          Build TF with TPU support
53#     using_cuda:   CUDA is available to build system.
54#     cuda:         Build with full cuda support.
55#     rocm:         Build with AMD GPU support (rocm).
56#     mkl:          Enable full mkl support.
57#     tensorrt:     Enable Tensorrt support.
58#     numa:         Enable numa using hwloc.
59#     noaws:        Disable AWS S3 storage support
60#     nogcp:        Disable GCS support.
61#     nohdfs:       Disable hadoop hdfs support.
62#     nonccl:       Disable nccl support.
63#
64#
65# Remote build execution options (only configured to work with TF team projects for now.)
66#     rbe:       General RBE options shared by all flavors.
67#     rbe_linux: General RBE options used on all linux builds.
68#     rbe_win:   General RBE options used on all windows builds.
69#
70#     rbe_cpu_linux:           RBE options to build with only CPU support.
71#     rbe_linux_cuda_nvcc_py*: RBE options to build with GPU support using nvcc.
72#
73#     rbe_linux_py2: Linux Python 2 RBE config.
74#     rbe_linux_py3: Linux Python 3 RBE config
75#
76#     rbe_win_py37: Windows Python 3.7 RBE config
77#     rbe_win_py38: Windows Python 3.8 RBE config
78#
79#     tensorflow_testing_rbe_linux: RBE options to use RBE with tensorflow-testing project on linux
80#     tensorflow_testing_rbe_win:   RBE options to use RBE with tensorflow-testing project on windows
81#
82# Embedded Linux options (experimental and only tested with TFLite build yet)
83#     elinux:          General Embedded Linux options shared by all flavors.
84#     elinux_aarch64:  Embedded Linux options for aarch64 (ARM64) CPU support.
85#     elinux_armhf:    Embedded Linux options for armhf (ARMv7) CPU support.
86#
87# Release build options (for all operating systems)
88#     release_common:       Common options for all builds on all operating systems.
89#     release_windows_common:    Common options for all builds on Windows.
90#     release_gpu_common:   Common options for GPU builds on Linux and Windows.
91#     release_cpu_linux:    Toolchain and CUDA options for Linux CPU builds.
92#     release_cpu_macos:    Toolchain and CUDA options for MacOS CPU builds.
93#     release_gpu_linux:    Toolchain and CUDA options for Linux GPU builds.
94#     release_gpu_linux_cuda_10_1:    Toolchain and CUDA options for CUDA 10.1 Linux GPU builds.
95#     release_cpu_windows:    Toolchain and CUDA options for Windows CPU builds.
96#     release_gpu_windows:    Toolchain and CUDA options for Windows GPU builds.
97
98# Allow builds using libc++ as a linker library
99# This is mostly for OSSFuzz, so we also pass in the flags from environment to clean build file
100build:libc++ --action_env=CC
101build:libc++ --action_env=CXX
102build:libc++ --action_env=CXXFLAGS=-stdlib=libc++
103build:libc++ --action_env=PATH
104build:libc++ --define force_libcpp=enabled
105build:libc++ --linkopt -fuse-ld=lld
106
107# Android configs. Bazel needs to have --cpu and --fat_apk_cpu both set to the
108# target CPU to build transient dependencies correctly. See
109# https://docs.bazel.build/versions/master/user-manual.html#flag--fat_apk_cpu
110build:android --crosstool_top=//external:android/crosstool
111build:android --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
112build:android_arm --config=android
113build:android_arm --cpu=armeabi-v7a
114build:android_arm --fat_apk_cpu=armeabi-v7a
115build:android_arm64 --config=android
116build:android_arm64 --cpu=arm64-v8a
117build:android_arm64 --fat_apk_cpu=arm64-v8a
118build:android_x86 --config=android
119build:android_x86 --cpu=x86
120build:android_x86 --fat_apk_cpu=x86
121build:android_x86_64 --config=android
122build:android_x86_64 --cpu=x86_64
123build:android_x86_64 --fat_apk_cpu=x86_64
124
125# Sets the default Apple platform to macOS.
126build --apple_platform_type=macos
127
128# iOS configs for each architecture and the fat binary builds.
129build:ios --apple_platform_type=ios
130build:ios --apple_bitcode=embedded --copt=-fembed-bitcode
131build:ios --copt=-Wno-c++11-narrowing
132build:ios_armv7 --config=ios
133build:ios_armv7 --cpu=ios_armv7
134build:ios_arm64 --config=ios
135build:ios_arm64 --cpu=ios_arm64
136build:ios_i386 --config=ios
137build:ios_i386 --cpu=ios_i386
138build:ios_x86_64 --config=ios
139build:ios_x86_64 --cpu=ios_x86_64
140build:ios_fat --config=ios
141build:ios_fat --ios_multi_cpus=armv7,arm64,i386,x86_64
142
143# Enables all the macos config options for macos_arm64
144build:macos_arm64 --config=macos
145build:macos_arm64 --apple_platform_type=macos
146build:macos_arm64 --cpu=darwin_arm64
147
148# Config to use a mostly-static build and disable modular op registration
149# support (this will revert to loading TensorFlow with RTLD_GLOBAL in Python).
150# By default, TensorFlow will build with a dependence on
151# //tensorflow:libtensorflow_framework.so.
152build:monolithic --define framework_shared_object=false
153
154# For projects which use TensorFlow as part of a Bazel build process, putting
155# nothing in a bazelrc will default to a monolithic build. The following line
156# opts in to modular op registration support by default.
157build --define framework_shared_object=true
158
159# For workaround https://github.com/bazelbuild/bazel/issues/8772 with Bazel >= 0.29.1
160build --java_toolchain=@org_tensorflow//third_party/toolchains/java:tf_java_toolchain
161build --host_java_toolchain=@org_tensorflow//third_party/toolchains/java:tf_java_toolchain
162
163# Please note that MKL on MacOS or windows is still not supported.
164# If you would like to use a local MKL instead of downloading, please set the
165# environment variable "TF_MKL_ROOT" every time before build.
166build:mkl --define=build_with_mkl=true --define=enable_mkl=true
167build:mkl --define=tensorflow_mkldnn_contraction_kernel=0
168build:mkl --define=build_with_openmp=true
169build:mkl -c opt
170
171# config to build OneDNN backend with a user specified threadpool.
172build:mkl_threadpool --define=build_with_mkl=true --define=enable_mkl=true
173build:mkl_threadpool --define=tensorflow_mkldnn_contraction_kernel=0
174build:mkl_threadpool --define=build_with_mkl_opensource=true
175build:mkl_threadpool --define=build_with_mkldnn_threadpool=true
176build:mkl_threadpool -c opt
177
178# Config setting to build with oneDNN and without the binary blob
179build:mkl_opensource_only --define=build_with_mkl=true --define=enable_mkl=true
180build:mkl_opensource_only --define=tensorflow_mkldnn_contraction_kernel=0
181build:mkl_opensource_only --define=build_with_mkl_opensource=true
182build:mkl_opensource_only --define=build_with_openmp=true
183build:mkl_opensource_only -c opt
184
185# Config setting to build with oneDNN for Arm.
186build:mkl_aarch64 --define=build_with_mkl_aarch64=true --define=enable_mkl=true
187build:mkl_aarch64 --define=tensorflow_mkldnn_contraction_kernel=0
188build:mkl_aarch64 --define=build_with_mkl_opensource=true
189build:mkl_aarch64 -c opt
190
191# This config refers to building with CUDA available. It does not necessarily
192# mean that we build CUDA op kernels.
193build:using_cuda --define=using_cuda=true
194build:using_cuda --action_env TF_NEED_CUDA=1
195build:using_cuda --crosstool_top=@local_config_cuda//crosstool:toolchain
196
197# Enable the mlir generated GPU kernels only for cuda builds.
198build --define=tensorflow_enable_mlir_generated_gpu_kernels=0
199# This is a more specific option, so it takes precedence over the line above for cuda builds.
200build:using_cuda --define=tensorflow_enable_mlir_generated_gpu_kernels=1
201
202# This config refers to building CUDA op kernels with nvcc.
203build:cuda --config=using_cuda
204build:cuda --define=using_cuda_nvcc=true
205
206# This config refers to building CUDA op kernels with clang.
207build:cuda_clang --config=using_cuda
208build:cuda_clang --define=using_cuda_clang=true
209build:cuda_clang --define=using_clang=true
210build:cuda_clang --action_env TF_CUDA_CLANG=1
211
212# dbg config, as a shorthand for '--config=opt -c dbg'
213build:dbg --config=opt -c dbg
214# for now, disable arm_neon. see: https://github.com/tensorflow/tensorflow/issues/33360
215build:dbg --cxxopt -DTF_LITE_DISABLE_X86_NEON
216# AWS SDK must be compiled in release mode. see: https://github.com/tensorflow/tensorflow/issues/37498
217build:dbg --copt -DDEBUG_BUILD
218
219# Config to build TPU backend
220build:tpu --define=with_tpu_support=true
221
222build:tensorrt --action_env TF_NEED_TENSORRT=1
223
224build:rocm --crosstool_top=@local_config_rocm//crosstool:toolchain
225build:rocm --define=using_rocm=true --define=using_rocm_hipcc=true
226build:rocm --action_env TF_NEED_ROCM=1
227
228# Options extracted from configure script
229build:numa --define=with_numa_support=true
230
231# Options to disable default on features
232build:noaws --define=no_aws_support=true
233build:nogcp --define=no_gcp_support=true
234build:nohdfs --define=no_hdfs_support=true
235build:nonccl --define=no_nccl_support=true
236
237build:stackdriver_support --define=stackdriver_support=true
238
239build --define=use_fast_cpp_protos=true
240build --define=allow_oversize_protos=true
241
242build --spawn_strategy=standalone
243build -c opt
244
245# Make Bazel print out all options from rc files.
246build --announce_rc
247
248# Other build flags.
249build --define=grpc_no_ares=true
250
251# See https://github.com/bazelbuild/bazel/issues/7362 for information on what
252# --incompatible_remove_legacy_whole_archive flag does.
253# This flag is set to true in Bazel 1.0 and newer versions. We tried to migrate
254# Tensorflow to the default, however test coverage wasn't enough to catch the
255# errors.
256# There is ongoing work on Bazel team's side to provide support for transitive
257# shared libraries. As part of migrating to transitive shared libraries, we
258# hope to provide a better mechanism for control over symbol exporting, and
259# then tackle this issue again.
260#
261# TODO: Remove this line once TF doesn't depend on Bazel wrapping all library
262# archives in -whole_archive -no_whole_archive.
263build --noincompatible_remove_legacy_whole_archive
264
265# These are bazel 2.0's incompatible flags. Tensorflow needs to use bazel 2.0.0
266# to use cc_shared_library, as part of the Tensorflow Build Improvements RFC:
267# https://github.com/tensorflow/community/pull/179
268build --noincompatible_prohibit_aapt1
269
270# Modular TF build options
271build:dynamic_kernels --define=dynamic_loaded_kernels=true
272build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS
273
274# Build TF with C++ 17 features.
275build:c++17 --cxxopt=-std=c++1z
276build:c++17 --cxxopt=-stdlib=libc++
277build:c++1z --config=c++17
278build:c++17_gcc --cxxopt=-std=c++1z
279build:c++1z_gcc --config=c++17_gcc
280
281# Enable using platform specific build settings, except when cross-compiling for
282# mobile platforms.
283build --enable_platform_specific_config
284build:android --noenable_platform_specific_config
285build:ios --noenable_platform_specific_config
286build:macos_arm64 --noenable_platform_specific_config
287
288# Suppress C++ compiler warnings, otherwise build logs become 10s of MBs.
289build:android --copt=-w
290build:ios --copt=-w
291build:linux --copt=-w
292build:linux --host_copt=-w
293build:macos --copt=-w
294build:windows --copt=/W0
295
296# Tensorflow uses M_* math constants that only get defined by MSVC headers if
297# _USE_MATH_DEFINES is defined.
298build:windows --copt=/D_USE_MATH_DEFINES
299build:windows --host_copt=/D_USE_MATH_DEFINES
300
301# Default paths for TF_SYSTEM_LIBS
302build:linux --define=PREFIX=/usr
303build:linux --define=LIBDIR=$(PREFIX)/lib
304build:linux --define=INCLUDEDIR=$(PREFIX)/include
305build:linux --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include
306build:macos --define=PREFIX=/usr
307build:macos --define=LIBDIR=$(PREFIX)/lib
308build:macos --define=INCLUDEDIR=$(PREFIX)/include
309build:macos --define=PROTOBUF_INCLUDE_PATH=$(PREFIX)/include
310# TF_SYSTEM_LIBS do not work on windows.
311
312# By default, build TF in C++ 14 mode.
313build:android --cxxopt=-std=c++14
314build:android --host_cxxopt=-std=c++14
315build:ios --cxxopt=-std=c++14
316build:ios --host_cxxopt=-std=c++14
317build:linux --cxxopt=-std=c++14
318build:linux --host_cxxopt=-std=c++14
319build:macos --cxxopt=-std=c++14
320build:macos --host_cxxopt=-std=c++14
321build:windows --cxxopt=/std:c++14
322build:windows --host_cxxopt=/std:c++14
323
324# On windows, we still link everything into a single DLL.
325build:windows --config=monolithic
326
327# On linux, we dynamically link small amount of kernels
328build:linux --config=dynamic_kernels
329
330# Make sure to include as little of windows.h as possible
331build:windows --copt=-DWIN32_LEAN_AND_MEAN
332build:windows --host_copt=-DWIN32_LEAN_AND_MEAN
333build:windows --copt=-DNOGDI
334build:windows --host_copt=-DNOGDI
335
336# MSVC (Windows): Standards-conformant preprocessor mode
337# See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
338build:windows --copt=/experimental:preprocessor
339build:windows --host_copt=/experimental:preprocessor
340
341# Misc build options we need for windows.
342build:windows --linkopt=/DEBUG
343build:windows --host_linkopt=/DEBUG
344build:windows --linkopt=/OPT:REF
345build:windows --host_linkopt=/OPT:REF
346build:windows --linkopt=/OPT:ICF
347build:windows --host_linkopt=/OPT:ICF
348build:windows --experimental_strict_action_env=true
349
350# Verbose failure logs when something goes wrong
351build:windows --verbose_failures
352
353# On windows, we never cross compile
354build:windows --distinct_host_configuration=false
355
356# Suppress all warning messages.
357build:short_logs --output_filter=DONT_MATCH_ANYTHING
358build:verbose_logs --output_filter=
359build --config=short_logs
360
361# Instruction set optimizations
362# TODO(gunan): Create a feature in toolchains for avx/avx2 to
363#   avoid having to define linux/win separately.
364build:avx_linux --copt=-mavx
365build:avx_linux --host_copt=-mavx
366build:avx2_linux --copt=-mavx2
367build:native_arch_linux --copt=-march=native
368build:avx_win --copt=/arch=AVX
369build:avx2_win --copt=/arch=AVX2
370
371# Options to build TensorFlow 1.x or 2.x.
372build:v1 --define=tf_api_version=1
373build:v2 --define=tf_api_version=2
374build:v1 --action_env=TF2_BEHAVIOR=0
375build:v2 --action_env=TF2_BEHAVIOR=1
376build --config=v2
377test --config=v2
378
379# Enable XLA
380build:xla --define=with_xla_support=true
381
382# BEGIN TF REMOTE BUILD EXECUTION OPTIONS
383# Options when using remote execution
384# WARNING: THESE OPTIONS WONT WORK IF YOU DO NOT HAVE PROPER AUTHENTICATION AND PERMISSIONS
385
386# Flag to enable remote config
387common --experimental_repo_remote_exec
388
389build:rbe --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
390build:rbe --google_default_credentials
391build:rbe --bes_backend=buildeventservice.googleapis.com
392build:rbe --bes_results_url="https://source.cloud.google.com/results/invocations"
393build:rbe --bes_timeout=600s
394build:rbe --define=EXECUTOR=remote
395build:rbe --distinct_host_configuration=false
396build:rbe --flaky_test_attempts=3
397build:rbe --jobs=200
398build:rbe --remote_executor=grpcs://remotebuildexecution.googleapis.com
399build:rbe --remote_timeout=3600
400build:rbe --spawn_strategy=remote,worker,standalone,local
401test:rbe --test_env=USER=anon
402# Attempt to minimize the amount of data transfer between bazel and the remote
403# workers:
404build:rbe --remote_download_toplevel
405
406build:rbe_linux --config=rbe
407build:rbe_linux --action_env=PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/go/bin"
408build:rbe_linux --host_javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
409build:rbe_linux --javabase=@bazel_toolchains//configs/ubuntu16_04_clang/1.1:jdk8
410build:rbe_linux --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
411build:rbe_linux --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8
412
413# Non-rbe settings we should include because we do not run configure
414build:rbe_linux --config=xla
415build:rbe_linux --config=avx_linux
416build:rbe_linux --config=short_logs
417# TODO(gunan): Check why we need this specified in rbe, but not in other builds.
418build:rbe_linux --linkopt=-lrt
419build:rbe_linux --host_linkopt=-lrt
420build:rbe_linux --linkopt=-lm
421build:rbe_linux --host_linkopt=-lm
422
423build:rbe_cpu_linux --config=rbe_linux
424build:rbe_cpu_linux --host_crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain"
425build:rbe_cpu_linux --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:toolchain"
426build:rbe_cpu_linux --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010:cc-toolchain-k8"
427build:rbe_cpu_linux --extra_execution_platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform"
428build:rbe_cpu_linux --extra_execution_platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform"
429build:rbe_cpu_linux --host_platform="@ubuntu16.04-manylinux2010-py3_config_platform//:platform"
430build:rbe_cpu_linux --platforms="@ubuntu16.04-manylinux2010-py3_config_platform//:platform"
431
432build:rbe_linux_cuda_base --config=rbe_linux
433build:rbe_linux_cuda_base --repo_env=TF_NEED_TENSORRT=1
434build:rbe_linux_cuda_base --repo_env=TF_CUDA_VERSION=10
435build:rbe_linux_cuda_base --repo_env=TF_CUDNN_VERSION=7
436build:rbe_linux_cuda_base --repo_env=REMOTE_GPU_TESTING=1
437build:rbe_linux_cuda_base --repo_env=TF_NEED_CUDA=1
438test:rbe_linux_cuda_base --test_env=LD_LIBRARY_PATH="/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64"
439
440build:rbe_linux_cuda10.1_nvcc_base --config=rbe_linux_cuda_base
441build:rbe_linux_cuda10.1_nvcc_base --define=using_cuda_nvcc=true
442build:rbe_linux_cuda10.1_nvcc_base --host_crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain"
443build:rbe_linux_cuda10.1_nvcc_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain"
444build:rbe_linux_cuda10.1_nvcc_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda//crosstool:toolchain-linux-x86_64"
445build:rbe_linux_cuda10.1_nvcc_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform"
446build:rbe_linux_cuda10.1_nvcc_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform"
447build:rbe_linux_cuda10.1_nvcc_base --platforms="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_platform//:platform"
448build:rbe_linux_cuda10.1_nvcc_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_cuda"
449build:rbe_linux_cuda10.1_nvcc_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_tensorrt"
450build:rbe_linux_cuda10.1_nvcc_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_nccl"
451build:rbe_linux_cuda10.1_nvcc_py2.7 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python2.7"
452build:rbe_linux_cuda10.1_nvcc_py3.5 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.5"
453build:rbe_linux_cuda10.1_nvcc_py3.6 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.6"
454build:rbe_linux_cuda10.1_nvcc_py3.7 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.7"
455build:rbe_linux_cuda10.1_nvcc_py3.8 --config=rbe_linux_cuda10.1_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda10.1-cudnn7-tensorrt6.0_config_python3.8"
456
457build:rbe_linux_cuda11.0_nvcc_base --config=rbe_linux_cuda_base
458build:rbe_linux_cuda11.0_nvcc_base --define=using_cuda_nvcc=true
459build:rbe_linux_cuda11.0_nvcc_base --host_crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain"
460build:rbe_linux_cuda11.0_nvcc_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain"
461build:rbe_linux_cuda11.0_nvcc_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain-linux-x86_64"
462build:rbe_linux_cuda11.0_nvcc_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform"
463build:rbe_linux_cuda11.0_nvcc_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform"
464build:rbe_linux_cuda11.0_nvcc_base --platforms="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform"
465build:rbe_linux_cuda11.0_nvcc_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda"
466build:rbe_linux_cuda11.0_nvcc_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_tensorrt"
467build:rbe_linux_cuda11.0_nvcc_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_nccl"
468build:rbe_linux_cuda11.0_nvcc_py2.7 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python2.7"
469build:rbe_linux_cuda11.0_nvcc_py3.5 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.5"
470build:rbe_linux_cuda11.0_nvcc_py3.6 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.6"
471build:rbe_linux_cuda11.0_nvcc_py3.7 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.7"
472build:rbe_linux_cuda11.0_nvcc_py3.8 --config=rbe_linux_cuda11.0_nvcc_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.8"
473
474# Map default to CUDA 11 for PY35 and greater.
475build:rbe_linux_cuda_nvcc_py27 --config=rbe_linux_cuda10.1_nvcc_py2.7
476build:rbe_linux_cuda_nvcc_py35 --config=rbe_linux_cuda11.0_nvcc_py3.5
477build:rbe_linux_cuda_nvcc_py36 --config=rbe_linux_cuda11.0_nvcc_py3.6
478build:rbe_linux_cuda_nvcc_py37 --config=rbe_linux_cuda11.0_nvcc_py3.7
479build:rbe_linux_cuda_nvcc_py38 --config=rbe_linux_cuda11.0_nvcc_py3.8
480
481# Deprecated configs that people might still use.
482build:rbe_linux_cuda_nvcc --config=rbe_linux_cuda_nvcc_py36
483build:rbe_gpu_linux       --config=rbe_linux_cuda_nvcc
484
485build:rbe_linux_cuda_clang_base --config=rbe_linux_cuda_base
486build:rbe_linux_cuda_clang_base --crosstool_top="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain"
487build:rbe_linux_cuda_clang_base --extra_toolchains="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda//crosstool:toolchain-linux-x86_64"
488build:rbe_linux_cuda_clang_base --extra_execution_platforms="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform"
489build:rbe_linux_cuda_clang_base --host_platform="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform"
490build:rbe_linux_cuda_clang_base --platforms="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_platform//:platform"
491build:rbe_linux_cuda_clang_base --repo_env=TF_CUDA_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_cuda"
492build:rbe_linux_cuda_clang_base --repo_env=TF_TENSORRT_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_tensorrt"
493build:rbe_linux_cuda_clang_base --repo_env=TF_NCCL_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_nccl"
494build:rbe_linux_cuda_clang_base --define=using_cuda_clang=true
495build:rbe_linux_cuda_clang_py27 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python2.7"
496build:rbe_linux_cuda_clang_py35 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.5"
497build:rbe_linux_cuda_clang_py36 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.6"
498build:rbe_linux_cuda_clang_py37 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.7"
499build:rbe_linux_cuda_clang_py38 --config=rbe_linux_cuda_clang_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-clang_manylinux2010-cuda11.0-cudnn8-tensorrt7.1_config_python3.8"
500
501# ROCm
502build:rbe_linux_rocm_base --config=rbe_linux
503build:rbe_linux_rocm_base --repo_env=TF_NEED_ROCM=1
504build:rbe_linux_rocm_base --crosstool_top="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm//crosstool:toolchain"
505build:rbe_linux_rocm_base --extra_toolchains="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm//crosstool:toolchain-linux-x86_64"
506build:rbe_linux_rocm_base --extra_execution_platforms="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform"
507build:rbe_linux_rocm_base --host_platform="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform"
508build:rbe_linux_rocm_base --platforms="@ubuntu18.04-gcc7_manylinux2010-rocm_config_platform//:platform"
509build:rbe_linux_rocm_base --action_env=TF_ROCM_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_rocm"
510build:rbe_linux_rocm_base --define=using_rocm_hipcc=true
511build:rbe_linux_rocm_py2.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python2.7"
512build:rbe_linux_rocm_py3.5 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.5"
513build:rbe_linux_rocm_py3.6 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.6"
514build:rbe_linux_rocm_py3.7 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.7"
515build:rbe_linux_rocm_py3.8 --config=rbe_linux_rocm_base --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu18.04-gcc7_manylinux2010-rocm_config_python3.8"
516
517# Linux CPU
518build:rbe_linux_py2 --config=rbe_linux
519build:rbe_linux_py2 --repo_env=PYTHON_BIN_PATH="/usr/bin/python2"
520build:rbe_linux_py2 --python_path="/usr/bin/python2"
521build:rbe_linux_py2 --repo_env=TF_PYTHON_CONFIG_REPO="@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/py"
522
523build:rbe_linux_py3 --config=rbe_linux
524build:rbe_linux_py3 --python_path="/usr/bin/python3"
525build:rbe_linux_py3 --repo_env=TF_PYTHON_CONFIG_REPO="@ubuntu16.04-manylinux2010-py3_config_python"
526
527build:rbe_win --config=rbe
528build:rbe_win --crosstool_top="@org_tensorflow//third_party/toolchains/preconfig/win/tf_win_08062020:toolchain"
529build:rbe_win --extra_toolchains="@org_tensorflow//third_party/toolchains/preconfig/win/tf_win_08062020:cc-toolchain-x64_windows"
530build:rbe_win --host_javabase="@org_tensorflow//third_party/toolchains/preconfig/win:windows_jdk8"
531build:rbe_win --javabase="@org_tensorflow//third_party/toolchains/preconfig/win:windows_jdk8"
532build:rbe_win --extra_execution_platforms="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019"
533build:rbe_win --host_platform="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019"
534build:rbe_win --platforms="@org_tensorflow//third_party/toolchains/preconfig/win:rbe_windows_ltsc2019"
535build:rbe_win --shell_executable=C:\\tools\\msys64\\usr\\bin\\bash.exe
536
537# TODO(gunan): Remove once we use MSVC 2019 with latest patches.
538build:rbe_win --define=override_eigen_strong_inline=true
539build:rbe_win --jobs=100
540
541build:rbe_win_py37 --config=rbe
542build:rbe_win_py37 --repo_env=TF_PYTHON_CONFIG_REPO="@windows_py37_config_python"
543build:rbe_win_py37 --python_path=C:\\Python37\\python.exe
544
545build:rbe_win_py38 --config=rbe
546build:rbe_win_py38 --repo_env=PYTHON_BIN_PATH=C:\\Python38\\python.exe
547build:rbe_win_py38 --repo_env=PYTHON_LIB_PATH=C:\\Python38\\lib\\site-packages
548build:rbe_win_py38 --repo_env=TF_PYTHON_CONFIG_REPO=@org_tensorflow//third_party/toolchains/preconfig/win_1803/py38
549build:rbe_win_py38 --python_path=C:\\Python38\\python.exe
550
551# These you may need to change for your own GCP project.
552build:tensorflow_testing_rbe --project_id=tensorflow-testing
553common:tensorflow_testing_rbe_linux --remote_instance_name=projects/tensorflow-testing/instances/default_instance
554build:tensorflow_testing_rbe_linux --config=tensorflow_testing_rbe
555build:tensorflow_testing_rbe_linux --config=rbe
556build:tensorflow_testing_rbe_linux --config=rbe_linux
557
558common:tensorflow_testing_rbe_win --remote_instance_name=projects/tensorflow-testing/instances/windows
559build:tensorflow_testing_rbe_win --config=tensorflow_testing_rbe
560
561# TFLite build configs for generic embedded Linux
562build:elinux --crosstool_top=@local_config_embedded_arm//:toolchain
563build:elinux --host_crosstool_top=@bazel_tools//tools/cpp:toolchain
564build:elinux_aarch64 --config=elinux
565build:elinux_aarch64 --cpu=aarch64
566build:elinux_armhf --config=elinux
567build:elinux_armhf --cpu=armhf
568# END TF REMOTE BUILD EXECUTION OPTIONS
569
570# Default options should come above this line
571
572# Options from ./configure
573try-import %workspace%/.tf_configure.bazelrc
574
575# Put user-specific options in .bazelrc.user
576try-import %workspace%/.bazelrc.user
577
578# Here are bazelrc configs for release builds
579build:release_common --config=opt
580build:release_common --config=v2
581build:release_common --distinct_host_configuration=false
582build:release_common --action_env TF_CONFIGURE_IOS="0"
583
584build:release_cpu_linux --config=release_common
585build:release_cpu_linux --config=avx_linux
586# We use the same toolchain for CPU/GPU packages.
587# Did not add this to the defaults in case this changes.
588build:release_cpu_linux --crosstool_top=@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda10.1:toolchain
589
590build:release_cpu_macos --config=release_common
591build:release_cpu_macos --config=avx_linux
592
593build:release_gpu_common --config=release_common
594build:release_gpu_common --config=cuda
595build:release_gpu_common --config=tensorrt
596build:release_gpu_common --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-11.0"
597build:release_gpu_common --action_env=TF_CUDA_VERSION="11"
598build:release_gpu_common --action_env=TF_CUDNN_VERSION="8"
599build:release_gpu_common --action_env=TF_NEED_TENSORRT="1"
600build:release_gpu_common --action_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_35,sm_50,sm_60,sm_70,sm_75,compute_80"
601build:release_gpu_common --action_env=TENSORRT_INSTALL_PATH="/usr/local/tensorrt"
602build:release_gpu_common --action_env=LD_LIBRARY_PATH="/usr/local/cuda:/usr/local/cuda/lib64:/usr/local/cuda/extras/CUPTI/lib64:/usr/local/tensorrt/lib"
603build:release_gpu_common --action_env=GCC_HOST_COMPILER_PATH="/usr/bin/gcc-5"
604
605
606build:release_gpu_linux --config=release_gpu_common
607build:release_gpu_linux --config=avx_linux
608build:release_gpu_linux --crosstool_top=@org_tensorflow//third_party/toolchains/preconfig/ubuntu16.04/gcc7_manylinux2010-nvcc-cuda11:toolchain
609build:release_windows_common --config=release_common
610build:release_windows_common --define=no_tensorflow_py_deps=true
611build:release_windows_common --announce_rc
612
613# First available in VS 16.4. Speeds Windows compile times by a lot. See
614# https://groups.google.com/a/tensorflow.org/d/topic/build/SsW98Eo7l3o/discussion
615build:release_windows_common --copt=/d2ReducedOptimizeHugeFunctions --host_copt=/d2ReducedOptimizeHugeFunctions
616
617build:release_cpu_windows --config=release_windows_common
618
619build:release_gpu_windows --config=release_windows_common
620
621build:release_gpu_linux_cuda_10_1 --config=release_gpu_linux
622build:release_gpu_linux_cuda_10_1 --action_env CUDA_TOOLKIT_PATH="/usr/local/cuda-10.1"
623build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDA_VERSION="10"
624build:release_gpu_linux_cuda_10_1 --action_env=TF_CUDNN_VERSION="7"
625
626# Address sanitizer
627# CC=clang bazel build --config asan
628build:asan --strip=never
629build:asan --copt -fsanitize=address
630build:asan --copt -DADDRESS_SANITIZER
631build:asan --copt -g
632build:asan --copt -O3
633build:asan --copt -fno-omit-frame-pointer
634build:asan --linkopt -fsanitize=address
635
636# Memory sanitizer
637# CC=clang bazel build --config msan
638build:msan --strip=never
639build:msan --copt -fsanitize=memory
640build:msan --copt -DADDRESS_SANITIZER
641build:msan --copt -g
642build:msan --copt -O3
643build:msan --copt -fno-omit-frame-pointer
644build:msan --linkopt -fsanitize=memory
645
646# Undefined Behavior Sanitizer
647# CC=clang bazel build --config ubsan
648build:ubsan --strip=never
649build:ubsan --copt -fsanitize=undefined
650build:ubsan --copt -g
651build:ubsan --copt -O3
652build:ubsan --copt -fno-omit-frame-pointer
653build:ubsan --linkopt -fsanitize=undefined
654build:ubsan --linkopt -lubsan
655