* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2021-08-27 11:53 Benda XU
0 siblings, 0 replies; 8+ messages in thread
From: Benda XU @ 2021-08-27 11:53 UTC (permalink / raw
To: gentoo-commits
commit: 6347499d4e8375f342b9f71a003ad4d757ab0eac
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Sat Aug 21 13:53:18 2021 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Aug 27 11:51:16 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6347499d
sci-libs/rocBLAS: Next generation BLAS implementation for ROCm
Migrated from ::science, rocBLAS is the core math libraries on ROCm platform
for high performance computing on AMDGPU, dependency of MIOpen.
Current version 4.3.0, support nearly all major AMD GPUs,
especially for GCN, CDNA and RDNA2 (nightly) cards.
Closes: https://bugs.gentoo.org/732952
Closes: https://bugs.gentoo.org/804181
Closes: https://github.com/gentoo/gentoo/pull/22065
Package-Manager: Portage-3.0.20, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
sci-libs/rocBLAS/Manifest | 2 +
...ensile-4.3.0-hsaco-compile-specified-arch.patch | 96 ++++++++++++++
.../files/Tensile-4.3.0-output-commands.patch | 23 ++++
...-4.3.0-change-default-Tensile-library-dir.patch | 39 ++++++
.../rocBLAS-4.3.0-fix-glibc-2.32-and-above.patch | 25 ++++
.../files/rocBLAS-4.3.0-link-system-blas.patch | 24 ++++
sci-libs/rocBLAS/metadata.xml | 19 +++
sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild | 139 +++++++++++++++++++++
8 files changed, 367 insertions(+)
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest
new file mode 100644
index 00000000000..00865310a02
--- /dev/null
+++ b/sci-libs/rocBLAS/Manifest
@@ -0,0 +1,2 @@
+DIST rocm-Tensile-4.3.0.tar.gz 14250149 BLAKE2B 030138eaca2a0aadd96801e6dbd72e510716dd90553ef3795c5e04e00a34a05ecae82b24f755e4033a4acfcdb1cf26291da1e7902bb090f89a010d403e832beb SHA512 126db0b413c716fba8d5be9bff7a44fd1badacbf32f3db8d0db649819177db37ebd56fd22dd3c809655f5d29675be115e698cd10bc3d0b4b23878ae3726fce47
+DIST rocm-rocBLAS-4.3.0.tar.gz 11569970 BLAKE2B f11b0acf2bbd5737b036142d3b2cc1e18c38e088a8b7db58156d478dd6718befbb82bb7fd43a38fe64a5427124c5ad5241fa37977f094e6efd195d168d3e5f65 SHA512 490ab1c1e98a8b311ad5630515c448d9bb0a2bf588a08bcbebee345e2954d616b4ffe7c2e03dadca82c590438c42afccb98fe8ba00856aece101b5ffe62ef1e0
diff --git a/sci-libs/rocBLAS/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch b/sci-libs/rocBLAS/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch
new file mode 100644
index 00000000000..8e6753781a2
--- /dev/null
+++ b/sci-libs/rocBLAS/files/Tensile-4.3.0-hsaco-compile-specified-arch.patch
@@ -0,0 +1,96 @@
+https://github.com/ROCmSoftwarePlatform/Tensile/issues/1395
+https://github.com/ROCmSoftwarePlatform/Tensile/pull/1398
+
+--- a/Tensile/TensileCreateLibrary.py
++++ b/Tensile/TensileCreateLibrary.py
+@@ -136,6 +136,35 @@ def which(p):
+ return candidate
+ return None
+
++def splitArchs():
++ # Helper for architecture
++ def isSupported(arch):
++ return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
++ globalParameters["AsmCaps"][arch]["SupportedSource"]
++
++ if ";" in globalParameters["Architecture"]:
++ wantedArchs = globalParameters["Architecture"].split(";")
++ else:
++ wantedArchs = globalParameters["Architecture"].split("_")
++ archs = []
++ cmdlineArchs = []
++ if "all" in wantedArchs:
++ for arch in globalParameters['SupportedISA']:
++ if isSupported(arch):
++ if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
++ if (arch == (9,0,10)):
++ archs += [gfxName(arch) + '-xnack+']
++ cmdlineArchs += [gfxName(arch) + ':xnack+']
++ archs += [gfxName(arch) + '-xnack-']
++ cmdlineArchs += [gfxName(arch) + ':xnack-']
++ else:
++ archs += [gfxName(arch)]
++ cmdlineArchs += [gfxName(arch)]
++ else:
++ for arch in wantedArchs:
++ archs += [re.sub(":", "-", arch)]
++ cmdlineArchs += [arch]
++ return archs, cmdlineArchs
+
+ def buildSourceCodeObjectFile(CxxCompiler, outputPath, kernelFile):
+ buildPath = ensurePath(os.path.join(globalParameters['WorkingPath'], 'code_object_tmp'))
+@@ -149,24 +178,8 @@ def buildSourceCodeObjectFile(CxxCompiler, outputPath, kernelFile):
+ objectFilename = base + '.o'
+ soFilename = base + '.so'
+
+- def isSupported(arch):
+- return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
+- globalParameters["AsmCaps"][arch]["SupportedSource"]
+-
+ if (CxxCompiler == "hipcc"):
+- archs = []
+- cmdlineArchs = []
+- for arch in globalParameters['SupportedISA']:
+- if isSupported(arch):
+- if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
+- if (arch == (9,0,10)):
+- archs += [gfxName(arch) + '-xnack+']
+- cmdlineArchs += [gfxName(arch) + ':xnack+']
+- archs += [gfxName(arch) + '-xnack-']
+- cmdlineArchs += [gfxName(arch) + ':xnack-']
+- else:
+- archs += [gfxName(arch)]
+- cmdlineArchs += [gfxName(arch)]
++ archs, cmdlineArchs = splitArchs()
+
+ archFlags = ['--offload-arch=' + arch for arch in cmdlineArchs]
+
+@@ -1063,11 +1076,6 @@ def buildObjectFileNames(solutionWriter, kernelWriterSource, kernelWriterAssembl
+ sourceKernels = list([k for k in kernels if k['KernelLanguage'] == 'Source'])
+ asmKernels = list([k for k in kernels if k['KernelLanguage'] == 'Assembly'])
+
+- # Helper for architecture
+- def isSupported(arch):
+- return globalParameters["AsmCaps"][arch]["SupportedISA"] and \
+- globalParameters["AsmCaps"][arch]["SupportedSource"]
+-
+ # Build a list of kernel object names.
+ for kernel in sourceKernels:
+ sourceKernelNames += [kernelWriterSource.getKernelFileBase(kernel)]
+@@ -1081,15 +1089,7 @@ def buildObjectFileNames(solutionWriter, kernelWriterSource, kernelWriterAssembl
+
+ # Source based kernels are built for all supported architectures
+ if (cxxCompiler == 'hipcc'):
+- sourceArchs = []
+- for arch in globalParameters['SupportedISA']:
+- if isSupported(arch):
+- if (arch == (9,0,6) or arch == (9,0,8) or arch == (9,0,10)):
+- if (arch == (9,0,10)):
+- sourceArchs += [gfxName(arch) + '-xnack+']
+- sourceArchs += [gfxName(arch) + '-xnack-']
+- else:
+- sourceArchs += [gfxName(arch)]
++ sourceArchs, _ = splitArchs()
+ else:
+ raise RuntimeError("Unknown compiler %s" % cxxCompiler)
+
diff --git a/sci-libs/rocBLAS/files/Tensile-4.3.0-output-commands.patch b/sci-libs/rocBLAS/files/Tensile-4.3.0-output-commands.patch
new file mode 100644
index 00000000000..be5a4db2142
--- /dev/null
+++ b/sci-libs/rocBLAS/files/Tensile-4.3.0-output-commands.patch
@@ -0,0 +1,23 @@
+diff --color -uprN orig/Tensile/cmake/TensileConfig.cmake Tensile-rocm-4.3.0/Tensile/cmake/TensileConfig.cmake
+--- orig/Tensile/cmake/TensileConfig.cmake 2021-08-18 17:48:00.115478470 +0800
++++ Tensile-rocm-4.3.0/Tensile/cmake/TensileConfig.cmake 2021-08-18 17:48:49.963478801 +0800
+@@ -234,6 +234,7 @@ function(TensileCreateLibraryFiles
+ COMMENT "Generating Tensile Libraries"
+ OUTPUT ${Tensile_EMBED_LIBRARY_SOURCE};${Tensile_MANIFEST_CONTENTS}
+ COMMAND ${CommandLine}
++ USES_TERMINAL
+ )
+
+ set("${Tensile_VAR_PREFIX}_ALL_FILES" ${Tensile_MANIFEST_CONTENTS} PARENT_SCOPE)
+diff --color -uprN orig/Tensile/Common.py Tensile-rocm-4.3.0/Tensile/Common.py
+--- orig/Tensile/Common.py 2021-08-18 17:48:00.075478470 +0800
++++ Tensile-rocm-4.3.0/Tensile/Common.py 2021-08-18 17:48:23.287478624 +0800
+@@ -179,7 +179,7 @@ globalParameters["PrintTensorD"] = 0
+ globalParameters["PrintTensorRef"] = 0 # Print reference tensor. 0x1=after init; 0x2=after copy-back; 0x3=both
+ globalParameters["PrintIndexAssignments"] = 0 # Print the tensor index assignment info
+ globalParameters["PrintWinnersOnly"] = False # Only print the solutions which become the fastest
+-globalParameters["PrintCodeCommands"] = False # print the commands used to generate the code objects (asm,link,hip-clang, etc)
++globalParameters["PrintCodeCommands"] = True # print the commands used to generate the code objects (asm,link,hip-clang, etc)
+ globalParameters["DumpTensors"] = False # If True, dump tensors to binary files instead of printing them.
+
+ # TODO - remove this when NewClient is mainstream
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-change-default-Tensile-library-dir.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-change-default-Tensile-library-dir.patch
new file mode 100644
index 00000000000..1841424c6e5
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-change-default-Tensile-library-dir.patch
@@ -0,0 +1,39 @@
+change the default rocm tensile library search path
+--- orig/library/src/tensile_host.cpp 2021-08-21 17:56:47.040481580 +0800
++++ rocBLAS-rocm-4.3.0/library/src/tensile_host.cpp 2021-08-21 17:58:46.360482372 +0800
+@@ -489,34 +489,7 @@ namespace
+ }
+ else
+ {
+-#ifndef ROCBLAS_STATIC_LIB
+- Dl_info info;
+-
+- // Find the location of librocblas.so
+- // Fall back on hard-coded path if static library or not found
+- // [Use a C API (rocblas_sccal) *not* defined in this file to
+- // avoid compile-time resolution of the function pointer; cf.
+- // https://man7.org/linux/man-pages/man3/dladdr.3.html "BUGS"]
+-
+- if(dladdr((void*)rocblas_sscal, &info))
+- {
+- path = info.dli_fname;
+- path = std::string{dirname(&path[0])};
+- }
+- else
+-#endif
+- {
+- path = "/opt/rocm/rocblas/lib";
+- }
+-
+- // Find the location of the libraries
+- if(TestPath(path + "/../../Tensile/library"))
+- path += "/../../Tensile/library";
+- else
+- path += "/library";
+-
+- if(TestPath(path + "/" + processor))
+- path += "/" + processor;
++ path="@GENTOO_PORTAGE_EPREFIX@/usr/lib64/rocblas/library";
+ }
+
+ // only load modules for the current architecture
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-fix-glibc-2.32-and-above.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-fix-glibc-2.32-and-above.patch
new file mode 100644
index 00000000000..a4d9f0bab34
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-fix-glibc-2.32-and-above.patch
@@ -0,0 +1,25 @@
+https://sourceware.org/glibc/wiki/Release/2.32#Deprectation_sys_siglist.2C__sys_siglist.2C_sys_sigabbrev
+
+--- rocBLAS-rocm-4.1.0/clients/gtest/rocblas_test.cpp
++++ rocBLAS-rocm-4.1.0/clients/gtest/rocblas_test.cpp
+@@ -173,7 +173,7 @@ void catch_signals_and_exceptions_as_fai
+ // Set up the return point, and handle siglongjmp returning back to here
+ if(sigsetjmp(t_handler.sigjmp_buf, true))
+ {
+- FAIL() << "Received " << sys_siglist[t_handler.signal] << " signal";
++ FAIL() << "Received " << strsignal(t_handler.signal) << " signal";
+ }
+ else
+ {
+
+--- rocBLAS-rocm-4.1.0/clients/include/utility.hpp
++++ rocBLAS-rocm-4.1.0/clients/include/utility.hpp
+@@ -39,7 +39,7 @@
+ // puts, putchar, fputs, printf, fprintf, vprintf, vfprintf: Use rocblas_cout or rocblas_cerr
+ // sprintf, vsprintf: Possible buffer overflows; us snprintf or vsnprintf instead
+ // strerror: Thread-unsafe; use snprintf / dprintf with %m or strerror_* alternatives
+-// strsignal: Thread-unsafe; use sys_siglist[signal] instead
++// strsignal: Thread-unsafe; use strsignal(signal) instead
+ // strtok: Thread-unsafe; use strtok_r
+ // gmtime, ctime, asctime, localtime: Thread-unsafe
+ // tmpnam: Thread-unsafe; use mkstemp or related functions instead
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-link-system-blas.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-link-system-blas.patch
new file mode 100644
index 00000000000..184b76d7ef3
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-link-system-blas.patch
@@ -0,0 +1,24 @@
+Link system blas libraries rather than the downloaded libraries (in install.sh)
+
+--- orig/clients/benchmarks/CMakeLists.txt
++++ rocBLAS-rocm-4.2.0/clients/benchmarks/CMakeLists.txt
+@@ -49,7 +49,7 @@ target_include_directories( rocblas-benc
+ $<BUILD_INTERFACE:${BLIS_INCLUDE_DIR}>
+ )
+
+-target_link_libraries( rocblas-bench PRIVATE rocblas_fortran_client roc::rocblas lapack cblas )
++target_link_libraries( rocblas-bench PRIVATE rocblas_fortran_client roc::rocblas lapack cblas -lblas )
+ if(LINK_BLIS)
+ target_link_libraries( rocblas-bench PRIVATE ${BLIS_LIBRARY} )
+ endif()
+--- orig/clients/gtest/CMakeLists.txt
++++ rocBLAS-rocm-4.2.0/clients/gtest/CMakeLists.txt
+@@ -129,7 +129,7 @@ target_include_directories( rocblas-test
+ $<BUILD_INTERFACE:${BLIS_INCLUDE_DIR}>
+ )
+
+-target_link_libraries( rocblas-test PRIVATE rocblas_fortran_client roc::rocblas lapack cblas ${GTEST_LIBRARIES} )
++target_link_libraries( rocblas-test PRIVATE rocblas_fortran_client roc::rocblas lapack cblas -lblas ${GTEST_LIBRARIES} )
+ if(LINK_BLIS)
+ target_link_libraries( rocblas-test PRIVATE ${BLIS_LIBRARY} )
+ endif()
diff --git a/sci-libs/rocBLAS/metadata.xml b/sci-libs/rocBLAS/metadata.xml
new file mode 100644
index 00000000000..44cdde5646e
--- /dev/null
+++ b/sci-libs/rocBLAS/metadata.xml
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM 'http://www.gentoo.org/dtd/metadata.dtd'>
+<pkgmetadata>
+ <maintainer type="project">
+ <email>sci@gentoo.org</email>
+ </maintainer>
+ <maintainer type="person">
+ <email>gentoo@holzke.net</email>
+ <name>Wilfried Holzke</name>
+ </maintainer>
+ <maintainer type="person">
+ <email>xgreenlandforwyy@gmail.com</email>
+ <name>Yiyang Wu</name>
+ </maintainer>
+ <use>
+ <flag name="test">Perform rocblas-test to compare the result between rocBLAS and system BLAS.</flag>
+ <flag name="benchmark">Build and install rocblas-bench.</flag>
+ </use>
+</pkgmetadata>
diff --git a/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild b/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild
new file mode 100644
index 00000000000..4e05309d0c4
--- /dev/null
+++ b/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild
@@ -0,0 +1,139 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{6..9} )
+
+inherit cmake prefix python-any-r1
+
+DESCRIPTION="AMD's library for BLAS on ROCm."
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz
+ https://github.com/ROCmSoftwarePlatform/Tensile/archive/rocm-${PV}.tar.gz -> rocm-Tensile-${PV}.tar.gz"
+
+LICENSE="MIT"
+KEYWORDS="~amd64"
+IUSE="benchmark test"
+SLOT="0/$(ver_cut 1-2)"
+
+BDEPEND="
+ dev-util/rocm-cmake
+ !dev-util/Tensile
+ $(python_gen_any_dep '
+ dev-python/msgpack[${PYTHON_USEDEP}]
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ ')
+"
+
+DEPEND="
+ dev-util/hip:${SLOT}
+ dev-libs/msgpack
+ test? ( virtual/blas
+ dev-cpp/gtest
+ sys-libs/libomp )
+ benchmark? ( virtual/blas
+ sys-libs/libomp )
+"
+RESTRICT="!test? ( test )"
+
+python_check_deps() {
+ has_version "dev-python/pyyaml[${PYTHON_USEDEP}]" &&
+ has_version "dev-python/msgpack[${PYTHON_USEDEP}]"
+}
+
+S="${WORKDIR}"/${PN}-rocm-${PV}
+
+PATCHES=("${FILESDIR}"/${PN}-4.3.0-fix-glibc-2.32-and-above.patch
+ "${FILESDIR}"/${PN}-4.3.0-change-default-Tensile-library-dir.patch
+ "${FILESDIR}"/${PN}-4.3.0-link-system-blas.patch )
+
+src_prepare() {
+ eapply_user
+
+ pushd "${WORKDIR}"/Tensile-rocm-${PV} || die
+ eapply "${FILESDIR}/Tensile-${PV}-hsaco-compile-specified-arch.patch" # backported from upstream, should remove after 4.3.0
+ eapply "${FILESDIR}/Tensile-4.3.0-output-commands.patch"
+ popd || die
+
+ # Fit for Gentoo FHS rule
+ sed -e "/PREFIX rocblas/d" \
+ -e "/<INSTALL_INTERFACE/s:include:include/rocblas:" \
+ -e "s:rocblas/include:include/rocblas:" \
+ -e "s:\\\\\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib:${EPREFIX}/usr/$(get_libdir)/rocblas:" \
+ -e "s:share/doc/rocBLAS:share/doc/${P}:" \
+ -e "/rocm_install_symlink_subdir( rocblas )/d" -i library/src/CMakeLists.txt || die
+
+ # Use setup.py to install Tensile rather than pip
+ sed -r -e "/pip install/s:([^ \"\(]*python) -m pip install ([^ \"\)]*):\1 setup.py install --single-version-externally-managed --root / WORKING_DIRECTORY \2:g" -i cmake/virtualenv.cmake
+
+ sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die
+
+ cmake_src_prepare
+ eprefixify library/src/tensile_host.cpp
+}
+
+src_configure() {
+ # allow acces to hardware
+ addpredict /dev/kfd
+ addpredict /dev/dri/
+ addpredict /dev/random
+
+ export PATH="${EPREFIX}/usr/lib/llvm/roc/bin:${PATH}"
+
+ local mycmakeargs=(
+ -DTensile_LOGIC="asm_full"
+ -DTensile_COMPILER="hipcc"
+ -DTensile_LIBRARY_FORMAT="msgpack"
+ -DTensile_CODE_OBJECT_VERSION="V3"
+ -DTensile_TEST_LOCAL_PATH="${WORKDIR}/Tensile-rocm-${PV}"
+ -DBUILD_WITH_TENSILE=ON
+ -DBUILD_WITH_TENSILE_HOST=ON
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas"
+ -DCMAKE_SKIP_RPATH=TRUE
+ -DBUILD_TESTING=OFF
+ -DBUILD_CLIENTS_SAMPLES=OFF
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
+ ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
+ -D__skip_rocmclang="ON" ## fix cmake-3.21 configuration issue caused by officialy support programming language "HIP"
+ )
+
+ CXX="hipcc" cmake_src_configure
+
+ # do not rerun cmake and the build process in src_install
+ sed -e '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
+}
+
+check_rw_permission() {
+ cmd="[ -r $1 ] && [ -w $1 ]"
+ errormsg="${user} do not have read and write permissions on $1! \n Make sure ${user} is in render group and check the permissions."
+ if has sandbox ${FEATURES}; then
+ user=portage
+ su portage -c "${cmd}" || die ${errormsg}
+ else
+ user=`whoami`
+ ${cmd} || die ${errormsg}
+ fi
+}
+
+src_test() {
+ # check permissions on /dev/kfd and /dev/dri/render*
+ check_rw_permission /dev/kfd
+ check_rw_permission /dev/dri/render*
+ addwrite /dev/kfd
+ addwrite /dev/dri/
+ cd "${BUILD_DIR}/clients/staging" || die
+ ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library" ./rocblas-test
+}
+
+src_install() {
+ cmake_src_install
+
+ if use benchmark; then
+ cd "${BUILD_DIR}" || die
+ dolib.so clients/librocblas_fortran_client.so
+ dobin clients/staging/rocblas-bench
+ fi
+}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2022-03-05 20:51 Andrew Ammerlaan
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Ammerlaan @ 2022-03-05 20:51 UTC (permalink / raw
To: gentoo-commits
commit: 890148bb81f517304f86f41303534b0abaa7c77c
Author: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 5 20:50:24 2022 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sat Mar 5 20:51:53 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=890148bb
sci-libs/rocBLAS: unbundle Tensile
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
.../files/rocBLAS-4.3.0-unbundle-Tensile.patch | 44 ++++++
sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild | 147 +++++++++++++++++++++
2 files changed, 191 insertions(+)
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch
new file mode 100644
index 000000000000..f2bcff9a58db
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch
@@ -0,0 +1,44 @@
+diff --git a/cmake/virtualenv.cmake b/cmake/virtualenv.cmake
+index 4c29c94..f9838c2 100644
+--- a/cmake/virtualenv.cmake
++++ b/cmake/virtualenv.cmake
+@@ -11,7 +11,7 @@ set(VIRTUALENV_HOME_DIR ${CMAKE_BINARY_DIR}/virtualenv CACHE PATH "Path to virtu
+ function(virtualenv_create)
+ message("${VIRTUALENV_PYTHON_EXE} -m venv ${VIRTUALENV_HOME_DIR} --system-site-packages --clear")
+ execute_process(
+- COMMAND ${VIRTUALENV_PYTHON_EXE} -m venv ${VIRTUALENV_HOME_DIR} --system-site-packages --clear
++ COMMAND true
+ )
+ endfunction()
+
+@@ -21,7 +21,7 @@ function(virtualenv_install)
+ message("${VIRTUALENV_HOME_DIR}/bin/python -m pip install ${ARGN}")
+ execute_process(
+ RESULT_VARIABLE rc
+- COMMAND ${VIRTUALENV_HOME_DIR}/bin/python -m pip install ${ARGN}
++ COMMAND true
+ )
+ if(rc)
+ message(FATAL_ERROR ${rc})
+diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt
+index a34ee87..bf94988 100755
+--- a/library/src/CMakeLists.txt
++++ b/library/src/CMakeLists.txt
+@@ -99,9 +99,6 @@ if( BUILD_WITH_TENSILE )
+ # Create a unique name for TensileHost compiled for rocBLAS
+ set_target_properties( TensileHost PROPERTIES OUTPUT_NAME rocblas-tensile CXX_EXTENSIONS NO )
+ target_compile_definitions( TensileHost PUBLIC USE_TENSILE_HOST )
+-
+- # Tensile host depends on libs build target
+- add_dependencies( TensileHost TENSILE_LIBRARY_TARGET )
+ else()
+ # Create a unique name for Tensile compiled for rocBLAS
+ set_target_properties( Tensile PROPERTIES OUTPUT_NAME rocblas-tensile CXX_EXTENSIONS NO )
+@@ -520,7 +517,6 @@ rocm_install_targets(
+ if( BUILD_WITH_TENSILE )
+ if( BUILD_WITH_TENSILE_HOST )
+ set( ROCBLAS_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib" CACHE PATH "path to tensile library" )
+- install(DIRECTORY ${CMAKE_BINARY_DIR}/Tensile/library DESTINATION ${ROCBLAS_TENSILE_LIBRARY_DIR})
+ endif()
+ endif()
+
diff --git a/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild b/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild
new file mode 100644
index 000000000000..13cf41fdd900
--- /dev/null
+++ b/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild
@@ -0,0 +1,147 @@
+# Copyright 1999-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{8..10} )
+DOCS_BUILDER="doxygen"
+DOCS_DIR="docs"
+DOCS_DEPEND="media-gfx/graphviz"
+inherit cmake docs prefix python-any-r1
+
+DESCRIPTION="AMD's library for BLAS on ROCm"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz"
+S="${WORKDIR}/${PN}-rocm-${PV}"
+
+LICENSE="BSD"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="benchmark test"
+RESTRICT="!test? ( test )"
+
+BDEPEND="${PYTHON_DEPS}
+ dev-util/rocm-cmake:${SLOT}
+ $(python_gen_any_dep '
+ dev-util/Tensile[${PYTHON_USEDEP}]
+ ')
+ dev-util/Tensile:${SLOT}
+"
+
+DEPEND="
+ dev-util/hip:${SLOT}
+ dev-libs/msgpack
+ test? (
+ virtual/blas
+ dev-cpp/gtest
+ sys-libs/libomp
+ )
+ benchmark? (
+ virtual/blas
+ sys-libs/libomp
+ )
+"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.3.0-fix-glibc-2.32-and-above.patch
+ "${FILESDIR}"/${PN}-4.3.0-change-default-Tensile-library-dir.patch
+ "${FILESDIR}"/${PN}-4.3.0-link-system-blas.patch
+ "${FILESDIR}"/${PN}-4.3.0-remove-problematic-test-suites.patch
+ "${FILESDIR}"/${PN}-4.3.0-unbundle-Tensile.patch
+)
+
+python_check_deps() {
+ has_version "dev-util/Tensile[${PYTHON_USEDEP}]"
+}
+
+src_prepare() {
+ cmake_src_prepare
+ # Fit for Gentoo FHS rule
+ sed -e "/PREFIX rocblas/d" \
+ -e "/<INSTALL_INTERFACE/s:include:include/rocblas:" \
+ -e "s:rocblas/include:include/rocblas:" \
+ -e "s:\\\\\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib:${EPREFIX}/usr/$(get_libdir)/rocblas:" \
+ -e "s:share/doc/rocBLAS:share/doc/${P}:" \
+ -e "/rocm_install_symlink_subdir( rocblas )/d" -i library/src/CMakeLists.txt || die
+
+ sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die
+
+ eprefixify library/src/tensile_host.cpp
+}
+
+src_configure() {
+ # allow acces to hardware
+ addpredict /dev/kfd
+ addpredict /dev/dri/
+ addpredict /dev/random
+
+ export PATH="${EPREFIX}/usr/lib/llvm/roc/bin:${PATH}"
+ export TENSILE_SKIP_LIBRARY=1
+
+ local mycmakeargs=(
+ -DTensile_LOGIC="asm_full"
+ -DTensile_COMPILER="hipcc"
+ -DTensile_LIBRARY_FORMAT="msgpack"
+ -DTensile_CODE_OBJECT_VERSION="V3"
+ -DTensile_TEST_LOCAL_PATH="${EPREFIX}/usr/share/Tensile"
+ -DTensile_ROOT="${EPREFIX}/usr/share/Tensile"
+ -DBUILD_WITH_TENSILE=ON
+ -DBUILD_WITH_TENSILE_HOST=ON
+ -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
+ -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas"
+ -DCMAKE_SKIP_RPATH=TRUE
+ -DBUILD_TESTING=OFF
+ -DBUILD_CLIENTS_SAMPLES=OFF
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
+ ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
+ )
+
+ CXX="hipcc" cmake_src_configure
+
+ # do not rerun cmake and the build process in src_install
+ sed -e '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
+}
+
+src_compile() {
+ docs_compile
+ cmake_src_compile
+}
+
+check_rw_permission() {
+ local cmd="[ -r $1 ] && [ -w $1 ]"
+ local error=0 user
+ if has sandbox ${FEATURES}; then
+ user="portage"
+ su portage -c "${cmd}" || error=1
+ else
+ user="$(whoami)"
+ ${cmd} || error=1
+ fi
+ if [[ "${error}" == 1 ]]; then
+ die "${user} do not have read and write permissions on $1! \n Make sure ${user} is in render group and check the permissions."
+ fi
+}
+
+src_test() {
+ # check permissions on /dev/kfd and /dev/dri/render*
+ check_rw_permission /dev/kfd
+ check_rw_permission /dev/dri/render*
+ addwrite /dev/kfd
+ addwrite /dev/dri/
+ cd "${BUILD_DIR}/clients/staging" || die
+ ./rocblas-test || die "Tests failed"
+}
+
+src_install() {
+ cmake_src_install
+
+ if use benchmark; then
+ cd "${BUILD_DIR}" || die
+ dolib.so clients/librocblas_fortran_client.so
+ dobin clients/staging/rocblas-bench
+ fi
+
+ # Don't install the License (it is installed into the wrong dir)
+ rm "${ED}/usr/share/doc/${P}/LICENSE"* || die
+}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2022-03-05 20:51 Andrew Ammerlaan
0 siblings, 0 replies; 8+ messages in thread
From: Andrew Ammerlaan @ 2022-03-05 20:51 UTC (permalink / raw
To: gentoo-commits
commit: 762901be036f623bb386f27cb8f586178cf81c42
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Tue Dec 21 03:48:53 2021 +0000
Commit: Andrew Ammerlaan <andrewammerlaan <AT> gentoo <DOT> org>
CommitDate: Sat Mar 5 20:51:49 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=762901be
sci-libs/rocBLAS: fix tests using openblas as cpu reference
Add a patch that classify 6 test suites as known_bug.
Upstream will fix this issue in future releases,
and they recommand this as solution for current version.
Closes: https://github.com/ROCmSoftwarePlatform/rocBLAS/issues/1202
Package-Manager: Portage-3.0.22, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Andrew Ammerlaan <andrewammerlaan <AT> gentoo.org>
...BLAS-4.3.0-remove-problematic-test-suites.patch | 22 ++++++++++++++++++++++
sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild | 3 ++-
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-remove-problematic-test-suites.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-remove-problematic-test-suites.patch
new file mode 100644
index 000000000000..4265e999f322
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-remove-problematic-test-suites.patch
@@ -0,0 +1,22 @@
+Those tests will fail comparing rocblas vs openblas, because the testing program is so strict that it cannot tolerate the numerical differences which is actually OK.
+
+https://github.com/ROCmSoftwarePlatform/rocBLAS/issues/1202
+--- orig/clients/gtest/known_bugs.yaml
++++ rocBLAS-rocm-4.3.0/clients/gtest/known_bugs.yaml
+@@ -7,6 +7,16 @@ Known bugs:
+ - { function: gemm_ex, a_type: i8_r, b_type: i8_r, c_type: i32_r, d_type: i32_r, compute_type: i32_r, flags: 0, known_bug_platforms: "gfx900,gfx906,gfx1010,gfx1011,gfx1012,gfx1030" }
+ - { function: gemm_batched_ex, a_type: i8_r, b_type: i8_r, c_type: i32_r, d_type: i32_r, compute_type: i32_r, flags: 0, known_bug_platforms: "gfx900,gfx906,gfx90a,gfx1010,gfx1011,gfx1012,gfx1030" }
+ - { function: gemm_strided_batched_ex, a_type: i8_r, b_type: i8_r, c_type: i32_r, d_type: i32_r, compute_type: i32_r, flags: 0, known_bug_platforms: "gfx900,gfx906,gfx1010,gfx1011,gfx1012,gfx1030" }
++# gemv openblas reference differences due to summation order dependent roundoff accumulation with large M float complex
++# 8th significant digit difference vs CPU on single precision float math, leads to expected equality test failure
++# code needs to be changed to a tolerance test or reduce M for float complex type if using equality vs. CPU reference
++- { function: gemv, a_type: f32_c, transA: T, M: 131071 }
++- { function: gemv, a_type: f32_c, transA: C, M: 131071 }
++- { function: gemv_batched, a_type: f32_c, transA: T, M: 131071 }
++- { function: gemv_batched, a_type: f32_c, transA: C, M: 131071 }
++- { function: gemv_strided_batched, a_type: f32_c, transA: T, M: 131071 }
++- { function: gemv_strided_batched, a_type: f32_c, transA: C, M: 131071 }
++
+
+ #- { function: gemm_ex, a_type: bf16_r, b_type: bf16_r, c_type: bf16_r, d_type: bf16_r, compute_type: f32_r, transA: C, transB: N, M: 512, N: 512, K: 512, lda: 512, ldb: 512, ldc: 512, ldd: 512, alpha: 5.0, alphai: 0.0, beta: 0.0, betai: 0.0, known_bug_platforms: gfx908 }
+ #- { function: gemm_ex, a_type: bf16_r, b_type: bf16_r, c_type: bf16_r, d_type: bf16_r, compute_type: f32_r, transA: C, transB: N, M: 512, N: 512, K: 512, lda: 512, ldb: 512, ldc: 512, ldd: 512, alpha: 0.0, alphai: 0.0, beta: 3.0, betai: 0.0, known_bug_platforms: gfx908 }
diff --git a/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild b/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild
index f682328b782c..82b9207bdb09 100644
--- a/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild
+++ b/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild
@@ -46,7 +46,8 @@ S="${WORKDIR}"/${PN}-rocm-${PV}
PATCHES=("${FILESDIR}"/${PN}-4.3.0-fix-glibc-2.32-and-above.patch
"${FILESDIR}"/${PN}-4.3.0-change-default-Tensile-library-dir.patch
- "${FILESDIR}"/${PN}-4.3.0-link-system-blas.patch )
+ "${FILESDIR}"/${PN}-4.3.0-link-system-blas.patch
+ "${FILESDIR}"/${PN}-4.3.0-remove-problematic-test-suites.patch )
src_prepare() {
eapply_user
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2022-03-20 7:33 Benda XU
0 siblings, 0 replies; 8+ messages in thread
From: Benda XU @ 2022-03-20 7:33 UTC (permalink / raw
To: gentoo-commits
commit: e079f32e38a1aa6d32dccd5ec982b4c8ab54f6c5
Author: YiyangWu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Sun Mar 20 05:12:05 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Sun Mar 20 07:33:49 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e079f32e
sci-libs/rocBLAS-4.3.0: re-enable Tensile library
890148bb81f517304f86f41303534b0abaa7c77c disables compiling Tensile
library (maybe due to dev-util/Tensile not properly configured). After
correcting paths in Tensile, compiling libraries ican be re-enabled.
Also fix test fail due to library not found
Closes: https://github.com/gentoo/gentoo/pull/24679
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
.../files/rocBLAS-4.3.0-unbundle-Tensile.patch | 22 ----------------------
sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild | 3 +--
2 files changed, 1 insertion(+), 24 deletions(-)
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch
index f2bcff9a58db..c8d99c851b00 100644
--- a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch
+++ b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch
@@ -20,25 +20,3 @@ index 4c29c94..f9838c2 100644
)
if(rc)
message(FATAL_ERROR ${rc})
-diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt
-index a34ee87..bf94988 100755
---- a/library/src/CMakeLists.txt
-+++ b/library/src/CMakeLists.txt
-@@ -99,9 +99,6 @@ if( BUILD_WITH_TENSILE )
- # Create a unique name for TensileHost compiled for rocBLAS
- set_target_properties( TensileHost PROPERTIES OUTPUT_NAME rocblas-tensile CXX_EXTENSIONS NO )
- target_compile_definitions( TensileHost PUBLIC USE_TENSILE_HOST )
--
-- # Tensile host depends on libs build target
-- add_dependencies( TensileHost TENSILE_LIBRARY_TARGET )
- else()
- # Create a unique name for Tensile compiled for rocBLAS
- set_target_properties( Tensile PROPERTIES OUTPUT_NAME rocblas-tensile CXX_EXTENSIONS NO )
-@@ -520,7 +517,6 @@ rocm_install_targets(
- if( BUILD_WITH_TENSILE )
- if( BUILD_WITH_TENSILE_HOST )
- set( ROCBLAS_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib" CACHE PATH "path to tensile library" )
-- install(DIRECTORY ${CMAKE_BINARY_DIR}/Tensile/library DESTINATION ${ROCBLAS_TENSILE_LIBRARY_DIR})
- endif()
- endif()
-
diff --git a/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild b/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild
index 13cf41fdd900..7c2a4366ee26 100644
--- a/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild
+++ b/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild
@@ -76,7 +76,6 @@ src_configure() {
addpredict /dev/random
export PATH="${EPREFIX}/usr/lib/llvm/roc/bin:${PATH}"
- export TENSILE_SKIP_LIBRARY=1
local mycmakeargs=(
-DTensile_LOGIC="asm_full"
@@ -130,7 +129,7 @@ src_test() {
addwrite /dev/kfd
addwrite /dev/dri/
cd "${BUILD_DIR}/clients/staging" || die
- ./rocblas-test || die "Tests failed"
+ LD_LIBRARY_PATH="${BUILD_DIR}/clients:${BUILD_DIR}/library/src" ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library" ./rocblas-test || die "Tests failed"
}
src_install() {
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2022-07-08 17:29 Benda XU
0 siblings, 0 replies; 8+ messages in thread
From: Benda XU @ 2022-07-08 17:29 UTC (permalink / raw
To: gentoo-commits
commit: 75f2ea4157fc3a52fa139b90db1890371dc3f6f7
Author: Yiyang Wu <xgreenlandforwyy <AT> gmail <DOT> com>
AuthorDate: Fri Jul 8 13:01:54 2022 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Fri Jul 8 17:28:31 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75f2ea41
sci-libs/rocBLAS: respect MAKEOPTS when build Tensile libs
Closes: https://github.com/gentoo/gentoo/pull/26285
Closes: https://bugs.gentoo.org/852236
Suggested-by: Alessandro Barbieri <lssndrbarbieri <AT> gmail.com>
Signed-off-by: Yiyang Wu <xgreenlandforwyy <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
.../files/rocBLAS-5.0.2-respect-makeopts.patch | 73 ++++++++++++++++++++++
...ocBLAS-5.0.2.ebuild => rocBLAS-5.0.2-r1.ebuild} | 6 +-
2 files changed, 77 insertions(+), 2 deletions(-)
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.0.2-respect-makeopts.patch b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-respect-makeopts.patch
new file mode 100644
index 000000000000..649a98106646
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.0.2-respect-makeopts.patch
@@ -0,0 +1,73 @@
+Only retain CMakeLists patch. We don't need install.sh, rmake.py
+Suggested-By: Alessandro Barbieri <lssndrbarbieri@gmail.com>
+================================================================
+From 0ffee0626bf987bae6b81183a5c61569a489537a Mon Sep 17 00:00:00 2001
+From: Torre Zuk <42548444+TorreZuk@users.noreply.github.com>
+Date: Thu, 4 Nov 2021 09:21:37 -0600
+Subject: [PATCH] Swdev 309014 add jobs arg (#953)
+
+* adds -j --jobs argment passing of cpu_threads for build
+---
+ CMakeLists.txt | 1 +
+ install.sh | 16 ++++++++++++----
+ library/src/CMakeLists.txt | 34 +++++++++++++++++++++++++---------
+ rmake.py | 29 ++++++++++++++++++-----------
+ 4 files changed, 56 insertions(+), 24 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 69cf8d586..40d88ea0a 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -244,6 +244,7 @@ if(NOT SKIP_LIBRARY)
+ set( Tensile_CODE_OBJECT_VERSION "V2" CACHE STRING "Tensile code_object_version")
+ set( Tensile_COMPILER "hipcc" CACHE STRING "Tensile compiler")
+ set( Tensile_LIBRARY_FORMAT "msgpack" CACHE STRING "Tensile library format")
++ set( Tensile_CPU_THREADS "" CACHE STRING "Number of threads for Tensile parallel build")
+
+ option( Tensile_MERGE_FILES "Tensile to merge kernels and solutions files?" ON )
+ option( Tensile_SHORT_FILENAMES "Tensile to use short file names? Use if compiler complains they're too long." OFF )
+diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt
+index 4f5e4572d..dedfe9794 100755
+--- a/library/src/CMakeLists.txt
++++ b/library/src/CMakeLists.txt
+@@ -58,15 +58,31 @@ if( BUILD_WITH_TENSILE )
+
+ # Add a build target for Tensile kernel library
+ # Runtime language is HIP by default
+- TensileCreateLibraryFiles(
+- "${CMAKE_CURRENT_SOURCE_DIR}/blas3/Tensile/Logic/${Tensile_LOGIC}"
+- "${PROJECT_BINARY_DIR}/Tensile"
+- ARCHITECTURE ${Tensile_ARCHITECTURE}
+- CODE_OBJECT_VERSION ${Tensile_CODE_OBJECT_VERSION}
+- COMPILER ${Tensile_COMPILER}
+- LIBRARY_FORMAT ${Tensile_LIBRARY_FORMAT}
+- ${Tensile_Options}
+- )
++ # warning our Tensile_ variables may shadow variable in TensileCreateLibraryFiles
++ # thus bypassing the function argument parameter system (mainly the options list) and CPU_THREADS
++ if(Tensile_CPU_THREADS MATCHES "^[0-9]+$")
++ # only including threads argument if number
++ TensileCreateLibraryFiles(
++ "${CMAKE_CURRENT_SOURCE_DIR}/blas3/Tensile/Logic/${Tensile_LOGIC}"
++ "${PROJECT_BINARY_DIR}/Tensile"
++ ARCHITECTURE ${Tensile_ARCHITECTURE}
++ CODE_OBJECT_VERSION ${Tensile_CODE_OBJECT_VERSION}
++ COMPILER ${Tensile_COMPILER}
++ LIBRARY_FORMAT ${Tensile_LIBRARY_FORMAT}
++ CPU_THREADS ${Tensile_CPU_THREADS}
++ ${Tensile_Options}
++ )
++ else()
++ TensileCreateLibraryFiles(
++ "${CMAKE_CURRENT_SOURCE_DIR}/blas3/Tensile/Logic/${Tensile_LOGIC}"
++ "${PROJECT_BINARY_DIR}/Tensile"
++ ARCHITECTURE ${Tensile_ARCHITECTURE}
++ CODE_OBJECT_VERSION ${Tensile_CODE_OBJECT_VERSION}
++ COMPILER ${Tensile_COMPILER}
++ LIBRARY_FORMAT ${Tensile_LIBRARY_FORMAT}
++ ${Tensile_Options}
++ )
++ endif()
+
+ # Create a unique name for TensileHost compiled for rocBLAS
+ set_target_properties( TensileHost PROPERTIES OUTPUT_NAME rocblas-tensile CXX_EXTENSIONS NO )
diff --git a/sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild b/sci-libs/rocBLAS/rocBLAS-5.0.2-r1.ebuild
similarity index 95%
rename from sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild
rename to sci-libs/rocBLAS/rocBLAS-5.0.2-r1.ebuild
index 0600f90bac37..42637150e674 100644
--- a/sci-libs/rocBLAS/rocBLAS-5.0.2.ebuild
+++ b/sci-libs/rocBLAS/rocBLAS-5.0.2-r1.ebuild
@@ -6,7 +6,7 @@ EAPI=8
DOCS_BUILDER="doxygen"
DOCS_DIR="docs"
DOCS_DEPEND="media-gfx/graphviz"
-inherit cmake docs prefix
+inherit cmake docs multiprocessing prefix
DESCRIPTION="AMD's library for BLAS on ROCm"
HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS"
@@ -22,7 +22,7 @@ RESTRICT="!test? ( test )"
BDEPEND="
dev-util/rocm-cmake:${SLOT}
- dev-util/Tensile:${SLOT}
+ >=dev-util/Tensile-${PV}-r1:${SLOT}
"
DEPEND="
@@ -44,6 +44,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-5.0.2-change-default-Tensile-library-dir.patch
"${FILESDIR}"/${PN}-5.0.2-cpp_lib_filesystem.patch
"${FILESDIR}"/${PN}-5.0.2-unbundle-Tensile.patch
+ "${FILESDIR}"/${PN}-5.0.2-respect-makeopts.patch
)
src_prepare() {
@@ -85,6 +86,7 @@ src_configure() {
-DBUILD_CLIENTS_SAMPLES=OFF
-DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
-DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
+ -DTensile_CPU_THREADS=$(makeopts_jobs)
${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
)
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2022-12-19 14:00 Andreas Sturmlechner
0 siblings, 0 replies; 8+ messages in thread
From: Andreas Sturmlechner @ 2022-12-19 14:00 UTC (permalink / raw
To: gentoo-commits
commit: 4a1a80febf086efb37f3dff5d714191f9e126476
Author: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 18 13:10:39 2022 +0000
Commit: Andreas Sturmlechner <asturm <AT> gentoo <DOT> org>
CommitDate: Mon Dec 19 14:00:04 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4a1a80fe
sci-libs/rocBLAS: drop 4.3.0, 4.3.0-r1
Signed-off-by: Andreas Sturmlechner <asturm <AT> gentoo.org>
sci-libs/rocBLAS/Manifest | 2 -
...-4.3.0-change-default-Tensile-library-dir.patch | 39 ------
.../files/rocBLAS-4.3.0-link-system-blas.patch | 24 ----
...BLAS-4.3.0-remove-problematic-test-suites.patch | 22 ----
.../files/rocBLAS-4.3.0-unbundle-Tensile.patch | 22 ----
sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild | 146 ---------------------
sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild | 140 --------------------
7 files changed, 395 deletions(-)
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest
index ca44e7ca5686..8e328c26a78e 100644
--- a/sci-libs/rocBLAS/Manifest
+++ b/sci-libs/rocBLAS/Manifest
@@ -1,5 +1,3 @@
DIST rocBLAS-5.0.2-Tensile-asm_full-navi22.tar.gz 1110323 BLAKE2B 80fab97c6f89fccf1f8829ad41baf15ad31bbbb313b48825841834c7ec1b9f8ece794aebdf9fda42b54a38f642beb1bc1e374f2f3b4e43d8ba9dfd1eb6e3ece5 SHA512 8f6946cf9d68afd195640ae7e0da8dc33341c67f28813813b5361a56531fa2af4453d075703ea52c66d93a1936cf74688b86aa2fa62b52a7ed5f03272290c232
-DIST rocm-Tensile-4.3.0.tar.gz 14250149 BLAKE2B 030138eaca2a0aadd96801e6dbd72e510716dd90553ef3795c5e04e00a34a05ecae82b24f755e4033a4acfcdb1cf26291da1e7902bb090f89a010d403e832beb SHA512 126db0b413c716fba8d5be9bff7a44fd1badacbf32f3db8d0db649819177db37ebd56fd22dd3c809655f5d29675be115e698cd10bc3d0b4b23878ae3726fce47
-DIST rocm-rocBLAS-4.3.0.tar.gz 11569970 BLAKE2B f11b0acf2bbd5737b036142d3b2cc1e18c38e088a8b7db58156d478dd6718befbb82bb7fd43a38fe64a5427124c5ad5241fa37977f094e6efd195d168d3e5f65 SHA512 490ab1c1e98a8b311ad5630515c448d9bb0a2bf588a08bcbebee345e2954d616b4ffe7c2e03dadca82c590438c42afccb98fe8ba00856aece101b5ffe62ef1e0
DIST rocm-rocBLAS-5.0.2.tar.gz 13295178 BLAKE2B e1abfa06b9ac1545732465857839dae3f3708af49439a306a2b5b1b1b392101c38c95815f2c05a0d9ed29d41b154bc2e16a4f9203a37f5e2f68ee12cc4b44a06 SHA512 2f4a74f49350ede0debcf32229a6b6b95505615723c3f2bee16e4c169a3bb966dfb1971819028f47c525f571bea5662b892e63f655b0d1d2b8f20746bc5fe770
DIST rocm-rocBLAS-5.1.3.tar.gz 13741546 BLAKE2B af10d8cb69bee44ef5aab2dc350e1d9f3b6fddb3a840c17230c4b55b2649a4724c9f2e58c1eafdb3e2716eea016a72a35c3ddb498881b1ce682d780baa8d8b07 SHA512 5ab71838fdd0e9c5848cbf28a19d113353b619a878d8c7d05f64feb32faae2054169c95ed6e9dd6b05a2e807b57229dd2c361c4d289b6e6f17c196558640890f
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-change-default-Tensile-library-dir.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-change-default-Tensile-library-dir.patch
deleted file mode 100644
index 1841424c6e56..000000000000
--- a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-change-default-Tensile-library-dir.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-change the default rocm tensile library search path
---- orig/library/src/tensile_host.cpp 2021-08-21 17:56:47.040481580 +0800
-+++ rocBLAS-rocm-4.3.0/library/src/tensile_host.cpp 2021-08-21 17:58:46.360482372 +0800
-@@ -489,34 +489,7 @@ namespace
- }
- else
- {
--#ifndef ROCBLAS_STATIC_LIB
-- Dl_info info;
--
-- // Find the location of librocblas.so
-- // Fall back on hard-coded path if static library or not found
-- // [Use a C API (rocblas_sccal) *not* defined in this file to
-- // avoid compile-time resolution of the function pointer; cf.
-- // https://man7.org/linux/man-pages/man3/dladdr.3.html "BUGS"]
--
-- if(dladdr((void*)rocblas_sscal, &info))
-- {
-- path = info.dli_fname;
-- path = std::string{dirname(&path[0])};
-- }
-- else
--#endif
-- {
-- path = "/opt/rocm/rocblas/lib";
-- }
--
-- // Find the location of the libraries
-- if(TestPath(path + "/../../Tensile/library"))
-- path += "/../../Tensile/library";
-- else
-- path += "/library";
--
-- if(TestPath(path + "/" + processor))
-- path += "/" + processor;
-+ path="@GENTOO_PORTAGE_EPREFIX@/usr/lib64/rocblas/library";
- }
-
- // only load modules for the current architecture
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-link-system-blas.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-link-system-blas.patch
deleted file mode 100644
index 184b76d7ef38..000000000000
--- a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-link-system-blas.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-Link system blas libraries rather than the downloaded libraries (in install.sh)
-
---- orig/clients/benchmarks/CMakeLists.txt
-+++ rocBLAS-rocm-4.2.0/clients/benchmarks/CMakeLists.txt
-@@ -49,7 +49,7 @@ target_include_directories( rocblas-benc
- $<BUILD_INTERFACE:${BLIS_INCLUDE_DIR}>
- )
-
--target_link_libraries( rocblas-bench PRIVATE rocblas_fortran_client roc::rocblas lapack cblas )
-+target_link_libraries( rocblas-bench PRIVATE rocblas_fortran_client roc::rocblas lapack cblas -lblas )
- if(LINK_BLIS)
- target_link_libraries( rocblas-bench PRIVATE ${BLIS_LIBRARY} )
- endif()
---- orig/clients/gtest/CMakeLists.txt
-+++ rocBLAS-rocm-4.2.0/clients/gtest/CMakeLists.txt
-@@ -129,7 +129,7 @@ target_include_directories( rocblas-test
- $<BUILD_INTERFACE:${BLIS_INCLUDE_DIR}>
- )
-
--target_link_libraries( rocblas-test PRIVATE rocblas_fortran_client roc::rocblas lapack cblas ${GTEST_LIBRARIES} )
-+target_link_libraries( rocblas-test PRIVATE rocblas_fortran_client roc::rocblas lapack cblas -lblas ${GTEST_LIBRARIES} )
- if(LINK_BLIS)
- target_link_libraries( rocblas-test PRIVATE ${BLIS_LIBRARY} )
- endif()
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-remove-problematic-test-suites.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-remove-problematic-test-suites.patch
deleted file mode 100644
index 4265e999f322..000000000000
--- a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-remove-problematic-test-suites.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-Those tests will fail comparing rocblas vs openblas, because the testing program is so strict that it cannot tolerate the numerical differences which is actually OK.
-
-https://github.com/ROCmSoftwarePlatform/rocBLAS/issues/1202
---- orig/clients/gtest/known_bugs.yaml
-+++ rocBLAS-rocm-4.3.0/clients/gtest/known_bugs.yaml
-@@ -7,6 +7,16 @@ Known bugs:
- - { function: gemm_ex, a_type: i8_r, b_type: i8_r, c_type: i32_r, d_type: i32_r, compute_type: i32_r, flags: 0, known_bug_platforms: "gfx900,gfx906,gfx1010,gfx1011,gfx1012,gfx1030" }
- - { function: gemm_batched_ex, a_type: i8_r, b_type: i8_r, c_type: i32_r, d_type: i32_r, compute_type: i32_r, flags: 0, known_bug_platforms: "gfx900,gfx906,gfx90a,gfx1010,gfx1011,gfx1012,gfx1030" }
- - { function: gemm_strided_batched_ex, a_type: i8_r, b_type: i8_r, c_type: i32_r, d_type: i32_r, compute_type: i32_r, flags: 0, known_bug_platforms: "gfx900,gfx906,gfx1010,gfx1011,gfx1012,gfx1030" }
-+# gemv openblas reference differences due to summation order dependent roundoff accumulation with large M float complex
-+# 8th significant digit difference vs CPU on single precision float math, leads to expected equality test failure
-+# code needs to be changed to a tolerance test or reduce M for float complex type if using equality vs. CPU reference
-+- { function: gemv, a_type: f32_c, transA: T, M: 131071 }
-+- { function: gemv, a_type: f32_c, transA: C, M: 131071 }
-+- { function: gemv_batched, a_type: f32_c, transA: T, M: 131071 }
-+- { function: gemv_batched, a_type: f32_c, transA: C, M: 131071 }
-+- { function: gemv_strided_batched, a_type: f32_c, transA: T, M: 131071 }
-+- { function: gemv_strided_batched, a_type: f32_c, transA: C, M: 131071 }
-+
-
- #- { function: gemm_ex, a_type: bf16_r, b_type: bf16_r, c_type: bf16_r, d_type: bf16_r, compute_type: f32_r, transA: C, transB: N, M: 512, N: 512, K: 512, lda: 512, ldb: 512, ldc: 512, ldd: 512, alpha: 5.0, alphai: 0.0, beta: 0.0, betai: 0.0, known_bug_platforms: gfx908 }
- #- { function: gemm_ex, a_type: bf16_r, b_type: bf16_r, c_type: bf16_r, d_type: bf16_r, compute_type: f32_r, transA: C, transB: N, M: 512, N: 512, K: 512, lda: 512, ldb: 512, ldc: 512, ldd: 512, alpha: 0.0, alphai: 0.0, beta: 3.0, betai: 0.0, known_bug_platforms: gfx908 }
diff --git a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch b/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch
deleted file mode 100644
index c8d99c851b00..000000000000
--- a/sci-libs/rocBLAS/files/rocBLAS-4.3.0-unbundle-Tensile.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/cmake/virtualenv.cmake b/cmake/virtualenv.cmake
-index 4c29c94..f9838c2 100644
---- a/cmake/virtualenv.cmake
-+++ b/cmake/virtualenv.cmake
-@@ -11,7 +11,7 @@ set(VIRTUALENV_HOME_DIR ${CMAKE_BINARY_DIR}/virtualenv CACHE PATH "Path to virtu
- function(virtualenv_create)
- message("${VIRTUALENV_PYTHON_EXE} -m venv ${VIRTUALENV_HOME_DIR} --system-site-packages --clear")
- execute_process(
-- COMMAND ${VIRTUALENV_PYTHON_EXE} -m venv ${VIRTUALENV_HOME_DIR} --system-site-packages --clear
-+ COMMAND true
- )
- endfunction()
-
-@@ -21,7 +21,7 @@ function(virtualenv_install)
- message("${VIRTUALENV_HOME_DIR}/bin/python -m pip install ${ARGN}")
- execute_process(
- RESULT_VARIABLE rc
-- COMMAND ${VIRTUALENV_HOME_DIR}/bin/python -m pip install ${ARGN}
-+ COMMAND true
- )
- if(rc)
- message(FATAL_ERROR ${rc})
diff --git a/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild b/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild
deleted file mode 100644
index 63704e613e53..000000000000
--- a/sci-libs/rocBLAS/rocBLAS-4.3.0-r1.ebuild
+++ /dev/null
@@ -1,146 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=8
-
-PYTHON_COMPAT=( python3_{8..10} )
-DOCS_BUILDER="doxygen"
-DOCS_DIR="docs"
-DOCS_DEPEND="media-gfx/graphviz"
-inherit cmake docs prefix python-any-r1
-
-DESCRIPTION="AMD's library for BLAS on ROCm"
-HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS"
-SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz"
-S="${WORKDIR}/${PN}-rocm-${PV}"
-
-LICENSE="BSD"
-KEYWORDS="~amd64"
-SLOT="0/$(ver_cut 1-2)"
-IUSE="benchmark test"
-RESTRICT="!test? ( test )"
-
-BDEPEND="${PYTHON_DEPS}
- dev-util/rocm-cmake:${SLOT}
- $(python_gen_any_dep '
- dev-util/Tensile[${PYTHON_USEDEP}]
- ')
- dev-util/Tensile:${SLOT}
-"
-
-DEPEND="
- dev-util/hip:${SLOT}
- dev-libs/msgpack
- test? (
- virtual/blas
- dev-cpp/gtest
- sys-libs/libomp
- )
- benchmark? (
- virtual/blas
- sys-libs/libomp
- )
-"
-
-PATCHES=(
- "${FILESDIR}"/${PN}-4.3.0-fix-glibc-2.32-and-above.patch
- "${FILESDIR}"/${PN}-4.3.0-change-default-Tensile-library-dir.patch
- "${FILESDIR}"/${PN}-4.3.0-link-system-blas.patch
- "${FILESDIR}"/${PN}-4.3.0-remove-problematic-test-suites.patch
- "${FILESDIR}"/${PN}-4.3.0-unbundle-Tensile.patch
-)
-
-python_check_deps() {
- python_has_version "dev-util/Tensile[${PYTHON_USEDEP}]"
-}
-
-src_prepare() {
- cmake_src_prepare
- # Fit for Gentoo FHS rule
- sed -e "/PREFIX rocblas/d" \
- -e "/<INSTALL_INTERFACE/s:include:include/rocblas:" \
- -e "s:rocblas/include:include/rocblas:" \
- -e "s:\\\\\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib:${EPREFIX}/usr/$(get_libdir)/rocblas:" \
- -e "s:share/doc/rocBLAS:share/doc/${P}:" \
- -e "/rocm_install_symlink_subdir( rocblas )/d" -i library/src/CMakeLists.txt || die
-
- sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die
-
- eprefixify library/src/tensile_host.cpp
-}
-
-src_configure() {
- # allow acces to hardware
- addpredict /dev/kfd
- addpredict /dev/dri/
- addpredict /dev/random
-
- export PATH="${EPREFIX}/usr/lib/llvm/roc/bin:${PATH}"
-
- local mycmakeargs=(
- -DTensile_LOGIC="asm_full"
- -DTensile_COMPILER="hipcc"
- -DTensile_LIBRARY_FORMAT="msgpack"
- -DTensile_CODE_OBJECT_VERSION="V3"
- -DTensile_TEST_LOCAL_PATH="${EPREFIX}/usr/share/Tensile"
- -DTensile_ROOT="${EPREFIX}/usr/share/Tensile"
- -DBUILD_WITH_TENSILE=ON
- -DBUILD_WITH_TENSILE_HOST=ON
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
- -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas"
- -DCMAKE_SKIP_RPATH=TRUE
- -DBUILD_TESTING=OFF
- -DBUILD_CLIENTS_SAMPLES=OFF
- -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
- -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
- ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
- )
-
- CXX="hipcc" cmake_src_configure
-
- # do not rerun cmake and the build process in src_install
- sed -e '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
-}
-
-src_compile() {
- docs_compile
- cmake_src_compile
-}
-
-check_rw_permission() {
- local cmd="[ -r $1 ] && [ -w $1 ]"
- local error=0 user
- if has sandbox ${FEATURES}; then
- user="portage"
- su portage -c "${cmd}" || error=1
- else
- user="$(whoami)"
- ${cmd} || error=1
- fi
- if [[ "${error}" == 1 ]]; then
- die "${user} do not have read and write permissions on $1! \n Make sure ${user} is in render group and check the permissions."
- fi
-}
-
-src_test() {
- # check permissions on /dev/kfd and /dev/dri/render*
- check_rw_permission /dev/kfd
- check_rw_permission /dev/dri/render*
- addwrite /dev/kfd
- addwrite /dev/dri/
- cd "${BUILD_DIR}/clients/staging" || die
- LD_LIBRARY_PATH="${BUILD_DIR}/clients:${BUILD_DIR}/library/src" ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library" ./rocblas-test || die "Tests failed"
-}
-
-src_install() {
- cmake_src_install
-
- if use benchmark; then
- cd "${BUILD_DIR}" || die
- dolib.so clients/librocblas_fortran_client.so
- dobin clients/staging/rocblas-bench
- fi
-
- # Don't install the License (it is installed into the wrong dir)
- rm "${ED}/usr/share/doc/${P}/LICENSE"* || die
-}
diff --git a/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild b/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild
deleted file mode 100644
index a32ba82060c7..000000000000
--- a/sci-libs/rocBLAS/rocBLAS-4.3.0.ebuild
+++ /dev/null
@@ -1,140 +0,0 @@
-# Copyright 1999-2022 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{6..9} )
-
-inherit cmake multiprocessing prefix python-any-r1
-
-DESCRIPTION="AMD's library for BLAS on ROCm"
-HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS"
-SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz
- https://github.com/ROCmSoftwarePlatform/Tensile/archive/rocm-${PV}.tar.gz -> rocm-Tensile-${PV}.tar.gz"
-
-LICENSE="BSD"
-KEYWORDS="~amd64"
-IUSE="benchmark test"
-SLOT="0/$(ver_cut 1-2)"
-
-BDEPEND="
- dev-util/rocm-cmake
- !dev-util/Tensile
- $(python_gen_any_dep '
- dev-python/msgpack[${PYTHON_USEDEP}]
- dev-python/pyyaml[${PYTHON_USEDEP}]
- ')
-"
-
-DEPEND="
- dev-util/hip:${SLOT}
- dev-libs/msgpack
- test? ( virtual/blas
- dev-cpp/gtest
- sys-libs/libomp )
- benchmark? ( virtual/blas
- sys-libs/libomp )
-"
-RESTRICT="!test? ( test )"
-
-python_check_deps() {
- python_has_version "dev-python/pyyaml[${PYTHON_USEDEP}]" &&
- python_has_version "dev-python/msgpack[${PYTHON_USEDEP}]"
-}
-
-S="${WORKDIR}"/${PN}-rocm-${PV}
-
-PATCHES=("${FILESDIR}"/${PN}-4.3.0-fix-glibc-2.32-and-above.patch
- "${FILESDIR}"/${PN}-4.3.0-change-default-Tensile-library-dir.patch
- "${FILESDIR}"/${PN}-4.3.0-link-system-blas.patch
- "${FILESDIR}"/${PN}-4.3.0-remove-problematic-test-suites.patch )
-
-src_prepare() {
- eapply_user
-
- pushd "${WORKDIR}"/Tensile-rocm-${PV} || die
- eapply "${FILESDIR}/Tensile-${PV}-hsaco-compile-specified-arch.patch" # backported from upstream, should remove after 4.3.0
- eapply "${FILESDIR}/Tensile-4.3.0-output-commands.patch"
- sed -e "/Number of parallel jobs to launch/s:default=-1:default=$(makeopts_jobs):" -i Tensile/TensileCreateLibrary.py || die
- popd || die
-
- # Fit for Gentoo FHS rule
- sed -e "/PREFIX rocblas/d" \
- -e "/<INSTALL_INTERFACE/s:include:include/rocblas:" \
- -e "s:rocblas/include:include/rocblas:" \
- -e "s:\\\\\${CPACK_PACKAGING_INSTALL_PREFIX}rocblas/lib:${EPREFIX}/usr/$(get_libdir)/rocblas:" \
- -e "s:share/doc/rocBLAS:share/doc/${P}:" \
- -e "/rocm_install_symlink_subdir( rocblas )/d" -i library/src/CMakeLists.txt || die
-
- # Use setup.py to install Tensile rather than pip
- sed -r -e "/pip install/s:([^ \"\(]*python) -m pip install ([^ \"\)]*):\1 setup.py install --single-version-externally-managed --root / WORKING_DIRECTORY \2:g" -i cmake/virtualenv.cmake
-
- sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die
-
- cmake_src_prepare
- eprefixify library/src/tensile_host.cpp
-}
-
-src_configure() {
- # allow acces to hardware
- addpredict /dev/kfd
- addpredict /dev/dri/
- addpredict /dev/random
-
- export PATH="${EPREFIX}/usr/lib/llvm/roc/bin:${PATH}"
-
- local mycmakeargs=(
- -DTensile_LOGIC="asm_full"
- -DTensile_COMPILER="hipcc"
- -DTensile_LIBRARY_FORMAT="msgpack"
- -DTensile_CODE_OBJECT_VERSION="V3"
- -DTensile_TEST_LOCAL_PATH="${WORKDIR}/Tensile-rocm-${PV}"
- -DBUILD_WITH_TENSILE=ON
- -DBUILD_WITH_TENSILE_HOST=ON
- -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr"
- -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas"
- -DCMAKE_SKIP_RPATH=TRUE
- -DBUILD_TESTING=OFF
- -DBUILD_CLIENTS_SAMPLES=OFF
- -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
- -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
- ${AMDGPU_TARGETS+-DAMDGPU_TARGETS="${AMDGPU_TARGETS}"}
- )
-
- CXX="hipcc" cmake_src_configure
-
- # do not rerun cmake and the build process in src_install
- sed -e '/RERUN/,+1d' -i "${BUILD_DIR}"/build.ninja || die
-}
-
-check_rw_permission() {
- cmd="[ -r $1 ] && [ -w $1 ]"
- errormsg="${user} do not have read and write permissions on $1! \n Make sure ${user} is in render group and check the permissions."
- if has sandbox ${FEATURES}; then
- user=portage
- su portage -c "${cmd}" || die ${errormsg}
- else
- user=`whoami`
- ${cmd} || die ${errormsg}
- fi
-}
-
-src_test() {
- # check permissions on /dev/kfd and /dev/dri/render*
- check_rw_permission /dev/kfd
- check_rw_permission /dev/dri/render*
- addwrite /dev/kfd
- addwrite /dev/dri/
- cd "${BUILD_DIR}/clients/staging" || die
- ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library" ./rocblas-test
-}
-
-src_install() {
- cmake_src_install
-
- if use benchmark; then
- cd "${BUILD_DIR}" || die
- dolib.so clients/librocblas_fortran_client.so
- dobin clients/staging/rocblas-bench
- fi
-}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2023-11-27 14:35 Benda XU
0 siblings, 0 replies; 8+ messages in thread
From: Benda XU @ 2023-11-27 14:35 UTC (permalink / raw
To: gentoo-commits
commit: 2a8d386c87c9df5554e2a54d2da18c1b66c66af8
Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Wed Oct 18 18:57:57 2023 +0000
Commit: Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Mon Nov 27 14:34:52 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2a8d386c
sci-libs/rocBLAS: add 5.7.1
Closes: https://bugs.gentoo.org/911816
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Benda Xu <heroxbd <AT> gentoo.org>
sci-libs/rocBLAS/Manifest | 1 +
.../rocBLAS-5.7.1-expand-isa-compatibility.patch | 132 +++++++++++++++++++++
sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild | 109 +++++++++++++++++
3 files changed, 242 insertions(+)
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest
index e067ceef0a6c..f17d3a47c686 100644
--- a/sci-libs/rocBLAS/Manifest
+++ b/sci-libs/rocBLAS/Manifest
@@ -2,3 +2,4 @@ DIST rocBLAS-5.0.2-Tensile-asm_full-navi22.tar.gz 1110323 BLAKE2B 80fab97c6f89fc
DIST rocBLAS-5.4.2-Tensile-asm_full-navi22.tar.gz 1057686 BLAKE2B aa755595bbcd48775713f1d94c18b9bfa6464cae97653dd5beda9e4ed600802b62c4159e6edef7fbd4c92e629bbda1c284e6c48e096c7eaf22bbaad86bdcdace SHA512 cdc928528e7ce5bcc3ae32ec18e3aee48533f24e77c1e42f6e0398858eefebd52b8812caabe01a0ef7fa552e00118b862e025f1675a9642b009f1e38efbcdd53
DIST rocm-rocBLAS-5.1.3.tar.gz 13741546 BLAKE2B af10d8cb69bee44ef5aab2dc350e1d9f3b6fddb3a840c17230c4b55b2649a4724c9f2e58c1eafdb3e2716eea016a72a35c3ddb498881b1ce682d780baa8d8b07 SHA512 5ab71838fdd0e9c5848cbf28a19d113353b619a878d8c7d05f64feb32faae2054169c95ed6e9dd6b05a2e807b57229dd2c361c4d289b6e6f17c196558640890f
DIST rocm-rocBLAS-5.4.2.tar.gz 15938434 BLAKE2B 14ebafa944fdac443800bb7f9b16f8ecf0f420b168d3c6534f68ad7d14bf058a4cc1673fce8f4b9be53e4a6c1cf05011e01853cd901bce0b59827d2aca4d029f SHA512 e62bb80457c1e89454885499bdce9d60beecd706806724418983c78c65c2ae303550f9670b5a6e71dae6a61c0e42b223ab01b36b8406430731ebcbff54c4a8f4
+DIST rocm-rocBLAS-5.7.1.tar.gz 55389700 BLAKE2B 9e58b1d29c8a04aa58ce17fdd9b0c2504934261851619dc5b696a04e8c6a79e7c44d86a6db7a9c76a434d76593de8c191cba6f163cf398d01cfc001e5fa32b5a SHA512 cfc73f6c490595a3c153c2ac2a3cb5926c48c2c19baa07ff3dcdf3a7ccaed82cfdff64ed5a3be64c349cb43d654d4b104d9090e2ec9f2061049d6a4921c07722
diff --git a/sci-libs/rocBLAS/files/rocBLAS-5.7.1-expand-isa-compatibility.patch b/sci-libs/rocBLAS/files/rocBLAS-5.7.1-expand-isa-compatibility.patch
new file mode 100644
index 000000000000..c5c5d4750393
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-5.7.1-expand-isa-compatibility.patch
@@ -0,0 +1,132 @@
+Allow rocBLAS to load the compatible kernels when running on
+architectures compatible with those ISAs.
+
+Based on patch from Cordell Bloor <cgmb@slerp.xyz>
+https://salsa.debian.org/rocm-team/rocblas/-/blob/master/debian/patches/0012-expand-isa-compatibility.patch
+
+--- a/library/src/handle.cpp
++++ b/library/src/handle.cpp
+@@ -21,6 +21,7 @@
+ * ************************************************************************ */
+ #include "handle.hpp"
+ #include <cstdarg>
++#include <cstring>
+ #include <limits>
+ #ifdef WIN32
+ #include <windows.h>
+@@ -77,6 +78,31 @@ static inline int getActiveArch(int deviceId)
+ {
+ hipDeviceProp_t deviceProperties;
+ hipGetDeviceProperties(&deviceProperties, deviceId);
++ // coerce to compatible arch
++ switch(deviceProperties.gcnArch)
++ {
++ case 902:
++ case 909:
++ case 912:
++ deviceProperties.gcnArch = 900;
++ std::strcpy(deviceProperties.gcnArchName, "gfx900");
++ break;
++ case 1011:
++ case 1012:
++ case 1013:
++ deviceProperties.gcnArch = 1010;
++ std::strcpy(deviceProperties.gcnArchName, "gfx1010");
++ break;
++ case 1031:
++ case 1032:
++ case 1033:
++ case 1034:
++ case 1035:
++ case 1036:
++ deviceProperties.gcnArch = 1030;
++ std::strcpy(deviceProperties.gcnArchName, "gfx1030");
++ break;
++ }
+ return deviceProperties.gcnArch;
+ }
+
+--- a/library/src/rocblas_auxiliary.cpp
++++ b/library/src/rocblas_auxiliary.cpp
+@@ -24,6 +24,7 @@
+ #include "logging.hpp"
+ #include "rocblas-auxiliary.h"
+ #include <cctype>
++#include <cstring>
+ #include <cstdlib>
+ #include <memory>
+ #include <string>
+@@ -1285,6 +1286,31 @@ std::string rocblas_internal_get_arch_name()
+ hipGetDevice(&deviceId);
+ hipDeviceProp_t deviceProperties;
+ hipGetDeviceProperties(&deviceProperties, deviceId);
++ // coerce to compatible arch
++ switch(deviceProperties.gcnArch)
++ {
++ case 902:
++ case 909:
++ case 912:
++ deviceProperties.gcnArch = 900;
++ std::strcpy(deviceProperties.gcnArchName, "gfx900");
++ break;
++ case 1011:
++ case 1012:
++ case 1013:
++ deviceProperties.gcnArch = 1010;
++ std::strcpy(deviceProperties.gcnArchName, "gfx1010");
++ break;
++ case 1031:
++ case 1032:
++ case 1033:
++ case 1034:
++ case 1035:
++ case 1036:
++ deviceProperties.gcnArch = 1030;
++ std::strcpy(deviceProperties.gcnArchName, "gfx1030");
++ break;
++ }
+ return ArchName<hipDeviceProp_t>{}(deviceProperties);
+ }
+
+--- a/library/src/tensile_host.cpp
++++ b/library/src/tensile_host.cpp
+@@ -45,6 +45,7 @@ extern "C" void rocblas_shutdown();
+ #include <Tensile/hip/HipUtils.hpp>
+ #include <atomic>
+ #include <complex>
++#include <cstring>
+ #include <exception>
+ #include <future>
+ #include <iomanip>
+@@ -837,6 +838,31 @@ namespace
+
+ hipDeviceProp_t prop;
+ HIP_CHECK_EXC(hipGetDeviceProperties(&prop, deviceId));
++ // coerce to compatible arch
++ switch(prop.gcnArch)
++ {
++ case 902:
++ case 909:
++ case 912:
++ prop.gcnArch = 900;
++ std::strcpy(prop.gcnArchName, "gfx900");
++ break;
++ case 1011:
++ case 1012:
++ case 1013:
++ prop.gcnArch = 1010;
++ std::strcpy(prop.gcnArchName, "gfx1010");
++ break;
++ case 1031:
++ case 1032:
++ case 1033:
++ case 1034:
++ case 1035:
++ case 1036:
++ prop.gcnArch = 1030;
++ std::strcpy(prop.gcnArchName, "gfx1030");
++ break;
++ }
+
+ m_deviceProp = std::make_shared<hipDeviceProp_t>(prop);
+
diff --git a/sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild b/sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild
new file mode 100644
index 000000000000..c3f12fff175e
--- /dev/null
+++ b/sci-libs/rocBLAS/rocBLAS-5.7.1-r1.ebuild
@@ -0,0 +1,109 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DOCS_BUILDER="doxygen"
+DOCS_DIR="docs"
+DOCS_DEPEND="media-gfx/graphviz"
+ROCM_VERSION=${PV}
+inherit cmake docs edo multiprocessing rocm
+
+DESCRIPTION="AMD's library for BLAS on ROCm"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz"
+S="${WORKDIR}/${PN}-rocm-${PV}"
+
+LICENSE="BSD"
+KEYWORDS="~amd64"
+SLOT="0/$(ver_cut 1-2)"
+IUSE="benchmark test"
+REQUIRED_USE="${ROCM_REQUIRED_USE}"
+
+RESTRICT="test" # Tests fail
+
+BDEPEND="
+ >=dev-util/rocm-cmake-5.3
+ dev-util/Tensile:${SLOT}
+ dev-python/joblib
+ test? ( dev-cpp/gtest )
+"
+
+DEPEND="
+ >=dev-cpp/msgpack-cxx-6.0.0
+ dev-util/hip
+ test? (
+ virtual/blas
+ dev-cpp/gtest
+ sys-libs/libomp
+ )
+ benchmark? (
+ virtual/blas
+ sys-libs/libomp
+ )
+"
+
+QA_FLAGS_IGNORED="/usr/lib64/rocblas/library/.*"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.4.2-cpp_lib_filesystem.patch
+ "${FILESDIR}"/${PN}-5.4.2-add-missing-header.patch
+ "${FILESDIR}"/${PN}-5.4.2-link-cblas.patch
+ "${FILESDIR}"/${PN}-5.7.1-expand-isa-compatibility.patch
+ )
+
+src_prepare() {
+ cmake_src_prepare
+ sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die
+}
+
+src_configure() {
+ addpredict /dev/random
+ addpredict /dev/kfd
+ addpredict /dev/dri/
+
+ local mycmakeargs=(
+ -DCMAKE_SKIP_RPATH=On
+ -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ -DROCM_SYMLINK_LIBS=OFF
+ -DAMDGPU_TARGETS="$(get_amdgpu_flags)"
+ -DTensile_LOGIC="asm_full"
+ -DTensile_COMPILER="hipcc"
+ -DTensile_LIBRARY_FORMAT="msgpack"
+ -DTensile_CODE_OBJECT_VERSION="default"
+ -DTensile_ROOT="${EPREFIX}/usr/share/Tensile"
+ -DBUILD_WITH_TENSILE=ON
+ -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas"
+ -DBUILD_CLIENTS_SAMPLES=OFF
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
+ -DTensile_TEST_LOCAL_PATH="${EPREFIX}/usr/share/Tensile"
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
+ -DTensile_CPU_THREADS=$(makeopts_jobs)
+ -DBUILD_WITH_PIP=OFF
+ )
+
+ CXX=hipcc cmake_src_configure
+}
+
+src_compile() {
+ docs_compile
+ cmake_src_compile
+}
+
+src_test() {
+ check_amdgpu
+ cd "${BUILD_DIR}"/clients/staging || die
+ export ROCBLAS_TEST_TIMEOUT=3600 ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library"
+ export LD_LIBRARY_PATH="${BUILD_DIR}/clients:${BUILD_DIR}/library/src"
+ edob ./${PN,,}-test
+}
+
+src_install() {
+ cmake_src_install
+
+ if use benchmark; then
+ cd "${BUILD_DIR}" || die
+ dolib.a clients/librocblas_fortran_client.a
+ dobin clients/staging/rocblas-bench
+ fi
+}
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/
@ 2024-06-26 9:21 Sam James
0 siblings, 0 replies; 8+ messages in thread
From: Sam James @ 2024-06-26 9:21 UTC (permalink / raw
To: gentoo-commits
commit: e41b4bb57f3cd8010b6cd0e52fe0fae8e646901b
Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com>
AuthorDate: Tue Mar 19 18:49:11 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jun 26 09:19:20 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e41b4bb5
sci-libs/rocBLAS: add 6.1.1
Changes:
* in updated expand-isa-compatibility patch do not coerce gfx1011 and gfx1012 to gfx1010, as Gentoo users can build rocBLAS for gfx1011 and gfx1012 with USE flags
* add myself to maintainers
Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>
sci-libs/rocBLAS/Manifest | 1 +
.../rocBLAS-6.0.2-expand-isa-compatibility.patch | 96 ++++++++++++++++++
sci-libs/rocBLAS/metadata.xml | 4 +
sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild | 111 +++++++++++++++++++++
4 files changed, 212 insertions(+)
diff --git a/sci-libs/rocBLAS/Manifest b/sci-libs/rocBLAS/Manifest
index f17d3a47c686..ca306e9c9efb 100644
--- a/sci-libs/rocBLAS/Manifest
+++ b/sci-libs/rocBLAS/Manifest
@@ -3,3 +3,4 @@ DIST rocBLAS-5.4.2-Tensile-asm_full-navi22.tar.gz 1057686 BLAKE2B aa755595bbcd48
DIST rocm-rocBLAS-5.1.3.tar.gz 13741546 BLAKE2B af10d8cb69bee44ef5aab2dc350e1d9f3b6fddb3a840c17230c4b55b2649a4724c9f2e58c1eafdb3e2716eea016a72a35c3ddb498881b1ce682d780baa8d8b07 SHA512 5ab71838fdd0e9c5848cbf28a19d113353b619a878d8c7d05f64feb32faae2054169c95ed6e9dd6b05a2e807b57229dd2c361c4d289b6e6f17c196558640890f
DIST rocm-rocBLAS-5.4.2.tar.gz 15938434 BLAKE2B 14ebafa944fdac443800bb7f9b16f8ecf0f420b168d3c6534f68ad7d14bf058a4cc1673fce8f4b9be53e4a6c1cf05011e01853cd901bce0b59827d2aca4d029f SHA512 e62bb80457c1e89454885499bdce9d60beecd706806724418983c78c65c2ae303550f9670b5a6e71dae6a61c0e42b223ab01b36b8406430731ebcbff54c4a8f4
DIST rocm-rocBLAS-5.7.1.tar.gz 55389700 BLAKE2B 9e58b1d29c8a04aa58ce17fdd9b0c2504934261851619dc5b696a04e8c6a79e7c44d86a6db7a9c76a434d76593de8c191cba6f163cf398d01cfc001e5fa32b5a SHA512 cfc73f6c490595a3c153c2ac2a3cb5926c48c2c19baa07ff3dcdf3a7ccaed82cfdff64ed5a3be64c349cb43d654d4b104d9090e2ec9f2061049d6a4921c07722
+DIST rocm-rocBLAS-6.1.1.tar.gz 100103895 BLAKE2B df89a21e47730714b80c62717a86d65ac0d819c2d33b2a3c6252b60b8d7cc9eb5f8f1db27159b0a8dfc87aba7ccad97e2f832bc0044e92d0b69c526d382c745a SHA512 74e847c4ddee16cae7f41e268a815ea03875519c365abe7dfce313a9545df245baa73301b432f64a36cc988281fec7530629a0d72583e9ea287c98ec8a0b3907
diff --git a/sci-libs/rocBLAS/files/rocBLAS-6.0.2-expand-isa-compatibility.patch b/sci-libs/rocBLAS/files/rocBLAS-6.0.2-expand-isa-compatibility.patch
new file mode 100644
index 000000000000..ca895c4b4ff5
--- /dev/null
+++ b/sci-libs/rocBLAS/files/rocBLAS-6.0.2-expand-isa-compatibility.patch
@@ -0,0 +1,96 @@
+--- a/library/src/handle.cpp
++++ b/library/src/handle.cpp
+@@ -21,6 +21,7 @@
+ * ************************************************************************ */
+ #include "handle.hpp"
+ #include <cstdarg>
++#include <cstring>
+ #include <limits>
+ #ifdef WIN32
+ #include <windows.h>
+@@ -80,6 +81,20 @@ static Processor getActiveArch(int deviceId)
+ // strip out xnack/ecc from name
+ std::string deviceFullString(deviceProperties.gcnArchName);
+ std::string deviceString = deviceFullString.substr(0, deviceFullString.find(":"));
++ // coerce to compatible arch
++ int gcnArch = deviceString.substr(0, 3) == "gfx" ? std::stoi(deviceString.substr(3)) : 0;
++ switch(gcnArch)
++ {
++ case 902: case 909: case 912:
++ std::strcpy(deviceProperties.gcnArchName, "gfx900");
++ break;
++ case 1013:
++ std::strcpy(deviceProperties.gcnArchName, "gfx1010");
++ break;
++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036:
++ std::strcpy(deviceProperties.gcnArchName, "gfx1030");
++ break;
++ }
+
+ if(deviceString.find("gfx803") != std::string::npos)
+ {
+--- a/library/src/rocblas_auxiliary.cpp
++++ b/library/src/rocblas_auxiliary.cpp
+@@ -24,6 +24,7 @@
+ #include "logging.hpp"
+ #include "rocblas-auxiliary.h"
+ #include <cctype>
++#include <cstring>
+ #include <cstdlib>
+ #include <memory>
+ #include <string>
+@@ -1242,6 +1243,20 @@ std::string rocblas_internal_get_arch_name()
+ hipGetDevice(&deviceId);
+ hipDeviceProp_t deviceProperties;
+ hipGetDeviceProperties(&deviceProperties, deviceId);
++ // coerce to compatible arch
++ int gcnArch = strncmp(deviceProperties.gcnArchName, "gfx", 3) == 0 ? std::stoi(deviceProperties.gcnArchName + 3) : 0;
++ switch(gcnArch)
++ {
++ case 902: case 909: case 912:
++ std::strcpy(deviceProperties.gcnArchName, "gfx900");
++ break;
++ case 1013:
++ std::strcpy(deviceProperties.gcnArchName, "gfx1010");
++ break;
++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036:
++ std::strcpy(deviceProperties.gcnArchName, "gfx1030");
++ break;
++ }
+ return ArchName<hipDeviceProp_t>{}(deviceProperties);
+ }
+
+--- a/library/src/tensile_host.cpp
++++ b/library/src/tensile_host.cpp
+@@ -45,6 +45,7 @@ extern "C" void rocblas_shutdown();
+ #include <Tensile/hip/HipUtils.hpp>
+ #include <atomic>
+ #include <complex>
++#include <cstring>
+ #include <exception>
+ #include <future>
+ #include <iomanip>
+@@ -802,6 +803,23 @@ namespace
+ std::string deviceFullString(prop.gcnArchName);
+ std::string deviceString
+ = deviceFullString.substr(0, deviceFullString.find(":"));
++ // coerce to compatible arch
++ int gcnArch = deviceString.substr(0, 3) == "gfx" ? std::stoi(deviceString.substr(3)) : 0;
++ switch(gcnArch)
++ {
++ case 902: case 909: case 912:
++ std::strcpy(prop.gcnArchName, "gfx900");
++ deviceString = prop.gcnArchName;
++ break;
++ case 1013:
++ std::strcpy(prop.gcnArchName, "gfx1010");
++ deviceString = prop.gcnArchName;
++ break;
++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036:
++ std::strcpy(prop.gcnArchName, "gfx1030");
++ deviceString = prop.gcnArchName;
++ break;
++ }
+ m_devicePropMap[deviceString] = std::make_shared<hipDeviceProp_t>(prop);
+ }
+ }
diff --git a/sci-libs/rocBLAS/metadata.xml b/sci-libs/rocBLAS/metadata.xml
index 066f5c749e3f..0e8f76b2a76e 100644
--- a/sci-libs/rocBLAS/metadata.xml
+++ b/sci-libs/rocBLAS/metadata.xml
@@ -12,6 +12,10 @@
<email>xgreenlandforwyy@gmail.com</email>
<name>Yiyang Wu</name>
</maintainer>
+ <maintainer type="person">
+ <email>lockalsash@gmail.com</email>
+ <name>Sv. Lockal</name>
+ </maintainer>
<use>
<flag name="test">Perform rocblas-test to compare the result between rocBLAS and system BLAS.</flag>
<flag name="benchmark">Build and install rocblas-bench.</flag>
diff --git a/sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild b/sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild
new file mode 100644
index 000000000000..fed17e82b14e
--- /dev/null
+++ b/sci-libs/rocBLAS/rocBLAS-6.1.1.ebuild
@@ -0,0 +1,111 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DOCS_BUILDER="doxygen"
+DOCS_DIR="docs/.doxygen"
+DOCS_DEPEND="media-gfx/graphviz"
+ROCM_VERSION=${PV}
+inherit cmake docs edo multiprocessing rocm
+
+DESCRIPTION="AMD's library for BLAS on ROCm"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/rocBLAS"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/rocBLAS/archive/rocm-${PV}.tar.gz -> rocm-${P}.tar.gz"
+S="${WORKDIR}/${PN}-rocm-${PV}"
+
+LICENSE="BSD"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+IUSE="benchmark test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="${ROCM_REQUIRED_USE}"
+
+BDEPEND="
+ >=dev-build/rocm-cmake-5.3
+ dev-util/Tensile:${SLOT}
+ dev-python/joblib
+ test? ( dev-cpp/gtest )
+"
+
+DEPEND="
+ >=dev-cpp/msgpack-cxx-6.0.0
+ =dev-util/hip-6*
+ test? (
+ virtual/blas
+ dev-cpp/gtest
+ sys-libs/libomp
+ )
+ benchmark? (
+ virtual/blas
+ sys-libs/libomp
+ )
+"
+
+QA_FLAGS_IGNORED="/usr/lib64/rocblas/library/.*"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-5.4.2-cpp_lib_filesystem.patch
+ "${FILESDIR}"/${PN}-5.4.2-add-missing-header.patch
+ "${FILESDIR}"/${PN}-5.4.2-link-cblas.patch
+ "${FILESDIR}"/${PN}-6.0.2-expand-isa-compatibility.patch
+ )
+
+src_prepare() {
+ cmake_src_prepare
+ sed -e "s:,-rpath=.*\":\":" -i clients/CMakeLists.txt || die
+}
+
+src_configure() {
+ addpredict /dev/random
+ addpredict /dev/kfd
+ addpredict /dev/dri/
+
+ local mycmakeargs=(
+ -DCMAKE_SKIP_RPATH=ON
+ -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF
+ -DROCM_SYMLINK_LIBS=OFF
+ -DAMDGPU_TARGETS="$(get_amdgpu_flags)"
+ -DTensile_LOGIC="asm_full"
+ -DTensile_COMPILER="hipcc"
+ -DTensile_LIBRARY_FORMAT="msgpack"
+ -DTensile_CODE_OBJECT_VERSION="default"
+ -DTensile_ROOT="${EPREFIX}/usr/share/Tensile"
+ -DBUILD_WITH_TENSILE=ON
+ -DCMAKE_INSTALL_INCLUDEDIR="include/rocblas"
+ -DBUILD_CLIENTS_SAMPLES=OFF
+ -DBUILD_CLIENTS_TESTS=$(usex test ON OFF)
+ -DBUILD_CLIENTS_BENCHMARKS=$(usex benchmark ON OFF)
+ -DTensile_CPU_THREADS=$(makeopts_jobs)
+ -DBUILD_WITH_PIP=OFF
+ )
+
+ CXX=hipcc cmake_src_configure
+}
+
+src_compile() {
+ docs_compile
+ cmake_src_compile
+}
+
+src_test() {
+ check_amdgpu
+ cd "${BUILD_DIR}"/clients/staging || die
+ export ROCBLAS_TEST_TIMEOUT=3600 ROCBLAS_TENSILE_LIBPATH="${BUILD_DIR}/Tensile/library"
+ export LD_LIBRARY_PATH="${BUILD_DIR}/clients:${BUILD_DIR}/library/src"
+ edob ./${PN,,}-test
+}
+
+src_install() {
+ cmake_src_install
+
+ if use benchmark; then
+ cd "${BUILD_DIR}" || die
+ dolib.a clients/librocblas_fortran_client.a
+ dobin clients/staging/rocblas-bench
+ fi
+
+ # Stop llvm-strip from removing .strtab section from *.hsaco files,
+ # otherwise rocclr/elf/elf.cpp complains with "failed: null sections(STRTAB)" and crashes
+ dostrip -x /usr/$(get_libdir)/rocblas/library/
+}
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2024-06-26 9:21 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-27 11:53 [gentoo-commits] repo/gentoo:master commit in: sci-libs/rocBLAS/, sci-libs/rocBLAS/files/ Benda XU
-- strict thread matches above, loose matches on Subject: below --
2022-03-05 20:51 Andrew Ammerlaan
2022-03-05 20:51 Andrew Ammerlaan
2022-03-20 7:33 Benda XU
2022-07-08 17:29 Benda XU
2022-12-19 14:00 Andreas Sturmlechner
2023-11-27 14:35 Benda XU
2024-06-26 9:21 Sam James
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox