bazel: add Linux standard allocator option - #3714
Conversation
Signed-off-by: Ubuntu <ubuntu@ip-172-31-3-43.ec2.internal>
Signed-off-by: Ubuntu <ubuntu@ip-172-31-3-43.ec2.internal>
There was a problem hiding this comment.
Pull request overview
This PR adds Bazel flag parity for Make’s STDALLOC=yes allocator-selection behavior by introducing a typed --stdalloc=true option that enables standard-library aligned allocation for Linux DAAL core compilation while keeping the separately built TBB threading objects on scalable allocation (matching Make’s scope).
Changes:
- Introduces a typed boolean Bazel flag (
--stdalloc=true) and wires it into DAAL compilation viaUSE_STD_ALLOCon Linux only. - Ensures
threading_tbbis explicitly excluded fromUSE_STD_ALLOCto preserve TBB scalable allocation for threading objects. - Adds documentation and a bounded CI analysis-only smoke check for the new configuration.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| dev/bazel/README.md | Documents --stdalloc behavior, Linux-only restriction, and scope differences vs Make/ICX. |
| dev/bazel/daal.bzl | Adds stdalloc control to daal_module(), defines USE_STD_ALLOC when enabled, and enforces Linux-only support. |
| dev/bazel/config/config.tpl.BUILD | Declares the stdalloc build setting and config_settings for enabled/disabled with Linux gating plus a clear failure target. |
| dev/bazel/config/config.bzl | Adds an unsupported_config rule used to fail analysis with a targeted message on unsupported configurations. |
| cpp/daal/BUILD | Disables stdalloc for threading_tbb to match Make’s target-specific macro scope. |
| .ci/pipeline/ci.yml | Adds an analysis-only CI smoke check for :release with --stdalloc=true (and DPC disabled). |
| .bazelrc | Exposes --stdalloc via --flag_alias for user-facing CLI parity. |
| bazel build --nobuild :release --config=release-dpc --cpu=all | ||
|
|
||
| echo "Checking Bazel config: stdalloc" | ||
| bazel build --nobuild :release --stdalloc=true --release_dpc=false |
There was a problem hiding this comment.
@Alexandr-Solovev Would this be a problem with the space constraints that you've been trying to address? And wouldn't this potentially increase running times significantly?
There was a problem hiding this comment.
For the first question, it should not(especially with disabled dpc) For the second: we can take a look on the job time, because it is hard to estimate
Description
Add a typed Bazel
--stdalloc=trueoption for the allocator-selection part of MakeSTDALLOC=yeson Linux DAAL core builds.This is a focused Make-to-Bazel option-parity improvement toward #3530. The option is disabled by default.
What changed
--stdalloc=trueinterfaceUSE_STD_ALLOConly for DAAL core compilation actions-static-libstdc++Validation
Validated on Linux at exact branch head
8ce584627c78d90ca5d18eb709adff9c85dd1c71.Exact-head GCC build/test
CC=gcc bazelisk build \ //cpp/daal:core_static //cpp/daal:core_dynamic \ //cpp/daal:thread_static //cpp/daal:thread_dynamic \ --stdalloc=true --cpu=sse2 --jobs=2 CC=gcc bazelisk test \ //cpp/daal/src/algorithms/dtrees/gbt/regression:test_gbt_regression_model_builder_unit_host \ --stdalloc=true --cpu=sse2 --jobs=2 --test_output=errorsResults: build passed (1,151 actions); 1/1 test passed. CI YAML parse and
git diff --checkalso passed.ICX proof
Validated with ICX/ICPX 2026.0 and Bazel 9.2:
USE_STD_ALLOCUSE_STD_ALLOCUSE_STD_ALLOCaligned_alloc/free; threading retains TBB scalable allocationScope notes
This option controls allocator selection only. Make builds with
COMPILER=icx STDALLOC=yesadditionally pass-static-libstdc++; Bazel link options are intentionally unchanged.Checklist