Skip to content

Commit 6a3abf8

Browse files
authored
Merge #2003 Bump ROCm support 6.2.0+
This PR bumps ROCm support 6.2.0+ Related PR: #2003
2 parents d15ec2d + a1795d8 commit 6a3abf8

32 files changed

Lines changed: 64 additions & 417 deletions

.gitlab-ci.yml

Lines changed: 26 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -226,88 +226,23 @@ build/cuda131/nompi/gcc/cuda/release/shared:
226226
BUILD_TYPE: "Release"
227227
MODULE_LOAD: "cmake/3.30.8 cuda/13.1.1 gcc/14.3.0"
228228

229-
# ROCm 4.5 and friends
230-
build/amd/nompi/gcc/rocm45/release/shared:
229+
build/amd/openmpi/gcc/rocm620/debug/shared:
231230
extends:
232-
- .build_and_test_template
231+
- .build_and_test_tum_template
233232
- .default_variables
234233
- .quick_test_condition
235-
- .use_gko-rocm45-nompi-gnu8-llvm8
234+
- .use_tum-amd
236235
variables:
237-
BUILD_OMP: "ON"
238236
BUILD_HIP: "ON"
239-
NONDEFAULT_STREAM: "ON"
240-
BUILD_TYPE: "Release"
241237
BUILD_HWLOC: "OFF"
242-
243-
build/amd/nompi/clang/rocm45/release/static:
244-
extends:
245-
- .build_and_test_template
246-
- .default_variables
247-
- .full_test_condition
248-
- .use_gko-rocm45-nompi-gnu8-llvm8
249-
variables:
250-
CXX_COMPILER: "clang++"
251-
BUILD_OMP: "ON"
252-
BUILD_HIP: "ON"
253-
BUILD_TYPE: "Release"
254-
BUILD_SHARED_LIBS: "OFF"
255-
ENABLE_HALF: "OFF"
256-
ENABLE_BFLOAT16: "ON"
257-
258-
build/amd/nompi/clang/rocm45/debug/shared:
259-
extends:
260-
- .build_and_test_template
261-
- .default_variables
262-
- .full_test_condition
263-
- .use_gko-rocm45-nompi-gnu8-llvm8
264-
variables:
265-
CXX_COMPILER: "clang++"
266-
BUILD_OMP: "ON"
267-
BUILD_HIP: "ON"
268-
BUILD_TYPE: "Debug"
269-
270-
# ROCm 5.1.4 and friends
271-
build/amd/nompi/gcc/rocm514/debug/static:
272-
extends:
273-
- .build_and_test_template
274-
- .default_variables
275-
- .full_test_condition
276-
- .use_gko-rocm514-nompi-gnu11-llvm11
277-
variables:
238+
BUILD_MPI: "ON"
278239
BUILD_OMP: "ON"
279-
BUILD_HIP: "ON"
280240
BUILD_TYPE: "Debug"
281-
BUILD_SHARED_LIBS: "OFF"
282-
283-
build/amd/nompi/clang/rocm514/release/shared:
284-
extends:
285-
- .build_and_test_template
286-
- .default_variables
287-
- .full_test_condition
288-
- .use_gko-rocm514-nompi-gnu11-llvm11
289-
variables:
290-
CXX_COMPILER: "clang++"
291-
BUILD_OMP: "ON"
292-
BUILD_HIP: "ON"
293-
BUILD_TYPE: "Release"
294-
ENABLE_HALF: "ON"
295-
ENABLE_BFLOAT16: "ON"
296-
297-
# without omp
298-
build/amd/nompi/gcc/rocm514_wo_omp/release/shared:
299-
extends:
300-
- .build_and_test_template
301-
- .default_variables
302-
- .full_test_condition
303-
- .use_gko-rocm514-nompi-gnu11-llvm11
304-
variables:
305-
BUILD_OMP: "OFF"
306-
BUILD_MPI: "OFF"
307-
BUILD_HIP: "ON"
308-
BUILD_TYPE: "Release"
241+
BUILD_SHARED_LIBS: "ON"
242+
MODULE_LOAD: "cmake/3.24.4 rocm/6.2.0 gcc/13.3.0 openmpi/5.0.7"
309243

310-
build/amd/openmpi/gcc/rocm600/release/static:
244+
# rocm 6.3.x is the last version support MI50 officially
245+
build/amd/openmpi/gcc/rocm634_wo_omp/release/shared:
311246
extends:
312247
- .build_and_test_tum_template
313248
- .default_variables
@@ -318,66 +253,52 @@ build/amd/openmpi/gcc/rocm600/release/static:
318253
BUILD_HWLOC: "OFF"
319254
BUILD_MPI: "ON"
320255
BUILD_TYPE: "Release"
321-
BUILD_SHARED_LIBS: "OFF"
322-
MODULE_LOAD: "cmake/3.24.4 rocm/6.0.0 gcc/13.3.0 openmpi/5.0.7"
256+
MODULE_LOAD: "cmake/3.29.6 rocm/6.3.4 gcc/13.3.0 openmpi/5.0.7"
323257

324-
build/amd/nompi/gcc/rocm720/release/shared:
258+
# mi50 is not officially supported by ROCm >= 6.4.0
259+
build/amd/nompi/gcc/rocm644/debug/static:
325260
extends:
326261
- .build_and_test_tum_template
327262
- .default_variables
328263
- .full_test_condition
329-
- .use_tum-amd
264+
- .use_tum-amd-mi210
330265
variables:
331266
BUILD_HIP: "ON"
332-
BUILD_OMP: "OFF"
333267
BUILD_HWLOC: "OFF"
334-
BUILD_TYPE: "Release"
335-
ENABLE_BFLOAT16: "OFF"
336-
ENABLE_HALF: "OFF"
337-
MODULE_LOAD: "cmake/3.25.3 rocm/7.2.0 gcc/12.4.0"
338-
339-
build/amd/nompi/gcc/rocm573/debug/shared:
340-
extends:
341-
- .build_and_test_tum_template
342-
- .default_variables
343-
- .full_test_condition
344-
- .use_tum-amd
345-
variables:
346-
BUILD_HIP: "ON"
268+
BUILD_MPI: "OFF"
347269
BUILD_OMP: "OFF"
348-
BUILD_HWLOC: "OFF"
349270
BUILD_TYPE: "Debug"
350-
ENABLE_BFLOAT16: "ON"
351-
ENABLE_HALF: "OFF"
352-
MODULE_LOAD: "cmake/3.25.3 rocm/5.7.3 gcc/12.4.0"
271+
BUILD_SHARED_LIBS: "OFF"
272+
MODULE_LOAD: "cmake/3.29.6 rocm/6.4.4 gcc/14.3.0"
353273

354-
build/amd/openmpi/gcc/rocm634_wo_omp/release/shared:
274+
build/amd/nompi/gcc/rocm710/release/shared:
355275
extends:
356276
- .build_and_test_tum_template
357277
- .default_variables
358278
- .full_test_condition
359-
- .use_tum-amd
279+
- .use_tum-amd-mi210
360280
variables:
361281
BUILD_HIP: "ON"
362282
BUILD_HWLOC: "OFF"
363-
BUILD_MPI: "ON"
283+
BUILD_MPI: "OFF"
284+
BUILD_OMP: "OFF"
364285
BUILD_TYPE: "Release"
365-
MODULE_LOAD: "cmake/3.29.6 rocm/6.3.4 gcc/13.3.0 openmpi/5.0.7"
286+
MODULE_LOAD: "cmake/3.29.6 rocm/7.1.0 gcc/14.3.0"
366287

