-
Notifications
You must be signed in to change notification settings - Fork 0
Add official MKL cmake finder. #147
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
Conversation
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.
So the good thing about this version is they're using modern cmake conventions.
I do want to ask however, is the version we worked on not working?
This script is almost 900 lines of really complicated configurations. The goal of it is to "just work" for a huge number of potential target platforms.
However, for our needs, we probably only need to target one or two platforms and compilers. So I'd prefer if we checked in a simpler script that only targets our use cases.
We'll need to eventually port this to bazel and it'll go much smoother if we know exactly what options and settings we're building this library with, instead of having to filter through all this noise.
What we had was working in CI for orion-engine but not for orion (although it seemed like they were using the same Dockerfile which is puzzling). I was hoping this could also be more friendly for local development than what we spun up. As for porting to bazel, I see that Tensorflow supports mkl in their bazel builds so hopefully, we can reuse if not just copy their implementation for our usecase. In the meantime, I can take a stab at gutting some of this config. |
FindMKL.cmake
Outdated
| target_compile_options( | ||
| MKL::MKL INTERFACE $<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,C>:${MKL_C_COPT}> $<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,Fortran>:${MKL_F_COPT}> | ||
| $<$<STREQUAL:$<TARGET_PROPERTY:LINKER_LANGUAGE>,CXX>:${MKL_CXX_COPT}> $<IF:$<BOOL:${ENABLE_OMP_OFFLOAD}>,${MKL_OFFLOAD_COPT},>) | ||
| target_link_libraries(MKL::MKL INTERFACE ${MKL_LINK_LINE} ${MKL_THREAD_LIB} ${MKL_SUPP_LINK}) |
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.
My suggestions would be to capture whatever these lines end up expanding to for our target and hardcoding that.
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.
Sorry just saw this now. I'll add that after the hackathon.
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.
@isaactorz I have addressed your concerns and hardcoded these blocks.
6c8b5d9 to
c55d6ec
Compare
ae94b33 to
954b023
Compare
954b023 to
4261355
Compare
|
Kudos, SonarCloud Quality Gate passed! |
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.
Just one small nit otherwise this is a lot clearer as to what options we're actually setting up in our build 👍🏼 .
FindMKL.cmake
Outdated
| set(MKL_ARCH intel64) | ||
| set(MKL_INTERFACE_FULL intel_lp64) | ||
| set(MKL_THREADING gnu_thread) |
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.
Consider getting rid of these variables and just adding them directly to MKL_LINK_LINE below. Having them more localized to where they're actually used will make this a bit more readable.
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.
Done. Fair enough.
|
Kudos, SonarCloud Quality Gate passed! |








${MKLROOT}/lib/cmake/mkl/MKLConfig.cmake.