Skip to content
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

[DFT][MKLGPU] Update mklgpu support to mkl preparing for oneapi 2025.0 release #575

Merged
merged 8 commits into from
Oct 11, 2024

Conversation

s-Nick
Copy link
Contributor

@s-Nick s-Nick commented Sep 27, 2024

Description

Update how dft mklgpu backend includes header files from MKL and how cmake adds them to compilation.
This is done to avoid future name conflicts between this library and backend library. Forcing the compiler to look for some headers following the "" and <> inclusions rules accordingly with C++ Core Guideline SF.12

Checklist

All Submissions

  • Do all unit tests pass locally? Attach a log.
    arc_mklgpu_dft_log.txt
    N.B. Tests ran with current oneAPI release (2024.2) I cannot run tests with next one.

  • Have you formatted the code using clang-format?

Update how dft mklgpu backend include header files from MKL and how
cmake add them to compilation. This is done to avoid name conflicts
between interface and library backends. Force compiler to look for some
header following the "" and <> inclusions rules accordingly with
C++ Core Guideline SF.12
@s-Nick s-Nick requested a review from Rbiessy September 27, 2024 08:31
@@ -32,12 +32,14 @@ add_library(${LIB_OBJ} OBJECT
)
add_dependencies(onemkl_backend_libs_dft ${LIB_NAME})

target_include_directories(${LIB_OBJ}
PUBLIC ${ONEMKL_INTERFACE_INCLUDE_DIRS}
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Giving the includes change I made a little bit down. This command is not necessary anymore, so I decided to remove it trying to keep the cmake as lean as possible.

Copy link
Contributor

@Rbiessy Rbiessy left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for this.
I'll approve once we have been able to test this with nightly builds.

src/dft/backends/mklgpu/CMakeLists.txt Show resolved Hide resolved
The new MKL release changed the message of unimplemented exception.
Since tests were skipped by checking that message, some tests started to
fail. Update skipping check to keep compatibility with both versions.
Removing enum elements that cause compilation failure in MKL 2025.0
Apparently also previous version don't need them.
@s-Nick
Copy link
Contributor Author

s-Nick commented Oct 8, 2024

Log using next MKL
dft_mklgpu_2025_log.txt

Copy link
Contributor

@lhuot lhuot left a comment

Choose a reason for hiding this comment

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

LGTM, minor comment added. Thank you!

target_include_directories(${LIB_NAME}
PUBLIC ${ONEMKL_INTERFACE_INCLUDE_DIRS}
)

# Due to using the same file name for different headers in this library and in
# MKL Intel library, we force the compiler to follow C++ Core Guideline SF.12
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# MKL Intel library, we force the compiler to follow C++ Core Guideline SF.12
# the Intel(R) oneAPI Math Kernel Library, we force the compiler to follow C++ Core Guideline SF.12

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you @lhuot I updated the comment in 18bd3da

@s-Nick s-Nick merged commit 9c31b7d into oneapi-src:develop Oct 11, 2024
6 checks passed
@@ -75,7 +75,8 @@ class ComputeTests_real_real_out_of_place_REAL
} \
catch (std::exception & e) { \
std::string msg = e.what(); \
if (msg.find("FFT_UNIMPLEMENTED") != std::string::npos) { \
if ((msg.find("FFT_UNIMPLEMENTED") != std::string::npos) || \
(msg.find("Unimplemented") != std::string::npos)) { \

Choose a reason for hiding this comment

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

@s-Nick, was this addition motivated by a new exception that's not a oneapi::mkl::unimplemented exception with "Unimplemented" in its message? If yes, could you please share details?

acmnpv pushed a commit to gromacs/gromacs that referenced this pull request Oct 21, 2024
Intel oneMKL deprecated the old descriptors in 2024.1
and is very vocal at runtime about it.

Open-source oneMKL added the new descriptors in v0.5.
As they don't have versioning macros just yet and we
don't prioritize backward-compatibility there, we
bump the minimal required version of oneMKL.

Also update the include path for the upcoming oneMKL 2025.0
(ref: oneapi-src/oneMKL#575) and
remove an outdated comment.

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

Successfully merging this pull request may close these issues.

4 participants