-
Notifications
You must be signed in to change notification settings - Fork 222
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
[CI, enhancement] use -fvisibility=hidden in Linux Make builds #3080
Open
icfaust
wants to merge
164
commits into
uxlfoundation:main
Choose a base branch
from
icfaust:dev/ABI_verification
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,683
−844
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/intelci: run |
/intelci: run |
/intelci: run |
/intelci: run |
/intelci: run |
/intelci: run |
/intelci: run |
/intelci: run |
more advanced CI run showing no problems (ignore infrastructure issues, tests still ran through properly) http://intel-ci.intel.com/effdbfb8-1661-f1b1-9595-a4bf010d0e2d |
/intelci: run |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR uses
__attribute__ ((visibility ("default")))
https://gcc.gnu.org/wiki/Visibility to make the oneDAL dynamic libraries in Linux follow Windows in having default visibility of symbols as hidden. This will make the Linux ABI explicit, and make possible improvements in use of the oneDAL library as described in the linked article. In general, most problems are related to implicit Instantiation, which doesn't respect the added attribute for visibility.NOTE: Building with Bazel still maintains standard linux visibility, the change in visibility only occurs in Make builds.
The changes focus in several overarching themes:
DAAL Implicit Instantiation of the AlgorithmDispatchContainer is removed by moving all Batch, Online and Distributed object constructors from the class definition to individual definitions in the *_dispatch.cpp files. This follows convention set by some algorithms: KNN, stump, etc. Follow up work is recommended to solve public exposition and requirement of an internal namespace in SVM which violates convention.
DAAL Linear model interpolation cannot follow the convention in 1) due to certain re-use of the AlgorithmDispatchContainer, instead the
initialize
method is moved to *_dispatch.cpp for Linear Regression, Logistic Regression, Lasso, Ridge, and ElasticNet. A note is made on this change in the codebase, as it is a special case of a reuse of another algorithms AlgorithmDispatchContainer.DAAL RNG engine instantion of the object is moved from a general
.cpp
file to just thecreate
function, and the other instantiation of the contructors are done following the methodology laid out in 1)DAAL An outlier file in Expectation Maximization is removed (which is the implementation of 1) in the wrong file and follows now convention set out in 1) using
*_dispatcher.cpp
.DAAL Macro definition is changed for AlgorithmDispatchContainer to guarantee that it is exported for various architectures for Batch computations.
General changes to the makefile and DAAL_EXPORT/ ONEDAL_EXPORT are made to generalize and activate the default hidden visibility. Subtle logic changes are made
oneDAL ONEDAL_EXPORT is added in several places where the logic differs between windows use of
__declspec(dllexport)
and__attribute__ ((visibility ("default")))
, which varies by compiler and OS to make it valid for all circumstances.oneDAL some implicit instantiations are fixed. (See incremental algorithms)
oneDAL ONEDAL_EXPORT for spmd is properly addressed which should make it possible to use with windows OS (not that this is recommended)
Note: this PR has been additionally tested against a main sklearnex build to verify conformance.
This reduces the dynamic table length in Linux by 10x in DAAL, and x5 overall.
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
Testing
Performance