Skip to content

Fix *_input classes destructors visibility (backport #3591)#3601

Merged
maria-Petrova merged 1 commit intorls/2026.0.0-rlsfrom
mergify/bp/rls/2026.0.0-rls/pr-3591
Apr 9, 2026
Merged

Fix *_input classes destructors visibility (backport #3591)#3601
maria-Petrova merged 1 commit intorls/2026.0.0-rlsfrom
mergify/bp/rls/2026.0.0-rls/pr-3591

Conversation

@mergify
Copy link
Copy Markdown
Contributor

@mergify mergify bot commented Apr 9, 2026

Description

This PR fixes the ABI breakage introduced by CPU SPMD algorithms:

#3507
#3585

The PR changes the binding type of the destructors (~compute_input(), ~partial_compute_input()) to "WEAK" by adding their non-default implementations.

Public CI: https://github.com/uxlfoundation/oneDAL/runs/70263726088
Private CI: http://intel-ci.intel.com/f1327082-5573-f199-9143-a4bf010d0e2d

Reasoning

In the #3507 the classes covariance::compute_input and covariance::partial_compute_input were not changed explicitly, but the changes led to the unexpected changes in the ABI of those classes. Example:

4 Removed function symbols not referenced by debug info:

[D] _ZN6oneapi3dal10covariance2v113compute_inputINS1_4task2v17computeEED0Ev
[D] _ZN6oneapi3dal10covariance2v113compute_inputINS1_4task2v17computeEED2Ev
[D] _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
[D] _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev

Link to the full log: https://github.com/uxlfoundation/oneDAL/actions/runs/23718739687/job/69097133621?pr=3507

Those symbols correspond to the following destructors:

oneapi::dal::covariance::v1::compute_input<oneapi::dal::covariance::task::v1::compute>::~compute_input()
oneapi::dal::covariance::v1::partial_compute_input<oneapi::dal::covariance::task::v1::compute>::~partial_compute_input()

In the main branch as well as in the #3507 feature branch those destructors left unimplemented, they are generated by the compiler automatically.

But the PR #3507 somehow changes the binding types of those symbols in .so files as can be seen with readelf.
The output of the readelf -s --wide __release_lnx/daal/latest/lib/intel64/libonedal.so | grep _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED

main branch

3954: 0000000000148ef0 282 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
4198: 0000000000148de0 270 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev
16346: 0000000000148ef0 282 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
16977: 0000000000148de0 270 FUNC WEAK DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev

feature branch

7420: 0000000000148ed0 282 FUNC LOCAL DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED0Ev
8785: 0000000000148dc0 270 FUNC LOCAL DEFAULT 11 _ZN6oneapi3dal10covariance2v121partial_compute_inputINS1_4task2v17computeEED2Ev

The logs show that the binding types were changed from "WEAK" to "LOCAL" for the destructors, which means that in the feature branch the destructors' symbols are only available within the .so file and not exported from the .so as it was done in the main branch.

Why did this happen?

There are two factors:

  • having the destructors not implemented and letting the compiler to auto-define them;
  • compiling the code with -fvisibility=hidden.

Those facts give compiler the ability to define the binding type of the destructors by itself, which is rather fragile as the binding type could change leading to ABI brakeage even with no changes to the classes' implementations, as could be seen in #3507.

Solution

This PR explicitly defines the destructors implementations in the affected classes and in all the *_input classes in the algorithms that might have the CPU-distributed implementations in the future.

This forces the compiler to always generate the symbols for the affected destructors with the 'WEAK' binding, regardless of the code in the other parts of the .so.

CI: http://intel-ci.intel.com/f131bc28-06e8-f18d-90e6-a4bf010d0e2d


Checklist:

Completeness and readability

  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation to reflect the changes or created a separate PR with updates and provided its number in the description, if necessary.
  • Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
  • I have resolved any merge conflicts that might occur with the base branch.

Testing

  • I have run it locally and tested the changes extensively.
  • All CI jobs are green or I have provided justification why they aren't.
  • I have extended testing suite if new functionality was introduced in this PR.

Performance

  • I have measured performance for affected algorithms using scikit-learn_bench and provided at least a summary table with measured data, if performance change is expected.
  • I have provided justification why performance and/or quality metrics have changed or why changes are not expected.
  • I have extended the benchmarking suite and provided a corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.

This is an automatic backport of pull request #3591 done by [Mergify](https://mergify.com).

Fixes the ABI breakage introduced by CPU SPMD algorithms in the PRs #3507, #3585
Make the binding type of the destructors (~compute_input(), ~partial_compute_input(), ~train_input(), etc.) stably "WEAK" and not dependent on the compiler's logic by adding their non-default implementations.

Also fixes `set_responses` method in KNN.

(cherry picked from commit 0a5f4cb)
@maria-Petrova maria-Petrova merged commit c2d1c4e into rls/2026.0.0-rls Apr 9, 2026
6 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants