build(daal): include only the MKL headers DAAL calls #3903
All Vouch review confidence checks passed
Residual risk 0.22 = Change Risk (0.52) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.52 · 650 lines diff across 8 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.388
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #3903"
general
weight: 0.35
ethanglaser
Summary
Most of the CPU time in a DAAL compile goes to parsing headers, and most of that is MKL. Every TU that includes
src/externals/config.hpulled in the whole<mkl.h>umbrella. That umbrella also brings in DFTI, PARDISO, DSS, the solvers, sparse QR and all ofmkl_lapack.h, about 50k lines. DAAL calls 34 routines from it.The PR has two commits, and either can be reverted on its own:
1. Per-domain MKL headers. Any missing declaration shows up as a compile error.
2. The LAPACK subset. If DAAL starts calling a new LAPACK routine, it fails to compile until one prototype line is added. If MKL changes a prototype,
library_version_info.cppsees both declarations and fails withconflicting declaration of C function. If MKL does not declare a listed name at all (a typo, or a routine MKL dropped), astatic_assertthere fails before the subset adds its own declaration.Declarations generate no code, so the object files are unchanged.
Evidence
All 1550 DAAL compile actions of
//cpp/daal:core_static(gcc 13.3,aquerycommand lines, usr+sys, best of 2, Linux 224-core box). Old and new headers were compiled side by side with the same flags. The old copy was shadowed through-iquote, with-fmacro-prefix-mapso that__FILE__matches.| | DAAL compile CPU-s | vs main | object files vs main |
|---|---|---|---|
| main | 2409 | | |
| commit 1 (per-domain headers) | 2178 | -9.6% | 1550/1550 byte-identical |
| commit 2 (LAPACK subset) | 1906 | -20.9% | 1550/1550 byte-identical |
A single TU,
zscore_dense_default_batch_fpt_cpu.cppwith-fsyntax-only: 2.67 s / 360 MB before, 1.53 s / 184 MB after.mkl_lapack.halone takes 0.78 s / 103 MB.The drift guard was checked by changing one parameter in the subset from
const MKL_INTtoMKL_INT, and by listing a name MKL does not have:bazel test //cpp/oneapi/dal:tests --config=host: 118/118 pass.CI wall time has not been measured yet. The 2-vCPU Azure agents are compile-bound, so about 500 CPU-s saved should mean roughly 4 min less per full DAAL build.
Merge Danger
Door: two-way
Header-only change with byte-identical objects. Reverting either commit restores the old include set.
Blast Radius: build
A compiler or MKL version that this PR's CI does not cover could still reject the subset: a Windows toolchain, or the Make build with a different MKL drop. That would show up as a compile error, not as a behaviour change. The subset uses
noexceptdirectly rather than MKL'sNOTHROWmacro, so MSVC-mode__cpluspluscannot redefine it.---
<details>
<summary>Checklist:</summary>
Completeness and readability
Testing
Performance
</details>
🤖 Generated with Claude Code