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

CMake: HIP Debug with -O1 #3487

Merged
merged 1 commit into from
Aug 12, 2023

Conversation

ax3l
Copy link
Member

@ax3l ax3l commented Aug 9, 2023

Summary

Same work-around as in GNUmake, see
#3311

  • testing

Additional background

Checklist

The proposed changes:

  • fix a bug or incorrect behavior in AMReX
  • add new capabilities to AMReX
  • changes answers in the test suite to more than roundoff level
  • are likely to significantly affect the results of downstream AMReX users
  • include documentation in the code and/or rst files, if appropriate

Same work-around as in GNUmake, see
  AMReX-Codes#3311
@ax3l
Copy link
Member Author

ax3l commented Aug 9, 2023

cmake -S . -B build -DCMAKE_BUILD_TYPE=Debug -DAMReX_GPU_BACKEND=HIP

With -O0 (develop for Debug) I wait for >1hr on Frontier to compile large AMReX files such as

[  1%] Building CXX object Src/CMakeFiles/amrex_3d.dir/Amr/AMReX_Extrapolater.cpp.o
[  3%] Building CXX object Src/CMakeFiles/amrex_3d.dir/LinearSolvers/MLMG/AMReX_MLNodeLaplacian.cpp.o
[  3%] Building CXX object Src/CMakeFiles/amrex_3d.dir/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_sync.cpp.o
[  4%] Building CXX object Src/CMakeFiles/amrex_3d.dir/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_sten.cpp.o
[  4%] Building CXX object Src/CMakeFiles/amrex_3d.dir/LinearSolvers/MLMG/AMReX_MLNodeLaplacian_misc.cpp.o

using ROCm 5.2.

With this patch, -O1 is successfully added on the command line in Debug builds:

[  1%] Building CXX object Src/CMakeFiles/amrex_3d.dir/Amr/AMReX_Extrapolater.cpp.o
cd /ccs/home/huebl/src/amrex/build/Src && /opt/rocm-5.2.0/bin/hipcc -DAMREX_SPACEDIM=3 -D__HIP_PLATFORM_AMD__=1 -D__HIP_PLATFORM_HCC__=1 -I/ccs/home/huebl/src/amrex/Src/Base -I/ccs/home/huebl/src/amrex/Src/Base/Parser -I/ccs/home/huebl/src/amrex/Src/Boundary -I/ccs/home/huebl/src/amrex/Src/AmrCore -I/ccs/home/huebl/src/amrex/Src/Amr -I/ccs/home/huebl/src/amrex/Src/LinearSolvers/MLMG -I/ccs/home/huebl/src/amrex/Src/LinearSolvers/OpenBC -I/ccs/home/huebl/src/amrex/Src/Particle -I/ccs/home/huebl/src/amrex/build -isystem /opt/cray/pe/mpich/8.1.23/ofi/cray/10.0/include -isystem /opt/rocm-5.2.0/include/hiprand -isystem /opt/rocm-5.2.0/include/rocrand -I/opt/rocm-5.2.0/include -Wno-pass-failed -g -O1 --offload-arch=gfx90a -m64 -munsafe-fp-atomics -std=c++17 -fgpu-rdc -x hip --offload-arch=gfx90a -std=c++17 -MD -MT Src/CMakeFiles/amrex_3d.dir/Amr/AMReX_Extrapolater.cpp.o -MF CMakeFiles/amrex_3d.dir/Amr/AMReX_Extrapolater.cpp.o.d -o CMakeFiles/amrex_3d.dir/Amr/AMReX_Extrapolater.cpp.o -c /ccs/home/huebl/src/amrex/Src/Amr/AMReX_Extrapolater.cpp
...

still builds very long on these object files...

@ax3l ax3l merged commit a12d498 into AMReX-Codes:development Aug 12, 2023
66 checks passed
@ax3l ax3l deleted the work-around-hip-debug-O1 branch August 12, 2023 01:09
@ax3l
Copy link
Member Author

ax3l commented Aug 12, 2023

There are more bugs in ROCm in debug builds, which we filed this with HPE/AMD.

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

Successfully merging this pull request may close these issues.

2 participants