Skip to content

Commit 5359126

Browse files
Merge pull request #252 from RH-steve-grubb/rhds-rhoai-sync
ODH rhoai sync
2 parents 668076c + 0c55048 commit 5359126

File tree

1,110 files changed

+91858
-20644
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,110 files changed

+91858
-20644
lines changed

.bazelrc

Lines changed: 210 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# Optimizations used for TF Serving release builds.
1818
build:release --copt=-mavx
1919
build:release --copt=-msse4.2
20+
build:linux --copt="-march=haswell"
2021

2122
# Options used to build with CUDA.
2223
build:cuda --crosstool_top=@local_config_cuda//crosstool:toolchain
@@ -39,57 +40,235 @@ build:nativeopt --copt=-march=native
3940
build:nativeopt --host_copt=-march=native
4041
build:nativeopt --copt=-O3
4142

42-
# For Tensorflow building only
43-
build --action_env PYTHON_BIN_PATH="/usr/bin/python3"
44-
build --define PYTHON_BIN_PATH=/usr/bin/python3
43+
# those below are required for XNNPACK build with gcc <12 (ubuntu 22 default is 11)
44+
build --define=xnn_enable_avxvnniint8=false
45+
build --define=xnn_enable_avx512fp16=false
46+
build --define=xnn_enable_avx512amx=false
47+
build --define xnn_enable_avxvnni=false
48+
# TODO to check
49+
build --define=no_cuda=1
4550

4651
build --spawn_strategy=standalone
4752
build --genrule_strategy=standalone
48-
4953
build --define=grpc_no_ares=true
50-
build --define=MEDIAPIPE_DISABLE_GPU=1
51-
coverage --define=MEDIAPIPE_DISABLE_GPU=1
52-
test --define=MEDIAPIPE_DISABLE_GPU=1
5354

55+
# Default select settings
56+
build --define=MEDIAPIPE_DISABLE_GPU=1
5457
build --define=MEDIAPIPE_DISABLE=0
55-
coverage --define=MEDIAPIPE_DISABLE=0
56-
test --define=MEDIAPIPE_DISABLE=0
57-
58+
build --define=CLOUD_DISABLE=0
5859
build --define=PYTHON_DISABLE=0
59-
coverage --define=PYTHON_DISABLE=0
60-
test --define=PYTHON_DISABLE=0
6160

6261
# Sets the default Apple platform to macOS.
6362
build --apple_platform_type=macos
6463

6564
build -c opt
66-
build --copt=-DGRPC_BAZEL_BUILD
67-
6865
# fixing debug builds with ignore warnings
6966
build --copt=-O2
70-
71-
# LLVM, MLIR and TF require C++14, we use C++17 in project
72-
build --cxxopt=-std=c++17
73-
build --host_cxxopt=-std=c++17
74-
75-
# Security options
76-
build --cxxopt=-fno-strict-overflow
77-
build --cxxopt=-fno-delete-null-pointer-checks
78-
build --cxxopt=-fwrapv
79-
build --cxxopt=-fstack-protector
80-
build --cxxopt=-fstack-clash-protection
81-
build --cxxopt=-Wformat
82-
build --cxxopt=-Wformat-security
83-
build --cxxopt=-Werror=format-security
84-
67+
build --copt=-DGRPC_BAZEL_BUILD
8568
# Adding "--cxxopt=-D_GLIBCXX_USE_CXX11_ABI=0" creates parity with TF
8669
# compilation options. It also addresses memory use due to
8770
# copy-on-write semantics of std::strings of the older ABI.
8871
build --cxxopt=-D_GLIBCXX_USE_CXX11_ABI=1
8972

