Skip to content

Commit

Permalink
Fast forward to the public MIOpen develop (#47)
Browse files Browse the repository at this point in the history
  • Loading branch information
cderb authored Oct 13, 2023
1 parent feab6fd commit ce70c8b
Show file tree
Hide file tree
Showing 332 changed files with 28,685 additions and 9,161 deletions.
6 changes: 5 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ sphinx:
formats: [htmlzip]

python:
version: "3.8"
install:
- requirements: docs/.sphinx/requirements.txt

build:
os: ubuntu-20.04
tools:
python: "3.8"
64 changes: 21 additions & 43 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ endif()

project ( MIOpen C CXX )

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)

enable_testing()

find_package(ROCM 0.7.3 REQUIRED PATHS /opt/rocm)
Expand All @@ -64,6 +68,9 @@ include(ROCMCreatePackage)
include(CheckCXXCompilerFlag)
include(ROCMHeaderWrapper)

# Build library with Beta APIs
add_definitions("-DMIOPEN_BETA_API=1")

set(MIOPEN_ENABLE_AI_IMMED_MODE_FALLBACK On CACHE BOOL "Enable AI-based fallback for Immediate Mode")
set(MIOPEN_ENABLE_AI_KERNEL_TUNING On CACHE BOOL "Enable AI heuristic for kernel tuning")
set(MIOPEN_ENABLE_SQLITE On CACHE BOOL "")
Expand Down Expand Up @@ -103,11 +110,6 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif()
endif()


############################################################
# require C++14
add_compile_options(-std=c++17)

