summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiyangWu <xgreenlandforwyy@gmail.com>2021-08-26 20:34:56 +0800
committerBenda Xu <heroxbd@gentoo.org>2021-11-10 12:47:29 +0800
commitb1ba2684adfb3794f68467c03264d4e67ee3173e (patch)
tree75c6d8dc38e82b7e0f8bc27e5932327c00414f5a /sci-libs/miopen/files
parentdev-python/matplotlib: Stabilize 3.4.3-r1 ppc64, #817065 (diff)
downloadgentoo-b1ba2684adfb3794f68467c03264d4e67ee3173e.tar.gz
gentoo-b1ba2684adfb3794f68467c03264d4e67ee3173e.tar.bz2
gentoo-b1ba2684adfb3794f68467c03264d4e67ee3173e.zip
sci-libs/miopen: AMD's Machine Intelligence Library
This is AMD's library for high performance machine learning primitives. PyTorch-ROCm depends on this package. Closes: https://bugs.gentoo.org/732954 Package-Manager: Portage-3.0.20, Repoman-3.0.3 Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com> Signed-off-by: Benda Xu <heroxbd@gentoo.org>
Diffstat (limited to 'sci-libs/miopen/files')
-rw-r--r--sci-libs/miopen/files/miopen-4.2.0-disable-no-inline-boost.patch14
-rw-r--r--sci-libs/miopen/files/miopen-4.2.0-gcc11-numeric_limits.patch14
-rw-r--r--sci-libs/miopen/files/miopen-4.3.0-enable-test.patch31
-rw-r--r--sci-libs/miopen/files/miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch17
-rw-r--r--sci-libs/miopen/files/miopen-4.3.0-no-strip.patch16
-rw-r--r--sci-libs/miopen/files/miopen-4.3.0-strip-xnack-in-flags.patch18
6 files changed, 110 insertions, 0 deletions
diff --git a/sci-libs/miopen/files/miopen-4.2.0-disable-no-inline-boost.patch b/sci-libs/miopen/files/miopen-4.2.0-disable-no-inline-boost.patch
new file mode 100644
index 000000000000..769217acd9d1
--- /dev/null
+++ b/sci-libs/miopen/files/miopen-4.2.0-disable-no-inline-boost.patch
@@ -0,0 +1,14 @@
+This let MIOpen compatible with >boost-1.72, for example 1.76
+
+Suggested by: Michael Boone <mike@protagonistsystems.io>
+
+--- a/CMakeLists.txt 2021-07-23 01:26:15.377754243 -0700
++++ b/CMakeLists.txt 2021-07-23 01:29:23.925685190 -0700
+@@ -216,6 +216,7 @@
+ message(STATUS "Hip compiler flags: ${HIP_COMPILER_FLAGS}")
+
+ add_definitions("-DHIP_COMPILER_FLAGS=${HIP_COMPILER_FLAGS}")
++add_definitions("-DBOOST_CONTAINER_DISABLE_NOINLINE")
+
+
+ # HIP
diff --git a/sci-libs/miopen/files/miopen-4.2.0-gcc11-numeric_limits.patch b/sci-libs/miopen/files/miopen-4.2.0-gcc11-numeric_limits.patch
new file mode 100644
index 000000000000..73997ce5d4db
--- /dev/null
+++ b/sci-libs/miopen/files/miopen-4.2.0-gcc11-numeric_limits.patch
@@ -0,0 +1,14 @@
+See: https://stackoverflow.com/questions/4798936/numeric-limits-was-not-declared-in-this-scope-no-matching-function-for-call-t
+
+https://www.gnu.org/software/gcc/gcc-11/porting_to.html#header-dep-changes
+
+--- MIOpen-rocm-4.2.0/src/include/miopen/float_equal.hpp
++++ MIOpen-rocm-4.2.0/src/include/miopen/float_equal.hpp
+@@ -29,6 +29,7 @@
+ #include <algorithm>
+ #include <cmath>
+ #include <numeric>
++#include <limits>
+ #ifdef _MSC_VER
+ #include <iso646.h>
+ #endif
diff --git a/sci-libs/miopen/files/miopen-4.3.0-enable-test.patch b/sci-libs/miopen/files/miopen-4.3.0-enable-test.patch
new file mode 100644
index 000000000000..68d2f143bf4e
--- /dev/null
+++ b/sci-libs/miopen/files/miopen-4.3.0-enable-test.patch
@@ -0,0 +1,31 @@
+This create option BUILD_TESTS for miopen, like other rocm math libs, and
+
+testing executables are always built if test enabled. The original behaviour, is
+
+always add test/CMakeLists.txt without adding test exes as targets, and compile them
+
+during test.
+--- orig/CMakeLists.txt
++++ MIOpen-rocm-4.3.0/CMakeLists.txt
+@@ -590,6 +590,9 @@ add_subdirectory(src)
+ if(MIOPEN_BUILD_DRIVER)
+ add_subdirectory(driver)
+ endif()
+-add_subdirectory(test)
++option(BUILD_TESTS "Build binaries for tests" OFF)
++if(BUILD_TESTS)
++ add_subdirectory(test)
++endif()
+ add_subdirectory(speedtests)
+ add_subdirectory(utils)
+--- orig/test/CMakeLists.txt
++++ MIOpen-rocm-4.3.0/test/CMakeLists.txt
+@@ -142,7 +142,7 @@ function(add_test_command NAME EXE)
+ endfunction()
+
+ function(add_test_executable TEST_NAME)
+- add_executable (${TEST_NAME} EXCLUDE_FROM_ALL ${ARGN})
++ add_executable (${TEST_NAME} ${ARGN})
+ clang_tidy_check(${TEST_NAME})
+ target_link_libraries(${TEST_NAME} ${CMAKE_THREAD_LIBS_INIT})
+ # Cmake does not add flags correctly for gcc
diff --git a/sci-libs/miopen/files/miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch b/sci-libs/miopen/files/miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch
new file mode 100644
index 000000000000..5c2762a32548
--- /dev/null
+++ b/sci-libs/miopen/files/miopen-4.3.0-fix-interface-include-in-HIP_COMPILER_FLAGS.patch
@@ -0,0 +1,17 @@
+The interface inlude directories of hip::device should be included using -I, not -isystem;
+
+otherwise compilation at MIOpen runtime will fail due to cstdlib cannot find <stdlib.h> or similar errors.
+
+Suggested-by: Yuyi Wang <Strawberry_Str@hotmail.com>
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+--- orig/cmake/TargetFlags.cmake
++++ MIOpen-rocm-4.3.0/cmake/TargetFlags.cmake
+@@ -41,7 +41,7 @@ function(target_flags FLAGS TARGET)
+ set(_flags)
+ append_flags(_flags ${TARGET} "INTERFACE_COMPILE_OPTIONS" "")
+ append_flags(_flags ${TARGET} "INTERFACE_COMPILE_DEFINITIONS" "-D")
+- append_flags(_flags ${TARGET} "INTERFACE_INCLUDE_DIRECTORIES" "-isystem ")
++ append_flags(_flags ${TARGET} "INTERFACE_INCLUDE_DIRECTORIES" "-I ")
+ append_flags(_flags ${TARGET} "INTERFACE_LINK_DIRECTORIES" "-L ")
+ append_flags(_flags ${TARGET} "INTERFACE_LINK_OPTIONS" "")
+ append_link_flags(_flags ${TARGET} "INTERFACE_LINK_LIBRARIES" "")
diff --git a/sci-libs/miopen/files/miopen-4.3.0-no-strip.patch b/sci-libs/miopen/files/miopen-4.3.0-no-strip.patch
new file mode 100644
index 000000000000..2d0565821063
--- /dev/null
+++ b/sci-libs/miopen/files/miopen-4.3.0-no-strip.patch
@@ -0,0 +1,16 @@
+Don't strip for release. Let portage handle stripping.
+--- orig/CMakeLists.txt
++++ MIOpen-rocm-4.3.0/CMakeLists.txt
+@@ -69,12 +69,6 @@ set(MIOPEN_ENABLE_SQLITE_BACKOFF On CACH
+ option( BUILD_DEV "Build for development only" OFF)
+
+
+-# Strip symbols for release
+-if(NOT WIN32 AND NOT APPLE)
+- set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
+- set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
+-endif()
+-
+ rocm_setup_version(VERSION 2.12.0)
+
+ list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake )
diff --git a/sci-libs/miopen/files/miopen-4.3.0-strip-xnack-in-flags.patch b/sci-libs/miopen/files/miopen-4.3.0-strip-xnack-in-flags.patch
new file mode 100644
index 000000000000..dc6db68c2afc
--- /dev/null
+++ b/sci-libs/miopen/files/miopen-4.3.0-strip-xnack-in-flags.patch
@@ -0,0 +1,18 @@
+if options like :xnack- exists in ${AMDGPU_TARGETS}, CMakeLists cannot handle HIP_COMPILER_FLAGS well
+
+the original regex replace should include :+- so xnack- is stripped as well. Otherwise clang complation at MIOpen runtime will fail.
+
+Signed-off-by: Yiyang Wu <xgreenlandforwyy@gmail.com>
+--- orig/CMakeLists.txt
++++ MIOpen-rocm-4.3.0/CMakeLists.txt
+@@ -191,8 +191,8 @@ find_package(hip REQUIRED PATHS /opt/roc
+ message(STATUS "Build with HIP ${hip_VERSION}")
+ target_flags(HIP_COMPILER_FLAGS hip::device)
+ # Remove cuda arch flags
+-string(REGEX REPLACE --cuda-gpu-arch=[a-z0-9]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
+-string(REGEX REPLACE --offload-arch=[a-z0-9]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
++string(REGEX REPLACE --cuda-gpu-arch=[a-z0-9:+-]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
++string(REGEX REPLACE --offload-arch=[a-z0-9:+-]+ "" HIP_COMPILER_FLAGS "${HIP_COMPILER_FLAGS}")
+
+ # Override HIP version in config.h, if necessary.
+ # The variables set by find_package() can't be overwritten,