367-
# mi50 is not officially supported by ROCm >= 7
368-
build/amd/nompi/gcc/rocm710/release/shared:
288+
build/amd/nompi/gcc/rocm720/release/shared:
369289
extends:
370290
- .build_and_test_tum_template
371291
- .default_variables
372292
- .full_test_condition
373-
- .use_tum-amd-mi210
293+
- .use_tum-amd
374294
variables:
375295
BUILD_HIP: "ON"
376-
BUILD_HWLOC: "OFF"
377-
BUILD_MPI: "OFF"
378296
BUILD_OMP: "OFF"
297+
BUILD_HWLOC: "OFF"
379298
BUILD_TYPE: "Release"
380-
MODULE_LOAD: "cmake/3.29.6 rocm/7.1.0 gcc/14.3.0"
299+
ENABLE_BFLOAT16: "OFF"
300+
ENABLE_HALF: "OFF"
301+
MODULE_LOAD: "cmake/3.25.3 rocm/7.2.0 gcc/12.4.0"
381302

382303
# no cuda but latest gcc and clang
383304
build/nocuda/nompi/gcc/core/debug/static:

CMakeLists.txt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -226,23 +226,12 @@ if(GINKGO_BUILD_CUDA)
226226
endif()
227227
if(GINKGO_BUILD_HIP)
228228
include(cmake/hip.cmake)
229-
if(GINKGO_HIP_PLATFORM_AMD AND GINKGO_HIP_VERSION VERSION_LESS 5.7)
230-
# Hip allow custom namespace but does not fully make everything in the custom namespace before rocm-5.7
231-
# more specific pr: https://github.com/ROCm/rocThrust/pull/286
232-
message(
233-
STATUS
234-
"Disable custom thrust namespace for hip before 5.7 because hip does not fully support it before 5.7"
235-
)
236-
set(GINKGO_HIP_CUSTOM_THRUST_NAMESPACE OFF)
237-
elseif(
238-
GINKGO_HIP_PLATFORM_AMD
239-
AND GINKGO_HIP_VERSION VERSION_GREATER_EQUAL 7.1
240-
)
229+
if(GINKGO_HIP_PLATFORM_AMD AND GINKGO_HIP_VERSION VERSION_GREATER_EQUAL 7.1)
241230
# track this issue by https://github.com/ROCm/rocm-libraries/issues/6309
242231
# HIP VERSION does not use the exact version number as ROCm. Need to wait for ROCm 7.1.1 to set proper range for ROCm 7.1.0
243232
message(
244233
STATUS
245-
"Disable custom thrust namespace for hip 7.1 because hip does not adapt the custom namespace fully."
234+
"Disable custom thrust namespace after hip 7.1 because hip does not adapt the custom namespace fully."
246235
)
247236
set(GINKGO_HIP_CUSTOM_THRUST_NAMESPACE OFF)
248237
else()

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ The Ginkgo CUDA module has the following __additional__ requirements:
5454

5555
The Ginkgo HIP module has the following __additional__ requirements:
5656

57-
* _ROCm 4.5+_
57+
* _ROCm 6.2.0+_
5858
* the HIP, hipBLAS, hipSPARSE, hip/rocRAND and rocThrust packages compiled with the ROCm backend
5959
* if the hipFFT package is available, it is used to implement the FFT LinOps.
6060
* _cmake 3.21+_

accessor/hip_helper.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2017 - 2025 The Ginkgo authors
1+
// SPDX-FileCopyrightText: 2017 - 2026 The Ginkgo authors
22
//
33
// SPDX-License-Identifier: BSD-3-Clause
44

