Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Static link MKL-DNN library #16731

Merged
merged 5 commits into from
Nov 14, 2019
Merged

Conversation

TaoLv
Copy link
Member

@TaoLv TaoLv commented Nov 5, 2019

Description

This PR intends to change MKL-DNN library from dynamic linking to static linking. That will help:

  1. Simplify the build, packaging and distribution process;
  2. Avoid linkage error during runtime when different versions of MKL-DNN are installed on user's machine.

There were other attempts to do so before. But before MKL-DNN v1.0 integrated, it also depends on libmklml_intel.so. So it doesn't make much sense if we only make MKL-DNN static linked and leave libmklml_intel.so outside.

This PR is also removing a python unit test which was designed to check MKL-DNN install by doing grep against the proc maps to make sure mkldnn.so is linked. After changing to static link, the approach would not work and not needed.

Checklist

Essentials

Please feel free to remove inapplicable items for your PR.

  • The PR title starts with [MXNET-$JIRA_ID], where $JIRA_ID refers to the relevant JIRA issue created (except PRs with tiny changes)
  • Changes are complete (i.e. I finished coding on this PR)
  • All changes have test coverage:
  • Unit tests are added for small changes to verify correctness (e.g. adding a new operator)
  • Nightly tests are added for complicated/long-running ones (e.g. changing distributed kvstore)
  • Build tests will be added for build configuration changes (e.g. adding a new build option with NCCL)
  • Code is well-documented:
  • For user-facing API changes, API doc string has been updated.
  • For new C++ functions in header files, their functionalities and arguments are documented.
  • For new examples, README.md is added to explain the what the example does, the source of the dataset, expected performance on test set and reference to the original paper if applicable
  • Check the API doc at https://mxnet-ci-doc.s3-accelerate.dualstack.amazonaws.com/PR-$PR_ID/$BUILD_ID/index.html
  • To the my best knowledge, examples are either not affected by this change, or have been fixed to be compatible with this change

Changes

  • Feature1, tests, (and when applicable, API doc)
  • Feature2, tests, (and when applicable, API doc)

Comments

  • If this change is a backward incompatible change, why must this change be made.
  • Interesting edge cases to note here

@pengzhao-intel
Copy link
Contributor

@TaoLv could you give a simple summary of the reason for this change and any possible impacts?

@TaoLv
Copy link
Member Author

TaoLv commented Nov 7, 2019

@pengzhao-intel , sure, PR description is added.

@TaoLv
Copy link
Member Author

TaoLv commented Nov 7, 2019

@szha @lanking520 @perdasilva @marcoabreu Could you please review, especially the parts about CD and packaging?

@pengzhao-intel
Copy link
Contributor

@pengzhao-intel , sure, PR description is added.

Very great explanation. Ping me when your PR is ready to merge.

@pengzhao-intel
Copy link
Contributor

Wait for the internal testing results. Let's know if you have any comments or concerns.
I will merge the PR after we get the internal validation results.

Copy link
Contributor

@marcoabreu marcoabreu left a comment

Choose a reason for hiding this comment

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

LGTM so far. Let me know when you need the final review after it's no longer WIP

@TaoLv TaoLv changed the title [WIP] Static link MKL-DNN library Static link MKL-DNN library Nov 12, 2019
@TaoLv
Copy link
Member Author

TaoLv commented Nov 12, 2019

@szha @lanking520 @perdasilva @marcoabreu Call for review :)

CPU Performance and Quantization automation moved this from In progress to Reviewer approved Nov 12, 2019
@lanking520
Copy link
Member

Have you tried?

source tools/staticbuild/build.sh mkl pip

@TaoLv
Copy link
Member Author

TaoLv commented Nov 13, 2019

@lanking520 Attached the build log. Please take a look. Thanks!
build_mkl_pip.txt

@pengzhao-intel
Copy link
Contributor

Merging now

@pengzhao-intel pengzhao-intel merged commit 017f6fa into apache:master Nov 14, 2019
CPU Performance and Quantization automation moved this from Reviewer approved to Done Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants