Skip to content

Commit

Permalink
Update docker ROCm version for CI and MIOpen version (#3181)
Browse files Browse the repository at this point in the history
  • Loading branch information
junliume authored Aug 21, 2024
1 parent 4be2a03 commit 39936d8
Show file tree
Hide file tree
Showing 5 changed files with 67 additions and 29 deletions.
24 changes: 24 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,32 @@
# -modernize-type-traits
# -performance-avoid-endl
#
# TODO Code Quality WORKAROUND ROCm 6.2
# -readability-container-size-empty
# -bugprone-inc-dec-in-conditions
# -readability-avoid-nested-conditional-operator
# -performance-enum-size
# -readability-redundant-member-init
# -bugprone-multi-level-implicit-pointer-conversion
# -clang-analyzer-optin.core.EnumCastOutOfRange
# -cppcoreguidelines-macro-to-enum
# -cppcoreguidelines-owning-memory
# -readability-avoid-return-with-void-value
# -bugprone-unused-local-non-trivial-variable
#
Checks: >-
*,
-abseil-*,
-altera-*,
-android-cloexec-fopen,
-bugprone-easily-swappable-parameters,
-bugprone-exception-escape,
-bugprone-inc-dec-in-conditions,
-bugprone-lambda-function-name,
-bugprone-macro-parentheses,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-unused-local-non-trivial-variable,
-bugprone-use-after-move,
-cert-env33-c,
-cert-err33-c,
Expand All @@ -90,6 +106,7 @@ Checks: >-
-cert-msc51-cpp,
-clang-analyzer-alpha.core.CastToStruct,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-clang-analyzer-optin.performance.Padding,
-clang-diagnostic-extern-c-compat,
-clang-diagnostic-unused-command-line-argument,
Expand All @@ -100,11 +117,13 @@ Checks: >-
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-explicit-virtual-functions,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-to-enum,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-misleading-capture-default-by-value,
-cppcoreguidelines-missing-std-forward,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
Expand Down Expand Up @@ -168,11 +187,15 @@ Checks: >-
-modernize-concat-nested-namespaces,
-modernize-unary-static-assert,
-performance-avoid-endl,
-performance-enum-size,
-readability-avoid-nested-conditional-operator,
-performance-no-automatic-move,
-performance-unnecessary-copy-initialization,
-performance-unnecessary-value-param,
-readability-avoid-return-with-void-value,
-readability-avoid-unconditional-preprocessor-if,
-readability-container-data-pointer,
-readability-container-size-empty,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-function-cognitive-complexity,
Expand All @@ -182,6 +205,7 @@ Checks: >-
-readability-named-parameter,
-readability-qualified-auto,
-readability-redundant-declaration,
-readability-redundant-member-init,
-readability-redundant-string-init,
-readability-simplify-boolean-expr,
-readability-suspicious-call-argument,
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ if(MIOPEN_STRIP_SYMBOLS AND NOT WIN32 AND NOT APPLE)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
endif()

rocm_setup_version(VERSION 3.2.0)
rocm_setup_version(VERSION 3.3.0)

list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
include(TargetFlags)
Expand Down
20 changes: 15 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,28 @@ RUN dpkg --add-architecture i386
# Install preliminary dependencies
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
"linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)" \
apt-utils \
ca-certificates \
curl \
libnuma-dev \
gnupg2 \
wget

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
"linux-headers-$(uname -r)" "linux-modules-extra-$(uname -r)"

#Add gpg keys
ENV APT_KEY_DONT_WARN_ON_DANGEROUS_USAGE=DontWarn
RUN curl -fsSL https://repo.radeon.com/rocm/rocm.gpg.key | gpg --dearmor -o /etc/apt/trusted.gpg.d/rocm-keyring.gpg

RUN wget https://repo.radeon.com/amdgpu-install/6.1/ubuntu/jammy/amdgpu-install_6.1.60100-1_all.deb --no-check-certificate
RUN wget https://repo.radeon.com/amdgpu-install/6.2/ubuntu/jammy/amdgpu-install_6.2.60200-1_all.deb --no-check-certificate
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
./amdgpu-install_6.1.60100-1_all.deb
./amdgpu-install_6.2.60200-1_all.deb

# Add rocm repository
RUN export ROCM_APT_VER=6.1;\
RUN export ROCM_APT_VER=6.2;\
echo $ROCM_APT_VER &&\
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' &&\
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'
Expand Down Expand Up @@ -85,6 +88,7 @@ ADD dev-requirements.txt /dev-requirements.txt
# Install dependencies
# TODO: Add --std=c++14
ARG GPU_ARCH=";"
# install to /opt/rocm will cause permission issue
ARG PREFIX=/usr/local
ARG USE_FIN="OFF"
ARG CCACHE_SECONDARY_STORAGE=""
Expand All @@ -101,9 +105,12 @@ RUN ccache -s

# purge existing composable kernel installed with ROCm
# hence cannot use autoremove since it will remove more components
# even purge will remove some other components which is not ideal
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get purge -y --allow-unauthenticated \
composablekernel-dev
composablekernel-dev \
miopen-hip

ARG COMPILER_LAUNCHER=""
# rbuild is used to trigger build of requirements.txt, dev-requirements.txt
RUN if [ "$USE_FIN" = "ON" ]; then \
Expand All @@ -120,4 +127,7 @@ RUN pip3 install -r /doc-requirements.txt
# Composable Kernel requires this version cmake
RUN pip3 install --upgrade cmake==3.27.5

# groupadd can add one group a time
RUN groupadd -f render
RUN groupadd -f video
RUN usermod -a -G render,video root
46 changes: 23 additions & 23 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,9 @@ def getDockerImage(Map conf=[:])
{
env.DOCKER_BUILDKIT=1
def prefixpath = conf.get("prefixpath", "/opt/rocm") // one image for each prefix 1: /usr/local 2:/opt/rocm
def gpu_arch = "gfx900;gfx906;gfx908;gfx90a;gfx940;gfx941;gfx942;gfx1030;gfx1100;gfx1101;gfx1102" // prebuilt dockers should have all the architectures enabled so one image can be used for all stages
def gpu_arch = "gfx908;gfx90a;gfx942;gfx1030;gfx1100;gfx1101;gfx1102;gfx1200" // prebuilt dockers should have all the architectures enabled so one image can be used for all stages
def mlir_build = conf.get("mlir_build", "ON") // always ON
def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${prefixpath} --build-arg GPU_ARCH='${gpu_arch}' --build-arg USE_MLIR='${mlir_build}' "
def dockerArgs = "--build-arg BUILDKIT_INLINE_CACHE=1 --build-arg PREFIX=${prefixpath} --build-arg GPU_TARGETS='${gpu_arch}' --build-arg USE_MLIR='${mlir_build}' "
if(env.CCACHE_HOST)
{
def check_host = sh(script:"""(printf "PING\r\n";) | nc -N ${env.CCACHE_HOST} 6379 """, returnStdout: true).trim()
Expand Down Expand Up @@ -291,7 +291,7 @@ def buildHipClangJob(Map conf=[:]){
}

withDockerContainer(image: image, args: dockerOpts + ' -v=/var/jenkins/:/var/jenkins') {
timeout(time: 210, unit:'MINUTES')
timeout(time: 300, unit:'MINUTES')
{
if (lfs_pull) {
sh "git lfs pull --exclude="
Expand Down Expand Up @@ -655,7 +655,7 @@ pipeline {
}
agent{ label rocmnode("gfx90a") }
steps{
buildHipClangJobAndReboot(make_targets: Smoke_targets)
buildHipClangJobAndReboot(make_targets: Smoke_targets, build_install: "true")
}
}
stage('Fp32 Hip Debug gfx90a') {
Expand All @@ -668,7 +668,7 @@ pipeline {
}
agent{ label rocmnode("gfx90a") }
steps{
buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets)
buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, build_install: "true")
}
}
stage('Fp32 Hip Debug gfx908') {
Expand All @@ -681,7 +681,7 @@ pipeline {
}
agent{ label rocmnode("gfx908") }
steps{
buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets)
buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, build_install: "true")
}
}
stage('Fp32 Hip Debug gfx94X') {
Expand All @@ -694,7 +694,7 @@ pipeline {
}
agent{ label rocmnode("gfx94X") }
steps{
buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, needs_reboot:false)
buildHipClangJobAndReboot(build_type: 'debug', make_targets: Smoke_targets, needs_reboot:false, build_install: "true")
}
}
}
Expand All @@ -718,7 +718,7 @@ pipeline {
NOCOMGR_build_cmd = "CTEST_PARALLEL_LEVEL=4 MIOPEN_LOG_LEVEL=5 make -j\$(nproc) check"
}
steps{
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOCOMGR_flags, build_cmd: NOCOMGR_build_cmd, test_flags: ' --verbose ')
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOCOMGR_flags, build_cmd: NOCOMGR_build_cmd, test_flags: ' --verbose ', build_install: "true")
}
}
stage('Fp32 Hip Debug NOMLIR gfx90a') {
Expand All @@ -735,7 +735,7 @@ pipeline {
NOMLIR_build_cmd = "CTEST_PARALLEL_LEVEL=4 MIOPEN_LOG_LEVEL=5 make -j\$(nproc) check"
}
steps{
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOMLIR_flags, build_cmd: NOMLIR_build_cmd, test_flags: ' --verbose ')
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: NOMLIR_flags, build_cmd: NOMLIR_build_cmd, test_flags: ' --verbose ', build_install: "true")
}
}
stage('Fp32 Hip Debug NOCK gfx90a Build-Only') {
Expand All @@ -748,7 +748,7 @@ pipeline {
}
agent{ label rocmnode("gfx90a") }
steps{
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: "-DMIOPEN_USE_COMPOSABLEKERNEL=Off", make_targets: "")
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: "-DMIOPEN_USE_COMPOSABLEKERNEL=Off", make_targets: "", build_install: "true")
}
}
stage('Fp32 Hip Debug Embedded Vega20') {
Expand All @@ -764,7 +764,7 @@ pipeline {
Embedded_flags = "-DMIOPEN_EMBED_DB='gfx906_60'"
}
steps{
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: Embedded_flags, build_env: extra_log_env, test_flags: ' --verbose ')
buildHipClangJobAndReboot( build_type: 'debug', setup_flags: Embedded_flags, build_env: extra_log_env, test_flags: ' --verbose ', build_install: "true")
}
}
stage('Fp32 Hip Static gfx90a') {
Expand All @@ -777,7 +777,7 @@ pipeline {
}
agent{ label rocmnode("gfx90a") }
steps{
buildHipClangJobAndReboot( setup_flags: "-DBUILD_SHARED_LIBS=Off", mlir_build: 'OFF')
buildHipClangJobAndReboot( setup_flags: "-DBUILD_SHARED_LIBS=Off", mlir_build: 'OFF', build_install: "true")
}
}
stage('Fp32 Hip Normal-Find gfx90a') {
Expand All @@ -794,7 +794,7 @@ pipeline {
execute_cmd = "bin/test_conv2d --disable-verification-cache"
}
steps{
buildHipClangJobAndReboot(make_targets: make_targets, execute_cmd: execute_cmd, find_mode: "Normal")
buildHipClangJobAndReboot(make_targets: make_targets, execute_cmd: execute_cmd, find_mode: "Normal", build_install: "true")
}
}
stage('Fp32 Hip Fast-Find gfx90a') {
Expand All @@ -811,7 +811,7 @@ pipeline {
execute_cmd = "MIOPEN_FIND_MODE=2 CTEST_PARALLEL_LEVEL=4 bin/test_conv2d --disable-verification-cache"
}
steps{
buildHipClangJobAndReboot( make_targets: make_targets, execute_cmd: execute_cmd)
buildHipClangJobAndReboot( make_targets: make_targets, execute_cmd: execute_cmd, build_install: "true")
}
}
stage('Fp32 Hip gfx90a') {
Expand All @@ -837,7 +837,7 @@ pipeline {
}
agent{ label rocmnode("gfx90a") }
steps{
buildHipClangJobAndReboot(make_targets: Smoke_targets, setup_flags: "-DMIOPEN_USE_SQLITE_PERF_DB=On")
buildHipClangJobAndReboot(make_targets: Smoke_targets, setup_flags: "-DMIOPEN_USE_SQLITE_PERF_DB=On", build_install: "true")
}
}
}
Expand All @@ -857,7 +857,7 @@ pipeline {
}
agent{ label rocmnode("vega20") }
steps{
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets)
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, build_install: "true")
}
}
stage('Bf16 Hip Vega20') {
Expand All @@ -870,7 +870,7 @@ pipeline {
}
agent{ label rocmnode("vega20") }
steps{
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets)
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, build_install: "true")
}
}
stage('Fp16 Hip gfx908') {
Expand All @@ -883,7 +883,7 @@ pipeline {
}
agent{ label rocmnode("gfx908") }
steps{
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets)
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, build_install: "true")
}
}
stage('Bf16 Hip gfx908') {
Expand All @@ -896,7 +896,7 @@ pipeline {
}
agent{ label rocmnode("gfx908") }
steps{
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets)
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, build_install: "true")
}
}
stage('Fp16 Hip gfx90a') {
Expand All @@ -909,7 +909,7 @@ pipeline {
}
agent{ label rocmnode("gfx90a") }
steps{
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets)
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, build_install: "true")
}
}
stage('Bf16 Hip gfx90a') {
Expand All @@ -922,7 +922,7 @@ pipeline {
}
agent{ label rocmnode("gfx90a") }
steps{
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets)
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, build_install: "true")
}
}
stage('Fp16 Hip gfx94X') {
Expand All @@ -935,7 +935,7 @@ pipeline {
}
agent{ label rocmnode("gfx94X") }
steps{
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, needs_reboot:false)
buildHipClangJobAndReboot( setup_flags: Fp16_flags, make_targets: Smoke_targets, needs_reboot:false, build_install: "true")
}
}
stage('Bf16 Hip gfx94X') {
Expand All @@ -948,7 +948,7 @@ pipeline {
}
agent{ label rocmnode("gfx94X") }
steps{
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, needs_reboot:false)
buildHipClangJobAndReboot(setup_flags: Bf16_flags, make_targets: Smoke_targets, needs_reboot:false, build_install: "true")
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions src/comgr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ void BuildAsm(const std::string& name,

#define WORKAROUND_ISSUE_HIPRTC_HIPRTC_HEADER_H 1 // See SWDEV-307838, issue #1648.
#define WORKAROUND_ISSUE_1674 (HIP_PACKAGE_VERSION_FLAT >= 5003022305ULL)
#define WORKAROUND_ISSUE_3188 (HIP_PACKAGE_VERSION_FLAT >= 6002041133ULL)

// See WORKAROUND_SWDEV_413293 in ./CmakeLists.txt
#define WORKAROUND_SWDEV_413293 MIOPEN_HIP_COMPILER_HAS_OPTION_OFFLOAD_UNIFORM_BLOCK
Expand Down Expand Up @@ -975,6 +976,9 @@ void BuildHip(const std::string& name,
#endif
#if WORKAROUND_ISSUE_1674
opts.push_back("-Wno-gnu-line-marker");
#endif
#if WORKAROUND_ISSUE_3188
opts.push_back("-Wno-pass-failed");
#endif
opts.push_back("-Wno-cuda-compat");
opts.push_back("-fno-gpu-rdc");
Expand Down

0 comments on commit 39936d8

Please sign in to comment.