Skip to content

Commit 2c9fe96

Browse files
committed
Bump MIOpen version to 3.0.1 and update CI docker (partial cherry-pick of ROCm#2519)
Differences from ROCm#2519: - rocm_setup_version(VERSION 3.1.0) -> rocm_setup_version(VERSION 3.0.1) - Changes of requirements.txt REVERTED (cherry picked from commit 7da72bc and EDITED) # RESOLVED Conflicts: # Dockerfile # dev-requirements.txt # requirements.txt -- REVERTED
1 parent c4a091f commit 2c9fe96

17 files changed

+76
-51
lines changed

CMakeLists.txt

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ if(NOT WIN32 AND NOT APPLE)
9999
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
100100
endif()
101101

102-
rocm_setup_version(VERSION 3.00.0)
102+
rocm_setup_version(VERSION 3.0.1)
103103

104104
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
105105
include(TargetFlags)
@@ -761,6 +761,19 @@ enable_cppcheck(
761761
knownConditionTrueFalse
762762
shadowFunction
763763
moduloofone
764+
###################################################################
765+
# TODO Code Quality WORKAROUND ROCm 6.0 &&
766+
# Ubuntu 22.04 && cppcheck 2.12.1 update
767+
###################################################################
768+
duplInheritedMember
769+
constParameterCallback
770+
constParameterReference
771+
constParameterPointer
772+
constVariableReference
773+
constVariablePointer
774+
useStlAlgorithm
775+
uselessOverride
776+
unusedScopedObject
764777
FORCE
765778
SOURCES
766779
addkernels/

Dockerfile

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ubuntu:20.04 as miopen
1+
FROM ubuntu:22.04 as miopen
22
ARG DEBIAN_FRONTEND=noninteractive
33

44
# Support multiarch
@@ -18,17 +18,17 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
1818
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
1919
RUN curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/rocm-keyring.gpg
2020

21-
RUN wget https://repo.radeon.com/amdgpu-install/5.7/ubuntu/focal/amdgpu-install_5.7.50700-1_all.deb --no-check-certificate
21+
RUN wget https://repo.radeon.com/amdgpu-install/6.0/ubuntu/jammy/amdgpu-install_6.0.60000-1_all.deb --no-check-certificate
2222
RUN apt-get update && \
2323
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
24-
./amdgpu-install_5.7.50700-1_all.deb
24+
./amdgpu-install_6.0.60000-1_all.deb
2525

2626
# Add rocm repository
27-
RUN export ROCM_APT_VER=5.7;\
27+
RUN export ROCM_APT_VER=6.0;\
2828
echo $ROCM_APT_VER &&\
29-
sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/amdgpu/$ROCM_APT_VER/ubuntu focal main > /etc/apt/sources.list.d/amdgpu.list' &&\
30-
sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/rocm/apt/$ROCM_APT_VER focal main > /etc/apt/sources.list.d/rocm.list'
31-
RUN sh -c "echo deb http://mirrors.kernel.org/ubuntu focal main universe | tee -a /etc/apt/sources.list"
29+
sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/amdgpu/$ROCM_APT_VER/ubuntu jammy main > /etc/apt/sources.list.d/amdgpu.list' &&\
30+
sh -c 'echo deb [arch=amd64 signed-by=/etc/apt/trusted.gpg.d/rocm-keyring.gpg] https://repo.radeon.com/rocm/apt/$ROCM_APT_VER jammy main > /etc/apt/sources.list.d/rocm.list'
31+
RUN sh -c "echo deb http://mirrors.kernel.org/ubuntu jammy main universe | tee -a /etc/apt/sources.list"
3232

3333
RUN amdgpu-install -y --usecase=rocm --no-dkms
3434

@@ -94,11 +94,17 @@ RUN rm -rf /tmp/ccache* && mkdir /tmp/ccache && wget https://github.com/ccache/c
9494
cd /tmp/ccache-${CCACHE_COMMIT}/build && \
9595
cmake -DZSTD_FROM_INTERNET=ON -DHIREDIS_FROM_INTERNET=ON .. && make -j install && rm -rf /tmp/*
9696
RUN ccache -s
97+
98+
# purge existing composable kernel installed with ROCm
99+
# hence cannot use autoremove since it will remove more components
100+
RUN apt-get update && \
101+
DEBIAN_FRONTEND=noninteractive apt-get purge -y --allow-unauthenticated \
102+
composablekernel-dev
97103
ARG COMPILER_LAUNCHER=""
98104
RUN if [ "$USE_FIN" = "ON" ]; then \
99-
rbuild prepare -s fin -d $PREFIX -DAMDGPU_TARGETS=${GPU_ARCH} -DCMAKE_CXX_COMPILER_LAUNCHER="${COMPILER_LAUNCHER}"; \
105+
rbuild prepare -s fin -d $PREFIX -DGPU_TARGETS=${GPU_ARCH} -DCMAKE_CXX_COMPILER_LAUNCHER="${COMPILER_LAUNCHER}"; \
100106
else \
101-
rbuild prepare -s develop -d $PREFIX -DAMDGPU_TARGETS=${GPU_ARCH} -DCMAKE_CXX_COMPILER_LAUNCHER="${COMPILER_LAUNCHER}"; \
107+
rbuild prepare -s develop -d $PREFIX -DGPU_TARGETS=${GPU_ARCH} -DCMAKE_CXX_COMPILER_LAUNCHER="${COMPILER_LAUNCHER}"; \
102108
fi
103109

104110
RUN ccache -s

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
ROCmSoftwarePlatform/rocm-recipes
22
-f requirements.txt
3-
danmar/cppcheck@2.9
3+
danmar/cppcheck@2.12.1

docs/DebugAndLogging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Direct Solutions:
9494
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_FWD11X11` - `ConvOclDirectFwd11x11`.
9595
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_FWDGEN` - `ConvOclDirectFwdGen`.
9696
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_FWD` - `ConvOclDirectFwd`.
97-
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_FWD1X1` - `ConvOclDirectFwd`.
97+
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_FWD1X1` - `ConvOclDirectFwd1x1`.
9898
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_WRW2` - `ConvOclBwdWrW2<n>` (where n = `{1,2,4,8,16}`), and `ConvOclBwdWrW2NonTunable`.
9999
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_WRW53` - `ConvOclBwdWrW53`.
100100
* `MIOPEN_DEBUG_CONV_DIRECT_OCL_WRW1X1` - `ConvOclBwdWrW1x1`

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ elseif(MIOPEN_BACKEND STREQUAL "HIPOC" OR MIOPEN_BACKEND STREQUAL "HIP")
778778
endif()
779779
if(ENABLE_HIP_WORKAROUNDS)
780780
# Workaround hip not setting its usage requirements correctly
781-
target_compile_definitions( MIOpen PRIVATE -D__HIP_PLATFORM_HCC__=1 )
781+
target_compile_definitions( MIOpen PRIVATE -D__HIP_PLATFORM_AMD__=1 )
782782
endif()
783783
# This is helpful for the tests
784784
target_link_libraries( MIOpen INTERFACE $<BUILD_INTERFACE:hip::device> )

src/comgr.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,8 +1293,10 @@ void BuildHip(const std::string& name,
12931293
miopen::SplitSpaceSeparated(options, miopen::comgr::compiler::lc::GetOptionsNoSplit());
12941294
compiler::lc::RemoveOptionsUnwanted(opts);
12951295
opts.push_back("-DWORKAROUND_ISSUE_HIPRTC_TRUE_TYPE"); // Workaround for SWDEV-308073
1296-
opts.push_back("-D__HIP_PLATFORM_HCC__=1"); // Workaround?
1297-
opts.push_back("-D__HIP_PLATFORM_AMD__=1"); // Workaround?
1296+
#if HIP_PACKAGE_VERSION_FLAT < 6000023494ULL
1297+
opts.push_back("-D__HIP_PLATFORM_HCC__=1"); // Workaround?
1298+
#endif
1299+
opts.push_back("-D__HIP_PLATFORM_AMD__=1"); // Workaround?
12981300
#if ROCM_FEATURE_LLVM_AMDGCN_BUFFER_ATOMIC_FADD_F32_RETURNS_FLOAT
12991301
if(miopen::solver::support_amd_buffer_atomic_fadd(target.Name()))
13001302
opts.push_back("-DCK_AMD_BUFFER_ATOMIC_FADD_RETURNS_FLOAT=1");

src/composable_kernel/.clang-tidy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
CheckOptions:
22
- key: bugprone-reserved-identifier.AllowedIdentifiers
3-
value: '__HIP_PLATFORM_HCC__;__HIP_ROCclr__'
3+
value: '__HIP_PLATFORM_AMD__;__HIP_ROCclr__'

src/composable_kernel/cmake/ClangTidy.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ function(clang_tidy_check TARGET)
149149
add_custom_target(${tidy_target}
150150
# for some targets clang-tidy not able to get information from .clang-tidy
151151
DEPENDS ${SOURCE}
152-
COMMAND ${CLANG_TIDY_COMMAND} "-config=\{CheckOptions: \[\{key: bugprone-reserved-identifier.AllowedIdentifiers,value: __HIP_PLATFORM_HCC__\; __HIP_ROCclr__\}\]\}" ${SOURCE} "-export-fixes=${CLANG_TIDY_FIXIT_DIR}/${TARGET}-${tidy_file}.yaml"
152+
COMMAND ${CLANG_TIDY_COMMAND} "-config=\{CheckOptions: \[\{key: bugprone-reserved-identifier.AllowedIdentifiers,value: __HIP_PLATFORM_AMD__\; __HIP_ROCclr__\}\]\}" ${SOURCE} "-export-fixes=${CLANG_TIDY_FIXIT_DIR}/${TARGET}-${tidy_file}.yaml"
153153
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
154154
COMMENT "clang-tidy: Running clang-tidy on target ${SOURCE}..."
155155
)

src/composable_kernel/external/rocm/include/bfloat16_dev.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
extern "C" {
3131
#endif
3232

33-
#ifdef __HIP_PLATFORM_HCC__
33+
#ifdef __HIP_PLATFORM_AMD__
3434
#define EXECUTION_SPECIFIER __device__
3535
#else
3636
#define EXECUTION_SPECIFIER
@@ -43,7 +43,7 @@ typedef union
4343

4444
// Composable kernels are written in HIP language. The language doesnt support
4545
// ushort2.hi or ushort2.low.
46-
#ifdef __HIP_PLATFORM_HCC__
46+
#ifdef __HIP_PLATFORM_AMD__
4747
ushort ushortvec[2];
4848
#endif // MIOPEN_BACKEND_HIP
4949
float f32;
@@ -53,7 +53,7 @@ EXECUTION_SPECIFIER float bfloat16_to_float(ushort src_val)
5353
{
5454
cvt_bf16_fp32_t target_val;
5555

56-
#ifdef __HIP_PLATFORM_HCC__
56+
#ifdef __HIP_PLATFORM_AMD__
5757
target_val.ushortx2 = make_ushort2(0, src_val);
5858
#else
5959
target_val.ushortx2 = (ushort2)(0, src_val);
@@ -102,7 +102,7 @@ EXECUTION_SPECIFIER ushort float_to_bfloat16(float src_val)
102102
// When the bfloat16 value has an exponent of 0xFE and a mantissa of 0x7F,
103103
// incrementing it causes it to become an exponent of 0xFF and a mantissa
104104
// of 0x00, which is Inf, the next higher value to the unrounded value.
105-
#ifdef __HIP_PLATFORM_HCC__
105+
#ifdef __HIP_PLATFORM_AMD__
106106
target_val.u32 += (0x7fff + (target_val.ushortvec[1] & 1));
107107
#else
108108
target_val.u32 +=
@@ -111,7 +111,7 @@ EXECUTION_SPECIFIER ushort float_to_bfloat16(float src_val)
111111
#endif // MIOPEN_USE_RNE_BFLOAT16
112112
}
113113

114-
#ifdef __HIP_PLATFORM_HCC__
114+
#ifdef __HIP_PLATFORM_AMD__
115115
return target_val.ushortvec[1];
116116
#else
117117
return target_val.ushortx2.hi;

src/convolution.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ ConvolutionDescriptor::GetForwardOutputTensorWithLayout(const TensorDescriptor&
289289
}
290290
}
291291

292-
std::size_t out_c;
292+
std::size_t out_c = 0;
293293
std::vector<std::size_t> out_lens(spatial_dim + 2);
294294

295295
auto out_spatial = boost::adaptors::slice(out_lens, 2, 2 + spatial_dim);

0 commit comments

Comments
 (0)