@@ -74,11 +74,7 @@ struct hip_type<gko::half> {
7474

7575
template <>
7676
struct hip_type<gko::bfloat16> {
77-
#if HIP_VERSION >= 60200000
7877
using type = __hip_bfloat16;
79-
#else
80-
using type = hip_bfloat16;
81-
#endif
8278
};
8379

8480

cmake/autodetect_executors.cmake

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ if(NOT DEFINED GINKGO_BUILD_HIP)
3535
if(CMAKE_HIP_COMPILER)
3636
message(STATUS "Enabling HIP executor")
3737
set(GINKGO_HAS_HIP ON)
38-
else()
39-
include(cmake/hip_helpers.cmake)
40-
ginkgo_check_hip_detection_issue()
4138
endif()
4239
endif()
4340

cmake/hip.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ cmake_minimum_required(VERSION 3.21 FATAL_ERROR)
33
include(cmake/hip_helpers.cmake)
44
include(CheckLanguage)
55
check_language(HIP)
6-
ginkgo_check_hip_detection_issue()
76

87
enable_language(HIP)
98

@@ -34,7 +33,7 @@ find_package(rocrand REQUIRED)
3433
find_package(rocthrust REQUIRED)
3534
find_package(ROCTX)
3635

37-
if(GINKGO_HIP_AMD_UNSAFE_ATOMIC AND GINKGO_HIP_VERSION VERSION_GREATER_EQUAL 5)
36+
if(GINKGO_HIP_AMD_UNSAFE_ATOMIC)
3837
set(CMAKE_HIP_FLAGS
3938
"${CMAKE_HIP_FLAGS} -munsafe-fp-atomics -Wno-unused-command-line-argument"
4039
)

cmake/hip_helpers.cmake

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,3 @@ function(ginkgo_find_hip_version)
2323
)
2424
set(GINKGO_HIP_VERSION ${GINKGO_HIP_VERSION} PARENT_SCOPE)
2525
endfunction()
26-
27-
# This function checks if ROCm might not be detected correctly.
28-
# ROCm < 5.7 has a faulty CMake setup that requires setting
29-
# CMAKE_PREFIX_PATH=$ROCM_PATH/lib/cmake, otherwise HIP will not be detected.
30-
function(ginkgo_check_hip_detection_issue)
31-
if(NOT CMAKE_HIP_COMPILER)
32-
ginkgo_find_hip_version()
33-
if(GINKGO_HIP_VERSION AND GINKGO_HIP_VERSION VERSION_LESS 5.7)
34-
message(
35-
WARNING
36-
"Could not find a HIP compiler, but HIP version ${GINKGO_HIP_VERSION} was detected through "
37-
"hipconfig. Try setting the environment variable CMAKE_PREFIX_PATH=$ROCM_PATH/lib/cmake, or "
38-
"update to ROCm >= 5.7."
39-
)
40-
endif()
41-
endif()
42-
endfunction()

common/cuda_hip/base/bf16_alias.hpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2025 The Ginkgo authors
1+
// SPDX-FileCopyrightText: 2025 - 2026 The Ginkgo authors
22
//
33
// SPDX-License-Identifier: BSD-3-Clause
44

@@ -24,7 +24,6 @@ using vendor_bf16 = __nv_bfloat16;
2424
#elif defined(GKO_COMPILING_HIP)
2525

2626

27-
#if HIP_VERSION >= 60200000
2827
// HIP has __hip_bfloat16 after ROCM 5.6.0 but enough implementation for us
2928
// (conversion and operation overload) after ROCM 6.2.0 which provides more
3029
// native operations support.
@@ -39,23 +38,5 @@ using vendor_bf16 = __hip_bfloat16;
3938
}
4039

4140

42-
#else
43-
44-
45-
// HIP has hip_bfloat16 but only the type with the operation fallback to the
46-
// single precision
47-
#include <hip/hip_bfloat16.h>
48-
49-
50-
namespace gko {
51-
52-
53-
using vendor_bf16 = hip_bfloat16;
54-
55-
56-
}
57-
58-
59-
#endif
6041
#endif
6142
#endif // GKO_COMMON_CUDA_HIP_BASE_BF16_ALIAS_HPP_

0 commit comments

Comments
 (0)