73+
build --enable_platform_specific_config
9074
build --experimental_repo_remote_exec
91-
build --force_pic
9275
build --experimental_cc_shared_library
93-
9476
build --check_visibility=true
77+
# Disable leaking LD_LIBRARY_PATH & PATH into build resulting in cache misses
78+
# and frequent rebuilds
79+
build --incompatible_strict_action_env
80+
build --cxxopt=-DOVMS_DUMP_TO_FILE=0
81+
build --remote_upload_local_results=true
82+
83+
build:avx_win --copt=/arch=AVX
84+
build:avx2_win --copt=/arch=AVX2
85+
86+
# Linux settings #######################################################################################################
87+
# LLVM, MLIR and TF require C++14, we use C++17 in project
88+
build:linux --cxxopt=-std=c++17
89+
build:linux --host_cxxopt=-std=c++17
90+
91+
# For Tensorflow building only
92+
build:linux --action_env PYTHON_BIN_PATH="/usr/bin/python3"
93+
build:linux --define PYTHON_BIN_PATH=/usr/bin/python3
94+
95+
build:linux --define=USE_DROGON=1 # 0=legacy net_http, available only on linux
96+
# Security options ######################################################################################################
97+
# TODO: Add equivalent windows flag
98+
build:linux --cxxopt=-fno-strict-overflow
99+
build:linux --cxxopt=-fno-delete-null-pointer-checks
100+
build:linux --cxxopt=-fwrapv
101+
build:linux --cxxopt=-fstack-protector
102+
build:linux --cxxopt=-fstack-clash-protection
103+
build:linux --cxxopt=-Wformat
104+
build:linux --cxxopt=-Wformat-security
105+
build:linux --cxxopt=-Werror=format-security
106+
# TODO: Add equivalent windows flag
107+
build:linux --force_pic
108+
109+
build:mp_on_py_on --config=linux
110+
build:mp_on_py_on --define=MEDIAPIPE_DISABLE=0
111+
build:mp_on_py_on --define=PYTHON_DISABLE=0
112+
build:mp_on_py_on --disk_cache=/root/.cache/bazel_mp_on_py_on
113+
build:mp_on_py_off --config=linux
114+
build:mp_on_py_off --define=MEDIAPIPE_DISABLE=0
115+
build:mp_on_py_off --define=PYTHON_DISABLE=1
116+
build:mp_on_py_off --disk_cache=/root/.cache/bazel_mp_on_py_off
117+
build:mp_off_py_off --config=linux
118+
build:mp_off_py_off --define=MEDIAPIPE_DISABLE=1
119+
build:mp_off_py_off --define=PYTHON_DISABLE=1
120+
build:mp_off_py_off --disk_cache=/root/.cache/bazel_mp_off_py_off
121+
#build --remote_header=x-build-event-log=DEBUG
122+
123+
# Coverity needs remote and disk cache disabled
124+
build:coverity --config=mp_on_py_on
125+
build:coverity --disk_cache=
126+
127+
# Windows settings ######################################################################################################
128+
# Configure short or long logs
129+
build:short_logs --output_filter=DONT_MATCH_ANYTHING
130+
build:verbose_logs --output_filter=
131+
# Options to build TensorFlow 1.x or 2.x.
132+
build:v1 --define=tf_api_version=1 --action_env=TF2_BEHAVIOR=0
133+
build:v2 --define=tf_api_version=2 --action_env=TF2_BEHAVIOR=1
134+
135+
build:windows --host_cxxopt=/std:c++17
136+
build:windows --cxxopt=/std:c++17
137+
# TODO Windows: may impact python nodes execution
138+
build:windows --noenable_bzlmod
139+
140+
# TF bazelrc settings
141+
# TensorFlow Bazel configuration file.
142+
build:windows --define=use_fast_cpp_protos=true
143+
build:windows --define=allow_oversize_protos=true
144+
145+
# Make Bazel print out all options from rc files.
146+
build:windows --announce_rc
147+
148+
build:windows --noincompatible_remove_legacy_whole_archive
149+
build:windows --features=-force_no_whole_archive
150+
151+
# Enable XLA support by default.
152+
build:windows --define=with_xla_support=true
153+
154+
# TODO(mihaimaruseac): Document this option or remove if no longer needed
155+
build:windows --config=short_logs
156+
157+
# TODO(mihaimaruseac): Document this option or remove if no longer needed
158+
build:windows --config=v2
159+
160+
# Disable AWS/HDFS support by default
161+
build:windows --define=no_aws_support=true
162+
build:windows --define=no_hdfs_support=true
163+
164+
# cc_shared_library ensures no library is linked statically more than once.
165+
build:windows --experimental_link_static_libraries_once=false
166+
167+
# Prevent regressions on those two incompatible changes
168+
# TODO: remove those flags when they are flipped in the default Bazel version TF uses.
169+
build:windows --incompatible_enforce_config_setting_visibility
170+
171+
# Config to use a mostly-static build and disable modular op registration
172+
# support (this will revert to loading TensorFlow with RTLD_GLOBAL in Python).
173+
# By default, TensorFlow will build with a dependence on
174+
# //tensorflow:libtensorflow_framework.so.
175+
build:monolithic --define framework_shared_object=false
176+
build:monolithic --define tsl_protobuf_header_only=false
177+
# On windows, we still link everything into a single DLL - required by TF
178+
build:windows --config=monolithic
179+
# Warnings are enabled in common_settings
180+
build:windows --copt=/W0
181+
build:windows --host_copt=/W0
182+
build:windows --copt=/external:anglebrackets
183+
build:windows --host_copt=/external:anglebrackets
184+
build:windows --copt=/external:W0
185+
build:windows --host_copt=/external:W0
186+
187+
# On Windows, `__cplusplus` is wrongly defined without this switch
188+
# See https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/
189+
build:windows --copt=/Zc:__cplusplus
190+
build:windows --host_copt=/Zc:__cplusplus
191+
192+
# Tensorflow uses M_* math constants that only get defined by MSVC headers if
193+
# _USE_MATH_DEFINES is defined.
194+
build:windows --copt=/D_USE_MATH_DEFINES
195+
build:windows --host_copt=/D_USE_MATH_DEFINES
196+
197+
# Windows has a relatively short command line limit, which TF has begun to hit.
198+
# See https://docs.bazel.build/versions/main/windows.html
199+
build:windows --features=compiler_param_file
200+
build:windows --features=archive_param_file
201+
202+
# Speed Windows compile times. Available in VS 16.4 (we are on 16.11). See
203+
# https://groups.google.com/a/tensorflow.org/d/topic/build/SsW98Eo7l3o/discussion
204+
build:windows --copt=/d2ReducedOptimizeHugeFunctions
205+
build:windows --host_copt=/d2ReducedOptimizeHugeFunctions
206+
207+
# Make sure to include as little of windows.h as possible
208+
build:windows --copt=-DWIN32_LEAN_AND_MEAN
209+
build:windows --host_copt=-DWIN32_LEAN_AND_MEAN
210+
build:windows --copt=-DNOGDI
211+
build:windows --host_copt=-DNOGDI
212+
213+
# MSVC (Windows): Standards-conformant preprocessor mode
214+
# See https://docs.microsoft.com/en-us/cpp/preprocessor/preprocessor-experimental-overview
215+
build:windows --copt=/Zc:preprocessor
216+
build:windows --host_copt=/Zc:preprocessor
217+
218+
build:windows --linkopt=/OPT:REF
219+
build:windows --host_linkopt=/OPT:REF
220+
build:windows --linkopt=/OPT:ICF
221+
build:windows --host_linkopt=/OPT:ICF
222+
223+
build:windows --action_env PYTHON_BIN_PATH="C:/opt/Python312/python.exe"
224+
build:windows --action_env PYTHON_LIB_PATH="C:/opt/Python312/lib/site-packages"
225+
build:windows --repo_env PYTHON_BIN_PATH=C:/opt/Python312/python.exe
226+
build:windows --python_path="C:/opt/Python312/python.exe"
227+
build:windows:opt --copt=/arch:AVX
228+
build:windows:opt --host_copt=/arch:AVX
229+
build:windows --define=override_eigen_strong_inline=true
230+
231+
# Disable TFRT integration for now unless --config=tfrt is specified.
232+
build:windows --deleted_packages=tensorflow/core/tfrt/stubs,tensorflow/compiler/mlir/tfrt,tensorflow/compiler/mlir/tfrt/benchmarks,tensorflow/compiler/mlir/tfrt/ir,tensorflow/compiler/mlir/tfrt/ir/mlrt,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/mlrt,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/compiler/mlir/tfrt/transforms/mlrt,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/mlrt,tensorflow/core/tfrt/mlrt/attribute,tensorflow/core/tfrt/mlrt/kernel,tensorflow/core/tfrt/mlrt/bytecode,tensorflow/core/tfrt/mlrt/interpreter,tensorflow/compiler/mlir/tfrt/translate/mlrt,tensorflow/compiler/mlir/tfrt/translate/mlrt/testdata,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,tensorflow/core/tfrt/utils/debug,tensorflow/core/tfrt/saved_model/python,tensorflow/core/tfrt/graph_executor/python
233+
234+
# Windows build ssl headers for GRPC workaround
235+
build:windows --override_repository="boringssl=C:\\opt\\boringSSL-SwiftPM"
236+
237+
#Add this parameter for windows local builds, its added on jenkins via windows_build.bat. Must be short path on C:\ for mediapipe to compile
238+
#startup --output_user_root=C:/b_tmp
239+
240+
# Windows config default flags
241+
build:windows --define=CLOUD_DISABLE=1
242+
build:windows --define=PYTHON_DISABLE=1
243+
build:windows --define=MEDIAPIPE_DISABLE=0
244+
245+
# Change this path alongside WORKSPACE:"windows_openvino" path for model_api cmake compilation.
246+
build:windows --action_env OpenVINO_DIR="c:/opt/openvino/runtime/cmake"
247+
build:windows --action_env OpenCV_DIR="c:/opt/opencv_4.12.0"
248+
249+
build:windows --repo_env=HERMETIC_PYTHON_VERSION=3.12
250+
build:windows --define=USE_DROGON=1
251+
build:windows --define=GENAI_USE_BINARY=1
252+
253+
build:win_mp_on_py_on --config=windows
254+
build:win_mp_on_py_on --define=MEDIAPIPE_DISABLE=0
255+
build:win_mp_on_py_on --define=PYTHON_DISABLE=0
256+
build:win_mp_on_py_off --config=windows
257+
build:win_mp_on_py_off --define=MEDIAPIPE_DISABLE=0
258+
build:win_mp_on_py_off --define=PYTHON_DISABLE=1
259+
260+
# Tests settings ############################################################################################################################
261+
# sometimes failed logs exceed this threshold
262+
test --experimental_ui_max_stdouterr_bytes=304857600
263+
264+
# envs below are required to succesfully run binaries in bazel as bazel is very strict in sandboxing
265+
test:linux --test_env LD_LIBRARY_PATH=/opt/opencv/lib/:/opt/intel/openvino/runtime/lib/intel64/:/opt/intel/openvino/runtime/3rdparty/tbb/lib/
266+
# genai hardcodes path during build time so without this so is not visible
267+
test:linux --test_env OPENVINO_TOKENIZERS_PATH_GENAI=/opt/intel/openvino/runtime/lib/intel64/libopenvino_tokenizers.so
268+
test:linux --test_env PYTHONPATH=/opt/intel/openvino/python:/ovms/bazel-bin/src/python/binding
269+
test:linux --test_env no_proxy=localhost
95270

271+
# Bazelrc imports ############################################################################################################################
272+
# file below should contain sth like
273+
# build --remote_cache=http://IP:PORT
274+
try-import %workspace%/.user.bazelrc

.bazelversion

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
6.1.1

.clang-format

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@ PenaltyExcessCharacter: 1000000
8080
PenaltyReturnTypeOnItsOwnLine: 60
8181
PointerAlignment: Left
8282
ReflowComments: true
83-
SortIncludes: true
83+
# TODO @atobisze after modularization
84+
# try to switch back at some point
85+
SortIncludes: false
8486
SpaceAfterCStyleCast: false
8587
SpaceBeforeAssignmentOperators: true
8688
SpaceBeforeParens: ControlStatements

.dockerignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.venv
2+
.venv-style
3+
**/.venv
4+
out
5+
demos/continuous_batching
6+
demos/embeddings
7+
demos/common/export_models/models

.github/pull_request_template.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
### 🛠 Summary
2+
3+
JIRA/Issue if applicable.
4+
Describe the changes.
5+
6+
### 🧪 Checklist
7+
8+
- [ ] Unit tests added.
9+
- [ ] The documentation updated.
10+
- [ ] Change follows security best practices.
11+
``
12+

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,17 @@ lib/
2424
cppclean_src
2525
cppclean_test
2626
tags
27+
.venv-style/
28+
src/test/llm_testing
29+
node_modules/
30+
yarn.*
31+
bazel-openvino-model-server/
32+
bazel-model_server/
33+
out
34+
.user.bazelrc
35+
*.log
36+
*.errors.txt
37+
tmp/
38+
*.zip
39+
*.tar.gz
40+
models

