-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
.bazelrc
108 lines (86 loc) · 4.45 KB
/
.bazelrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Optimizations used for TF Serving release builds.
build:release --copt=-mavx
build:release --copt=-msse4.2
# Options used to build with CUDA.
build:cuda --repo_env TF_NEED_CUDA=1
build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain
build:cuda --@local_config_cuda//:enable_cuda
# Options used to build with CUDA clang
build:cuda_clang --config=cuda
build:cuda_clang --copt=-Wno-gnu-offsetof-extensions
build:cuda_clang --copt=-Wno-error=unused-command-line-argument
build:cuda_clang --host_copt=-Wno-error=unused-command-line-argument
build:cuda_clang --repo_env TF_NEED_TENSORRT=0
build:cuda_clang --action_env=TF_CUDA_CLANG="1"
build:cuda_clang --@local_config_cuda//:cuda_compiler=clang
build:cuda_clang --repo_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_50,sm_60,sm_70,sm_80,compute_90"
build:cuda_clang --repo_env=HERMETIC_CUDA_VERSION="12.2.0"
build:cuda_clang --repo_env=HERMETIC_CUDNN_VERSION="8.9.4.25"
build:cuda_clang --action_env=GCC_HOST_COMPILER_PATH="/usr/bin/gcc-10"
build:cuda_clang --action_env=CLANG_CUDA_COMPILER_PATH="/usr/lib/llvm-17/bin/clang"
build:kokoro --repo_env=CC="/usr/bin/gcc-10"
build:kokoro --action_env=CC="/usr/bin/gcc-10"
# Options used to build with TPU support.
build:tpu --define=with_tpu_support=true --define=framework_shared_object=false
build:tpu --copt=-DLIBTPU_ON_GCE
# 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
# environment variable "TF_MKL_ROOT" every time before build.
build:mkl --define=build_with_mkl=true --define=enable_mkl=true --define=build_with_openmp=false
build:mkl --define=tensorflow_mkldnn_contraction_kernel=0
# This config option is used to enable MKL-DNN open source library only,
# without depending on MKL binary version.
build:mkl_open_source_only --define=build_with_mkl_dnn_only=true
build:mkl_open_source_only --define=build_with_mkl=true --define=enable_mkl=true
build:mkl_open_source_only --define=tensorflow_mkldnn_contraction_kernel=0
# 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_openmp=true
build:mkl_aarch64 --copt=-march=armv8.2-a
build:mkl_aarch64 --copt=-O3
build --define=build_with_onednn_v2=true
build --define=xnn_enable_avxvnni=false
build --define=xnn_enable_avxvnniint8=false
build --define=xnn_enable_avx256vnnigfni=false
build --define=xnn_enable_avx512amx=false
build --define=xnn_enable_avx512fp16=false
# Processor native optimizations (depends on build host capabilities).
build:nativeopt --copt=-march=native
build:nativeopt --host_copt=-march=native
build:nativeopt --copt=-O3
build --keep_going
build --verbose_failures=true
build --spawn_strategy=standalone
build --genrule_strategy=standalone
build --define=grpc_no_ares=true
# Sets the default Apple platform to macOS.
build --apple_platform_type=macos
build -c opt
# LLVM, MLIR and TF requires C++17.
build --cxxopt=-std=c++17
build --host_cxxopt=-std=c++17
# Adding "--cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0" creates parity with TF
# compilation options. It also addresses memory use due to
# copy-on-write semantics of std::strings of the older ABI.
build --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0
build --workspace_status_command=/proc/self/cwd/tools/gen_status_stamp.sh
build --experimental_repo_remote_exec
# TF now has `cc_shared_library` targets, so it needs the experimental flag
build --experimental_cc_shared_library
# Yggdrasil Decision Forests (internal library of TensorFlow Decision Forests)
# uses TensorFlow for all IO operations.
build --define=use_tensorflow_io=1
# TensorFlow Decision Forests does not use Absl concurrency primitives on MacOs.
# Reason: TensorFlow/ABSL ODR violation (b/214189609) # copybara:strip
build:macos --define std_synchronization_primitives=1
# Taken from https://github.com/openxla/xla/blob/99559d7a4f7c55490f46385ad29a3cbf9c3911af/warnings.bazelrc#L6
# We silence warnings for code in `external`.
build --per_file_copt=external/.*@-w
build --host_per_file_copt=external/.*@-w
build --copt=-Wno-macro-redefined # absl vs tsl logging clash
build --copt=-Wno-sign-compare # int as loop variable
build --copt=-Wno-deprecated-declarations
build --copt=-Wno-unused-but-set-variable # due to `ifdefs` in ml_dtypes