Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
effb367
Test: CI build optimizations (CUDA compute capabilities and non-curse…
vkarampudi Jul 9, 2026
a2b7756
Fix: Prune sm_60 from .bazelrc and add --noshow_progress to Dockerfil…
vkarampudi Jul 9, 2026
fccb929
Fix: Prune sm_70 from .bazelrc to resolve Volta Clang CUDA build erro…
vkarampudi Jul 10, 2026
dce4e8e
Fix: Add cuda_clang_fixes.h compatibility header and include flags to…
vkarampudi Jul 10, 2026
0f58c8f
Fix: Append typeof and uint4 __stwt overloads directly to clang_cuda_…
vkarampudi Jul 11, 2026
8e90909
Fix GPU Docker build failures.
vkarampudi Jul 12, 2026
837d100
Update .bazelrc compute capabilities to include sm_70 and sm_75 to ma…
vkarampudi Jul 12, 2026
75a48e9
Fix __stwt redefinition conflict with RAFT by guarding it with DISABL…
vkarampudi Jul 12, 2026
98d76ec
Disable Clang header modules to fix crosstool module redefinition error.
vkarampudi Jul 13, 2026
4f8f459
Disable layering_check and module_maps for host and target to fix mod…
vkarampudi Jul 13, 2026
f5ce4c1
Sync root.workspace with depot head (align org_tensorflow commit).
vkarampudi Jul 13, 2026
86e707e
Fix libevent to build hermetically using sysroot
vkarampudi Jul 13, 2026
b13347a
Add sm_60 back to support P100 GPUs in Kokoro tests
vkarampudi Jul 14, 2026
ccc179a
Dynamically locate clang and llvm-ar binaries in libevent BUILD genrule
vkarampudi Jul 16, 2026
04f03e1
Fix libevent build: export GCC_PATH for clang wrapper in genrule
vkarampudi Jul 17, 2026
32f12f7
Pin CUDA 12.2 in Dockerfiles and remove CUB patch from tensorflow.patch
vkarampudi Jul 20, 2026
24ba20c
Set HERMETIC_CUDA_VERSION=12.2.0 and re-add CUB scan kernel patch
vkarampudi Jul 20, 2026
cfb9aed
Remove CUB scan kernel patch to test hermetic CUDA 12.2.0 build
vkarampudi Jul 20, 2026
59065c6
Re-add CUB scan kernel patch required for rules_ml_toolchain builds
vkarampudi Jul 20, 2026
edfc294
Update rules_ml_toolchain commit to d8cb9c2c168cd64000eaa6eda0781a961…
vkarampudi Jul 20, 2026
3c9ca15
Pass --repo_env=HERMETIC_CUDA_VERSION=12.2.0 to Bazel options in Dock…
vkarampudi Jul 20, 2026
402caae
Remove CUB scan kernel patch now that Bazel is forced to CUDA 12.2.0
vkarampudi Jul 20, 2026
aad714d
Restore rules_ml_toolchain commit 398d613a and CUB scan kernel patch …
vkarampudi Jul 21, 2026
6c3b5d7
Pin org_tensorflow to v2.21.0 tag (a481b102) and rules_ml_toolchain t…
vkarampudi Jul 21, 2026
bec6499
Fix org_tensorflow sha256 to 6438396f3b19af5d7ad787cf041f857af7505916…
vkarampudi Jul 21, 2026
95e457a
Regenerate tensorflow.patch against TF v2.21.0 release tag for clean …
vkarampudi Jul 21, 2026
a6542fa
Add BUILD file creation to rules_ml_toolchain patch_cmds for package …
vkarampudi Jul 21, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ 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_60,sm_70,sm_80,sm_89,compute_90"
build:cuda_clang --repo_env=TF_CUDA_COMPUTE_CAPABILITIES="sm_60,sm_70,sm_75,sm_80,sm_86,sm_89,compute_90"
build:cuda_clang --copt=-Dtypeof=__typeof__

common:cuda_clang --repo_env=HERMETIC_CUDA_VERSION="12.5.1"
common:cuda_clang --repo_env=HERMETIC_CUDNN_VERSION="9.3.0"
Expand Down Expand Up @@ -116,6 +117,9 @@ common --repo_env USE_HERMETIC_CC_TOOLCHAIN=1
common --repo_env=HERMETIC_PYTHON_VERSION="3.10"
common --repo_env=USE_PYWRAP_RULES=1
build --features=-layering_check
build --host_features=-layering_check
build --features=-module_maps
build --host_features=-module_maps
build --define=framework_shared_object=false
build --dynamic_mode=off

Expand Down
16 changes: 10 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ local_repository(
load("//tensorflow_serving:repo.bzl", "tensorflow_http_archive")
tensorflow_http_archive(
name = "org_tensorflow",
sha256 = "54bfd56d61dfced2b82bdeee3262a24fb3d59bed4dbb292d19834af002d85b3b",
git_commit = "c1be979f3130b85f14e8890c05cbca147784f474",
sha256 = "6438396f3b19af5d7ad787cf041f857af7505916dc08092e20b07d1b1f8df492",
git_commit = "a481b10260dfdf833a1b16007eead49c1d7febf3",
patch = "//third_party/tensorflow:tensorflow.patch",
patch_cmds = [
"sed -i '/cc_library = _cc_library/d' tensorflow/core/platform/rules_cc.bzl",
Expand Down Expand Up @@ -114,11 +114,15 @@ http_archive(
# Details: https://github.com/google-ml-infra/rules_ml_toolchain
http_archive(
name = "rules_ml_toolchain",
sha256 = "0b42f693a60c6050d87db1e0a0eaeb84ab3f54191fce094d86334faedc807da0",
strip_prefix = "rules_ml_toolchain-398d613aea7a4c294da49b79a6d6f3f8732bd84c",
sha256 = "54c1a357f71f611efdb4891ebd4bcbe4aeb6dfa7e473f14fd7ecad5062096616",
strip_prefix = "rules_ml_toolchain-d8cb9c2c168cd64000eaa6eda0781a9615a26ffe",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google-ml-infra/rules_ml_toolchain/archive/398d613aea7a4c294da49b79a6d6f3f8732bd84c.tar.gz",
"https://github.com/google-ml-infra/rules_ml_toolchain/archive/398d613aea7a4c294da49b79a6d6f3f8732bd84c.tar.gz",
"https://storage.googleapis.com/mirror.tensorflow.org/github.com/google-ml-infra/rules_ml_toolchain/archive/d8cb9c2c168cd64000eaa6eda0781a9615a26ffe.tar.gz",
"https://github.com/google-ml-infra/rules_ml_toolchain/archive/d8cb9c2c168cd64000eaa6eda0781a9615a26ffe.tar.gz",
],
patch_cmds = [
"mkdir -p third_party/rules_python py && touch third_party/rules_python/BUILD py/BUILD",
"cat << 'EOF' >> cc/cuda/clang/clang_cuda_runtime_wrapper.h\n#if defined(__clang__) && defined(__CUDA__)\n#include <vector_types.h>\n#ifndef typeof\n#define typeof __typeof__\n#endif\n#ifndef DISABLE_WRAPPERS_STWT\n__device__ inline void __stwt(uint4* ptr, uint4 value) {\n asm volatile(\"st.global.wt.v4.u32 [%0], {%1, %2, %3, %4};\" : : \"l\"(ptr), \"r\"(value.x), \"r\"(value.y), \"r\"(value.z), \"r\"(value.w) : \"memory\");\n}\n#endif\n#endif\nEOF",
],
)

Expand Down
131 changes: 131 additions & 0 deletions tensorflow_serving/opensource_only/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# 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 --linkopt=-Wno-unused-command-line-argument
build --host_linkopt=-Wno-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_70,sm_75,sm_80,sm_86,sm_89,compute_90"
build:cuda_clang --copt=-Dtypeof=__typeof__

common:cuda_clang --repo_env=HERMETIC_CUDA_VERSION="12.5.1"
common:cuda_clang --repo_env=HERMETIC_CUDNN_VERSION="9.3.0"
common:cuda_clang --repo_env=HERMETIC_NVSHMEM_VERSION="3.2.5"
common:cuda_clang --repo_env=HERMETIC_NCCL_VERSION="2.29.7"
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"

# 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

# Revert to the legacy WORKSPACE dependency resolution system
# and disable Bzlmod.
common --enable_bzlmod=false
common --incompatible_enable_cc_toolchain_resolution
common --repo_env USE_HERMETIC_CC_TOOLCHAIN=1
common --repo_env=HERMETIC_PYTHON_VERSION="3.10"
common --repo_env=USE_PYWRAP_RULES=1
build --features=-layering_check
build --host_features=-layering_check
build --features=-module_maps
build --host_features=-module_maps
build --define=framework_shared_object=false
build --dynamic_mode=off


common:clang_local --noincompatible_enable_cc_toolchain_resolution
common:clang_local --noincompatible_enable_android_toolchain_resolution
common:clang_local --@rules_ml_toolchain//cc_toolchain/config:enable_hermetic_cc=False
common:clang_local --repo_env USE_HERMETIC_CC_TOOLCHAIN=0

Loading