.konflux/build-args.conf

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Base images
2+
BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:9.6
3+
RELEASE_BASE_IMAGE=registry.access.redhat.com/ubi9-minimal:9.6
4+
5+
# Logging/tests
6+
VERBOSE_LOGS=ON
7+
RUN_TESTS=ON
8+
CHECK_COVERAGE=0
9+
10+
# Distro/GPU
11+
BASE_OS=redhat
12+
GPU=1
13+
ov_use_binary=0
14+
15+
# Versions / LTO
16+
INSTALL_DRIVER_VERSION=25.05.32567
17+
LTO_ENABLE=ON
18+
LTO_CXX_FLAGS=-flto=auto -ffat-lto-objects -march=haswell
19+
LTO_LD_FLAGS=-flto=auto -ffat-lto-objects -Wl,-plugin-opt=-march=haswell
20+
21+
# Source/branch
22+
SOURCE=opendatahub-io
23+
BRANCH=releases/2025/3
24+
ov_source_org=opendatahub-io
25+
ov_source_branch=releases/2025/3
26+
27+
# Parallelism
28+
JOBS=12
29+
30+
# Bazel flags (no quotes, entire value after the '=')
31+
debug_bazel_flags=--strip=always --define MEDIAPIPE_DISABLE=0 --define PYTHON_DISABLE=0 --//:distro=redhat --local_ram_resources=20480 --local_cpu_resources=16 --verbose_failures --subcommands --config=mp_on_py_on
32+
CAPI_FLAGS=--strip=always --config=mp_off_py_off --//:distro=redhat --local_ram_resources=20480 --local_cpu_resources=16 --verbose_failures --subcommands
33+

0 commit comments

Comments
 (0)