Skip to content

Fix: Kokkos 5 performances on AMD - #402

Merged
glesur merged 8 commits into
developfrom
fixK5_AMD_perfs
Aug 26, 2026
Merged

Fix: Kokkos 5 performances on AMD#402
glesur merged 8 commits into
developfrom
fixK5_AMD_perfs

Conversation

@glesur

@glesur glesur commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Limit the thread size to avoid register spilling on AMD archs

@glesur glesur added the bug Something isn't working label Aug 24, 2026
@glesur

glesur commented Aug 25, 2026

Copy link
Copy Markdown
Contributor Author
  • Add compiler informations in the logs and in stdout
  • allow user to disable fuse multiple adds through the cmake option Idefix_SUPPRESS_FMA (which is compiler-dependent)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to improve performance on AMD architectures with Kokkos 5 by constraining kernel launch characteristics, and also modernizes build-time metadata (version/compiler info) while adding a configurable way to suppress FMA for cross-architecture validation.

Changes:

  • Constrain Kokkos parallel_for range kernels via LaunchBounds<256> in idefix_for wrappers to mitigate AMD register spilling.
  • Replace the generated-in-source version.hpp mechanism with CMake-generated headers (version.h, compiler_info.h) and update outputs/version printing to use them.
  • Add Idefix_SUPPRESS_FMA and a SuppressFMA.cmake helper to disable FMA contraction across toolchains; update the Python test harness to enable it for bitwise-stable comparisons.

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/version.h.in New template for a generated version header (commit + semantic version strings).
src/compiler_info.h.in New template for a generated compiler metadata header.
src/output/xdmf.cpp Switch XDMF header version string source to VersionInfo::version.
src/output/vtk.cpp Switch VTK header version string source to VersionInfo::version.
src/output/dump.cpp Switch dump header version string source to VersionInfo::version.
src/input.cpp Print version via VersionInfo and add compiler metadata output.
src/dataBlock/dumpToFile.cpp Switch debug dump header version string source to VersionInfo::version.
src/loop.hpp Apply Kokkos LaunchBounds<256> to range-based parallel_for loops.
pytools/idfx_test.py Enable Idefix_SUPPRESS_FMA in test CMake invocation for CPU/GPU bitwise consistency.
CMakeLists.txt Add Idefix_SUPPRESS_FMA, generate headers via configure_file, and wire in suppression helper.
cmake/SuppressFMA.cmake New module to apply backend/compiler-specific flags to suppress FMA contraction/codegen.
Suppressed comments (2)

CMakeLists.txt:196

  • configure_file() writes to ${CMAKE_BINARY_DIR}/build/generated/..., but that directory is never created. On a fresh build tree this will fail at configure time with a "cannot open output file" error. Create the directory once before the first configure_file() call.
configure_file(
    ${CMAKE_SOURCE_DIR}/src/version.h.in
    ${CMAKE_BINARY_DIR}/build/generated/version.h
    @ONLY
)

cmake/SuppressFMA.cmake:76

  • The doc comment says the flags are applied "only when the SUPPRESS_FMA option is ON", but this module doesn't define/check that option (the caller currently gates via Idefix_SUPPRESS_FMA). This is misleading if the function is reused elsewhere.
# Applies compiler-specific FMA-suppression flags to <target>'s CXX
# sources, but only when the SUPPRESS_FMA option is ON. Safe to call
# unconditionally.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread CMakeLists.txt Outdated
Comment thread cmake/SuppressFMA.cmake Outdated
glesur and others added 2 commits August 26, 2026 09:07
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@glesur
glesur merged commit 73255b0 into develop Aug 26, 2026
41 checks passed
@glesur
glesur deleted the fixK5_AMD_perfs branch August 26, 2026 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants