Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into nl-impl_MultiMar…
Browse files Browse the repository at this point in the history
…ginLoss
  • Loading branch information
littlecutebird committed Aug 21, 2024
2 parents fdc4232 + 10a7995 commit 1705be3
Show file tree
Hide file tree
Showing 45 changed files with 2,441 additions and 63 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
59 changes: 33 additions & 26 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,21 @@ def cmake_build(Map conf=[:]){
def debug_flags = "-g -fno-omit-frame-pointer -fsanitize=undefined -fno-sanitize-recover=undefined -Wno-option-ignored " + conf.get("extradebugflags", "")
def build_envs = "CTEST_PARALLEL_LEVEL=4 " + conf.get("build_env","")
def prefixpath = conf.get("prefixpath","/opt/rocm")
def build_type_debug = (conf.get("build_type",'release') == 'debug')
def code_conv_enabled = conf.get("codecov", false)

def mlir_args = " -DMIOPEN_USE_MLIR=" + conf.get("mlir_build", "ON")
// WORKAROUND_ISSUE_3192 Disabling MLIR for debug builds since MLIR generates sanitizer errors.
if (build_type_debug || code_conv_enabled)
{
mlir_args = " -DMIOPEN_USE_MLIR=OFF"
}

def setup_args = mlir_args + " -DMIOPEN_GPU_SYNC=Off " + conf.get("setup_flags","")
def build_fin = conf.get("build_fin", "OFF")

setup_args = setup_args + " -DCMAKE_PREFIX_PATH=${prefixpath} "

def build_type_debug = (conf.get("build_type",'release') == 'debug')

//cmake_env can overwrite default CXX variables.
def cmake_envs = "CXX=${compiler} CXXFLAGS='-Werror' " + conf.get("cmake_ex_env","")

Expand Down Expand Up @@ -72,7 +79,7 @@ def cmake_build(Map conf=[:]){
test_flags = " --disable-verification-cache " + test_flags
}

if(conf.get("codecov", false)){ //Need
if(code_conv_enabled){ //Need
setup_args = " -DCMAKE_BUILD_TYPE=debug -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags} -fprofile-arcs -ftest-coverage' -DCODECOV_TEST=On " + setup_args
}else if(build_type_debug){
setup_args = " -DCMAKE_BUILD_TYPE=debug -DCMAKE_CXX_FLAGS_DEBUG='${debug_flags}'" + setup_args
Expand Down Expand Up @@ -194,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 @@ -284,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 @@ -648,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 @@ -661,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 @@ -674,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 @@ -687,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 @@ -711,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 @@ -728,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 @@ -741,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 @@ -757,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 @@ -770,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 @@ -787,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 @@ -804,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 @@ -830,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 @@ -850,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 @@ -863,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 @@ -876,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 @@ -889,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 @@ -902,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 @@ -915,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 @@ -928,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 @@ -941,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
1 change: 1 addition & 0 deletions docs/reference/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ The MIOpen API library is structured as follows:
* :doc:`Getitem <../doxygen/html/group__getitem>` (experimental)
* :doc:`ReduceCalculation <../doxygen/html/group__ReduceCalculation>` (experimental)
* :doc:`RotaryPositionalEmbeddings <../doxygen/html/group__RotaryPositionalEmbeddings>` (experimental)
* :doc:`ReLU <../doxygen/html/group___re_l_u>` (experimental)
2 changes: 1 addition & 1 deletion docs/sphinx/requirements.in
Original file line number Diff line number Diff line change
@@ -1 +1 @@
rocm-docs-core[api_reference]==1.6.2
rocm-docs-core[api_reference]==1.7.1
Loading

0 comments on commit 1705be3

Please sign in to comment.