8000 WIP: static libraries handling by Alexandr-Solovev · Pull Request #3253 · uxlfoundation/oneDAL · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

WIP: static libraries handling #3253

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 4 commits into
base: rfcs
Choose a base branch
from

Conversation

Alexandr-Solovev
Copy link
Contributor

Description

Add a comprehensive description of proposed changes

List associated issue number(s) if exist(s): #6 (for example)

Documentation PR (if needed): #1340 (for example)

Benchmarks PR (if needed): IntelPython/scikit-learn_bench#155 (for example)


PR should start as a draft, then move to ready for review state after CI is passed and all applicable checkboxes are closed.
This approach ensures that reviewers don't spend extra time asking for regular requirements.

You can remove a checkbox as not applicable only if it doesn't relate to this PR in any way.
For example, PR with docs update doesn't require checkboxes for performance while PR with any change in actual code should have checkboxes and justify how this code change is expected to affect performance (or justification should be self-evident).

Checklist to comply with before moving PR from draft:

PR completeness and readability

  • I have reviewed my changes thoroughly before submitting this pull request.
  • 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 update 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 added a respective label(s) to PR if I have a permission for that.
  • 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 summary table with measured data, if performance change is expected.
  • I have provided justification why performance has changed or why changes are not expected.
  • I have provided justification why quality metrics have changed or why changes are not expected.
  • I have extended benchmarking suite and provided corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.

@napetrov
Copy link
Contributor

@Alexandr-Solovev let's move it to folder named rfcs/20250612-static-libs-handling and name file itself as README.md there.

In this case it also would be rendered properly and you could add images and other content related to RFC

@napetrov
Copy link
Contributor

Might be elaborate more on several things.

  1. With current use dynamic is considered to be primarily used and what is used in sklearnex. So static cases are targeted on C++ users looking for removing runtime dependencies.
  2. Mention both Linux and windows cases and that proposal covers both.
  3. How dependency management is proposed to be handled - defining dependency only for static library packages i.e. dal-static would require mkl-static as an example
  4. What need to be done for this RFC - change in build system, dependency updates for existing packages/package managers, documentation/requirements updates, examples updates

@napetrov napetrov added the RFC label Jun 30, 2025
@Alexandr-Solovev Alexandr-Solovev changed the title WIP: Static library handling WIP: libs structure Jul 1, 2025
We propose to change the structure of static library handling in oneDAL to address several growing concerns:

1. **Remove symbol duplication and overbundling**:
Eliminate the current `addlib` logic that embeds all symbols from backend libraries (e.g., MKL/OpenBLAS) directly into the oneDAL static archives.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Alexandr-Solovev Is the aim here to also eliminate static linkage of standard (=present in netlib) CPU-based BLAS/LAPACK functions from MKL? That would be very problematic for the PyPI distribution of sklearnex, and would require some changes in the conda distribution to make it work, plus would make this conda distribution a lot less compatible with installed user environments due to interdependencies and bugs that block upgrades.

## Open Questions

- How will this change impact current downstream consumers who rely on bundled behavior?
- Should we maintain backward compatibility (e.g., via a CMake switch)?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Which cmake scripts does this refer to?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


This approach leads to bundling large static libraries into our own library archives, increasing binary size and leading to symbol duplication or conflicts if the final application also links to the same libraries.

In addition, the upcoming oneMKL releases will **remove support for static SYCL libraries** (`libmkl_sycl*.a`). To remain compatible with the future oneMKL toolchain and simplify our own build system, we propose to **drop static SYCL support in oneDAL** as well.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we should separate proposals to make them clear - in fact i don't think there is need for SYCL one as currently it impact no other parties.

The core gist of this proposal is idea of changing way how we handle static cases for oneDAL - instead of addlib math backends - define build time dependency on them

@Alexandr-Solovev Alexandr-Solovev changed the title WIP: libs structure WIP: static libraries handling Jul 2, 2025
Copy link
Contributor
@Vika-F Vika-F left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this com 8000 ment to others. Learn more.

Agree with Nikolay that the description of the changes that have to be implemented for this RFC needs to be added (besides the link to the actual PR).

Simplifies both Bazel and CMake logic by removing fragile `addlib`-style manual bundling.

* What is the customer impact if we don't do this?
* Users may face issues with dependencies handling.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Examples needed here. Which particular issues would users face?

It would be good to provide the link lines "before" and "after" for some particular configuration, Linux + oneMKL, for example.

@david-cortes-intel
Copy link
Contributor

A different and mutually exclusive RFC: #3290

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0