-
Notifications
You must be signed in to change notification settings - Fork 24.2k
Fix USE_STATIC_MKL
lost functionality
#138996
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
base: main
Are you sure you want to change the base?
Fix USE_STATIC_MKL
lost functionality
#138996
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/138996
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 1 New Failure, 1 Unrelated FailureAs of commit 0743eb8 with merge base 56e1c23 ( NEW FAILURE - The following job has failed:
FLAKY - The following job failed but was likely due to flakiness present on trunk:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
a83f021
to
b920061
Compare
dffb3eb
to
6661809
Compare
6661809
to
03e7cd2
Compare
CMakeLists.txt
Outdated
@@ -330,7 +330,7 @@ cmake_dependent_option( | |||
set(MKLDNN_ENABLE_CONCURRENT_EXEC ${USE_MKLDNN}) | |||
cmake_dependent_option(USE_MKLDNN_CBLAS "Use CBLAS in MKLDNN" OFF "USE_MKLDNN" | |||
OFF) | |||
option(USE_STATIC_MKL "Prefer to link with MKL statically (Unix only)" OFF) | |||
option(USE_STATIC_MKL "Prefer to link with MKL statically (recommanded)." ON) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rec911ended
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezyang not understand it. And I'm still fixing CI now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo. But also, we don't want static MKL, this is a deliberate decision
03e7cd2
to
a2799f3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before changing the default, let's discuss benefits/drawback of doing it one way vs another. If I'm building locally, dynamic is always preferred, isn't it?
The only time you want to link with MKL statically if you ship binaries, as that makes your life much easier, but downside is bulkier releases, and considering PyPI size limit we want to rely on https://pypi.org/project/mkl/ which requires dynamic linking
Thanks for your reply, then let keep using MKL shared as default config. |
b26c81b
to
9f66386
Compare
Fixes #138994 We can turn off `USE_MIMALLOC_ON_MKL` temporary. Due to it caused #138994 For totally fixed, we need fix `USE_STATIC_MKL` lost functionality issue: #138996, and then get the correctly MKL linking type(shared/static). It still need some time to pass all CI and builder scripts. Pull Request resolved: #139204 Approved by: https://github.com/ezyang
Fixes pytorch#138994 We can turn off `USE_MIMALLOC_ON_MKL` temporary. Due to it caused pytorch#138994 For totally fixed, we need fix `USE_STATIC_MKL` lost functionality issue: pytorch#138996, and then get the correctly MKL linking type(shared/static). It still need some time to pass all CI and builder scripts. Pull Request resolved: pytorch#139204 Approved by: https://github.com/ezyang
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
6a705bf
to
00d0a9b
Compare
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
0a552d4
to
af28920
Compare
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Successfully rebased |
af28920
to
26e1837
Compare
After some debug work, we fixed almost CI issues, except
Due to I didn't have
For the difference information as below: -- MKL_ARCH: None, set to ` intel64` by default
-- MKL_ROOT /opt/conda
-- MKL_LINK: None, set to ` dynamic` by default
-- MKL_INTERFACE_FULL: None, set to ` intel_ilp64` by default
-- MKL_THREADING: None, set to ` intel_thread` by default
-- MKL_MPI: None, set to ` intelmpi` by default I found it is expected print from For @chuanqi129 will help us check the CI/CD environment for |
@pytorchbot rebase |
@pytorchbot started a rebase job onto refs/remotes/origin/viable/strict. Check the current status here |
Rebase failed due to Command
Raised by https://github.com/pytorch/pytorch/actions/runs/15062453526 |
* fix USE_STATIC_MKL on Linux. * fix USE_STATIC_MKL on Windows. * keep set USE_STATIC_MKL off. * fix shared mkl version number.
remove debug log. Work around MKL for CUDA.
a095c9a
to
0743eb8
Compare
Currently,
USE_STATIC_MKL
is lost functionality to controlstatic
orshared
link mkl of PyTorch. The reason iscmake/Modules/FindMKL.cmake
code ignoreUSE_STATIC_MKL
cmake variable. And search MKL libraries with many work around.This PR is target to fix this issue. It is important to PyTorch
XPU
version build, we expected that:CPU
andCUDA
build, link MKL staticly.XPU
build, link MKL shared link. We would have oneAPI environment, we can re-use shared MKL binaries.The MKL config, we can reference to Intel official online tool: https://www.intel.com/content/www/us/en/developer/tools/oneapi/onemkl-link-line-advisor.htm
After fixed
USE_STATIC_MKL
option, we need to install correctly MKL version. Otherwise, it shouldn't find MKL binaries. To install MKL:Install MKL
static
version on Windows/Linux:Install MKL
shared
version on Windows/Linux:Changes:
USE_STATIC_MKL
lost functionality on Linux.USE_STATIC_MKL
lost functionality on Windows.USE_STATIC_MKL
default value toON
, we recommanded to linkMKL
statically.TODO:
Setup correct
USE_STATIC_MKL
to CI system.USE_STATIC_MKL
correctly in CI, need to match correct installedMKL
version.cc @jgong5 @mingfeima @XiaobingSuper @sanchitintel @ashokei @jingxu10