Skip to content

Commit

Permalink
Merge branch 'release/1.5.0'
Browse files Browse the repository at this point in the history
* release/1.5.0: (86 commits)
  Version 1.5.0
  Workaround for supporting GPU-aware MPI on Cray/AMD platforms
  Workaround for ASYNC statements in TRMTOL for AMD GPUs
  Pin buffers in benchmark (#158)
  Remove default values for TPM_GEN variables (#159)
  Fix case inconsistencies
  Add option to not do in-place FFT
  Search for OpenACC only if explicitly enabled
  Use Fortran linker for ectrans_test_setup_trans0
  Update CMakeLists.txt
  Fix tabs
  Fix typo in TRGTOL
  Update src/trans/gpu/algor/hicfft.hip.cpp
  Update paths to HIP includes to support ROCm > 6
  add gpu graphs define
  Fixup diagnostic prints missing since #141
  add ungrouepd gemms
  Make default for --niter-warmup 3 if not specified, experimentally a better value
  Add --niter-warmup command line option to be able to configure warmup iterations
  Remove spurious print
  ...
  • Loading branch information
wdeconinck committed Oct 11, 2024
2 parents 5e920dd + 6381f11 commit ed88c5a
Show file tree
Hide file tree
Showing 207 changed files with 2,330 additions and 12,032 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,25 @@ jobs:
path: ${{ env.DEPS_DIR }}
key: deps-${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}-${{ env.CACHE_SUFFIX }}

# Free up disk space for nvhpc
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
if: contains( matrix.compiler, 'nvhpc' )
continue-on-error: true
with:
# this might remove tools that are actually needed,
# if set to "true" but frees about 6 GB
tool-cache: false

# all of these default to true, but feel free to set to
# "false" if necessary for your workflow
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Install NVHPC compiler
if: contains( matrix.compiler, 'nvhpc' )
shell: bash -eux {0}
Expand Down Expand Up @@ -171,13 +190,9 @@ jobs:
recreate_cache: ${{ matrix.caching == false }}
dependencies: |
ecmwf/ecbuild
ecmwf/eckit
ecmwf/fckit
ecmwf-ifs/fiat
dependency_branch: develop
dependency_cmake_options: |
ecmwf/eckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF -DENABLE_ECKIT_CMD=OFF -DENABLE_ECKIT_SQL=OFF -DENABLE_MPI=ON -DENABLE_OMP=OFF"
ecmwf/fckit: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF"
ecmwf-ifs/fiat: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DENABLE_TESTS=OFF -DENABLE_MPI=ON"
cmake_options: "-G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.cmake_options }} -DENABLE_MPI=ON -DENABLE_FFTW=ON"
ctest_options: "${{ matrix.ctest_options }}"
Expand Down
27 changes: 17 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,16 @@ ecbuild_add_option( FEATURE OMP
DESCRIPTION "Support for OpenMP shared memory parallelism"
REQUIRED_PACKAGES "OpenMP COMPONENTS Fortran" )

if( ${CMAKE_VERSION} VERSION_LESS "3.25" AND (NOT DEFINED ENABLE_ACC OR ENABLE_ACC ) )
# See https://gitlab.kitware.com/cmake/cmake/-/issues/23691, fixed in CMake 3.25
# (TL;DR: FindOpenACC sets OpenACC_<LANG>_FOUND correctly but does not set
# OpenACC_FOUND unless all three C, CXX, and Fortran have been found - even if
# only one language has been requested via COMPONENTS)
find_package( OpenACC COMPONENTS Fortran )
if( OpenACC_Fortran_FOUND )
set( OpenACC_FOUND ON )
if( ${CMAKE_VERSION} VERSION_LESS "3.25" )
if ( ECTRANS_ENABLE_ACC OR (NOT DEFINED ECTRANS_ENABLE_ACC AND ENABLE_ACC) )
# See https://gitlab.kitware.com/cmake/cmake/-/issues/23691, fixed in CMake 3.25
# (TL;DR: FindOpenACC sets OpenACC_<LANG>_FOUND correctly but does not set
# OpenACC_FOUND unless all three C, CXX, and Fortran have been found - even if
# only one language has been requested via COMPONENTS)
find_package( OpenACC COMPONENTS Fortran )
if( OpenACC_Fortran_FOUND )
set( OpenACC_FOUND ON )
endif()
endif()
endif()

Expand Down Expand Up @@ -104,8 +106,8 @@ endif()

ecbuild_add_option( FEATURE GPU
DEFAULT OFF
DESCRIPTION "Compile GPU version of ectrans (Requires OpenACC or sufficient OpenMP offloading support and MPI)"
CONDITION (HAVE_HIP OR HAVE_CUDA) AND (HAVE_ACC OR HAVE_OMP) AND HAVE_MPI )
DESCRIPTION "Compile GPU version of ectrans (Requires OpenACC or sufficient OpenMP offloading support)"
CONDITION (HAVE_HIP OR HAVE_CUDA) AND (HAVE_ACC OR HAVE_OMP) )

if( HAVE_GPU )
if( HAVE_ACC )
Expand Down Expand Up @@ -140,6 +142,11 @@ ecbuild_add_option( FEATURE GPU_GRAPHS_GEMM
CONDITION HAVE_GPU
DESCRIPTION "Enable graph-based optimisation of Legendre transform GEMM kernel" )

ecbuild_add_option( FEATURE GPU_GRAPHS_FFT
DEFAULT ON
CONDITION HAVE_GPU
DESCRIPTION "Enable graph-based optimisation of FFT kernels" )

if( BUILD_SHARED_LIBS )
set( GPU_STATIC_DEFAULT OFF )
else()
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ Extra options can be added to the `cmake` command to control the build:
Specific extra options exist for GPU installation:
- `-DENABLE_GPU_AWARE_MPI=<ON|OFF>` default=OF
- `-DENABLE_GPU_GRAPHS_GEMM=<ON|OFF>` default=ON
- `-DENABLE_GPU_GRAPHS_FFT=<ON|OFF>` default=ON
- `-DENABLE_CUTLASS=<ON|OFF>` default=OFF
- `-DENABLE_3XTF32=<ON|OFF>` default=OFF

Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.0
1.5.0
6 changes: 3 additions & 3 deletions cmake/ectrans_compile_options.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ if( NOT DEFINED ECTRANS_HAVE_CONTIGUOUS_ISSUE )
endif()

macro( ectrans_add_compile_options )
set( options )
set( single_value_args FLAGS )
set( options NOFAIL )
set( single_value_args FLAGS)
set( multi_value_args SOURCES )
cmake_parse_arguments( _PAR "${options}" "${single_value_args}" "${multi_value_args}" ${_FIRST_ARG} ${ARGN} )
if(_PAR_UNPARSED_ARGUMENTS)
Expand All @@ -59,7 +59,7 @@ macro( ectrans_add_compile_options )
endif()
foreach( _file ${_PAR_SOURCES} )
ecbuild_warn("Adding custom compile flags for file ${_file} : [${_PAR_FLAGS}]")
if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_file} )
if( NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${_file} AND NOT _PAR_NOFAIL)
ecbuild_error("${_file} does not exist")
endif()
set_source_files_properties( ${_file} PROPERTIES COMPILE_FLAGS "${_PAR_FLAGS}" )
Expand Down
14 changes: 11 additions & 3 deletions src/programs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@ foreach( program ectrans-benchmark )
parkind_${prec}
trans_gpu_${prec}
OpenACC::OpenACC_Fortran
)
target_compile_definitions(${program}-gpu-${prec} PRIVATE VERSION="gpu")
endif()
DEFINITIONS
VERSION="gpu"
$<$<COMPILE_LANG_AND_ID:Fortran,NVHPC>:USE_PINNED>
)
target_compile_options(${program}-gpu-${prec} PUBLIC
$<$<COMPILE_LANG_AND_ID:Fortran,NVHPC>:-cuda>
)
target_link_options(${program}-gpu-${prec} PUBLIC
$<$<LINK_LANG_AND_ID:Fortran,NVHPC>:-cuda>
)
endif()
endforeach( prec )
endif( HAVE_GPU )
endforeach( program )
Expand Down
Loading

0 comments on commit ed88c5a

Please sign in to comment.