############################################################
# OPTION - MIOpen Backend
# - OpenCL
Expand Down Expand Up @@ -173,7 +175,6 @@ set_property( CACHE MIOPEN_BACKEND PROPERTY STRINGS
if( MIOPEN_BACKEND STREQUAL "OpenCL")
set(MIOPEN_BACKEND_OPENCL 1)
find_package( OpenCL REQUIRED )
set(MIOPEN_USE_MIOPENGEMM ON CACHE BOOL "")
find_program(MIOPEN_HIP_COMPILER clang++
PATH_SUFFIXES bin
PATHS
Expand All @@ -186,9 +187,6 @@ if( MIOPEN_BACKEND STREQUAL "OpenCL")
message(FATAL_ERROR "hip compiler not found")
endif()

# MIOpenTensile does not support opencl backend yet.
set(MIOPEN_USE_MIOPENTENSILE OFF CACHE BOOL "")

# TODO (priority_low) Use to build HIP and ASM kernels.
if(MIOPEN_USE_COMGR)
message(FATAL_ERROR "comgr cannot be used with OpenCL backend")
Expand Down Expand Up @@ -253,6 +251,11 @@ math(EXPR MIOPEN_hip_VERSION_FLAT "(${MIOPEN_hip_VERSION_MAJOR} * 1000 + ${MIOPE
set_var_to_condition(MIOPEN_USE_HIPRTC_DEFAULT ${MIOPEN_USE_COMGR} AND (${MIOPEN_hip_VERSION_FLAT} GREATER 500000000))
option(MIOPEN_USE_HIPRTC "Use HIPRTC to build HIP kernels instead of COMGR" ${MIOPEN_USE_HIPRTC_DEFAULT})

# WORKAROUND_SWDEV_413293
if(${MIOPEN_hip_VERSION_FLAT} GREATER_EQUAL 500723302)
string(APPEND HIP_COMPILER_FLAGS " -fno-offload-uniform-block ")
endif()

message(STATUS "Hip compiler flags: ${HIP_COMPILER_FLAGS}")

add_definitions("-DHIP_COMPILER_FLAGS=${HIP_COMPILER_FLAGS}")
Expand All @@ -267,9 +270,6 @@ if( MIOPEN_BACKEND STREQUAL "HIP" OR MIOPEN_BACKEND STREQUAL "HIPOC" OR MIOPEN_B
set(MIOPEN_MODE_NOGPU 1)
endif()
set(MIOPEN_BACKEND_HIP 1)
set(MIOPEN_USE_MIOPENGEMM OFF CACHE BOOL "")
# miopentensile default off
set(MIOPEN_USE_MIOPENTENSILE OFF CACHE BOOL "")

find_program(HIP_OC_COMPILER clang
PATH_SUFFIXES bin
Expand Down Expand Up @@ -370,31 +370,6 @@ find_program(MIOPEN_AMDGCN_ASSEMBLER
)
message(STATUS "AMDGCN assembler: ${MIOPEN_AMDGCN_ASSEMBLER}")

# miopentensile
if(MIOPEN_USE_MIOPENTENSILE)
find_package(miopentensile)
message(STATUS "Build with miopentensile")
else()
message(STATUS "Build without miopentensile")
endif()

# miopengemm
if(MIOPEN_USE_MIOPENGEMM)
find_package(miopengemm PATHS /opt/rocm)
if(NOT miopengemm_FOUND)
set(MIOPEN_USE_MIOPENGEMM 0)
endif()
endif()

if(MIOPEN_USE_MIOPENGEMM)
message(STATUS "Build with miopengemm")
else()
if(MIOPEN_BACKEND_OPENCL)
message(FATAL_ERROR "MIOpen OpenCL backend requires MIOpenGEMM")
endif()
message(STATUS "Build without miopengemm")
endif()

if(MIOPEN_USE_COMGR)
find_package(amd_comgr REQUIRED CONFIG)
message(STATUS "Build with comgr ${amd_comgr_VERSION}")
Expand All @@ -413,7 +388,7 @@ set(BOOST_COMPONENTS filesystem)
add_definitions(-DBOOST_ALL_NO_LIB=1)
find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS})

find_path(HALF_INCLUDE_DIR half.hpp)
find_path(HALF_INCLUDE_DIR half/half.hpp)
message(STATUS "HALF_INCLUDE_DIR: ${HALF_INCLUDE_DIR}")

option( MIOPEN_DEBUG_FIND_DB_CACHING "Use system find-db caching" ON)
Expand Down Expand Up @@ -441,10 +416,6 @@ set(MIOPEN_SYSTEM_FIND_DB_SUFFIX "${MIOPEN_BACKEND}" CACHE PATH "Filename suffix

set(MIOPEN_PACKAGE_REQS "hip-rocclr")

if(MIOPEN_USE_MIOPENGEMM)
set(MIOPEN_PACKAGE_REQS "${MIOPEN_PACKAGE_REQS}, miopengemm")
endif()

if(MIOPEN_USE_ROCBLAS)
set(MIOPEN_PACKAGE_REQS "${MIOPEN_PACKAGE_REQS}, rocblas")
endif()
Expand Down Expand Up @@ -707,6 +678,14 @@ enable_clang_tidy(
-cppcoreguidelines-avoid-const-or-ref-data-members
-cppcoreguidelines-avoid-do-while
-misc-use-anonymous-namespace
###################################################################
# TODO Code Quality WORKAROUND ROCm 5.7
###################################################################
-llvmlibc-inline-function-decl
-cppcoreguidelines-avoid-capture-default-when-capturing-this
-cppcoreguidelines-rvalue-reference-param-not-moved
-readability-avoid-unconditional-preprocessor-if
-bugprone-lambda-function-name
${MIOPEN_TIDY_CHECKS}
${MIOPEN_TIDY_ERRORS}
HEADER_FILTER
Expand Down Expand Up @@ -795,7 +774,6 @@ enable_cppcheck(
${CMAKE_CURRENT_SOURCE_DIR}/src/include
DEFINE
CPPCHECK=1
MIOPEN_USE_MIOPENGEMM=1
__linux__=1
)

Expand Down
9 changes: 6 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
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/5.6/ubuntu/focal/amdgpu-install_5.6.50600-1_all.deb --no-check-certificate
RUN wget https://repo.radeon.com/amdgpu-install/5.7/ubuntu/focal/amdgpu-install_5.7.50700-1_all.deb --no-check-certificate
RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated \
./amdgpu-install_5.6.50600-1_all.deb
./amdgpu-install_5.7.50700-1_all.deb

# Add rocm repository
RUN export ROCM_APT_VER=5.6;\
RUN export ROCM_APT_VER=5.7;\
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 focal 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 focal main > /etc/apt/sources.list.d/rocm.list'
Expand Down Expand Up @@ -106,6 +106,9 @@ RUN ccache -s
ADD docs/.sphinx/requirements.txt /doc-requirements.txt
RUN pip3 install -r /doc-requirements.txt

# Composable Kernel requires this version cmake
RUN pip3 install --upgrade cmake==3.27.5

# Use parallel job to accelerate tensile build
# Workaround for Tensile with TargetID feature
ARG USE_TARGETID="OFF"
Expand Down
Loading

0 comments on commit ce70c8b

Please sign in to comment.