summaryrefslogtreecommitdiff
path: root/dev-util/Tensile
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/Tensile')
-rw-r--r--dev-util/Tensile/Manifest2
-rw-r--r--dev-util/Tensile/Tensile-6.1.1-r1.ebuild140
-rw-r--r--dev-util/Tensile/files/Tensile-6.1.1-ignore-asm-cap.patch11
3 files changed, 153 insertions, 0 deletions
diff --git a/dev-util/Tensile/Manifest b/dev-util/Tensile/Manifest
index 93c7415075a1..4c992c2463ce 100644
--- a/dev-util/Tensile/Manifest
+++ b/dev-util/Tensile/Manifest
@@ -12,6 +12,7 @@ AUX Tensile-5.7.1-fix-msgpack-dependency.patch 1069 BLAKE2B 888447b0e8d3b2314c10
AUX Tensile-5.7.1-gentoopath.patch 2284 BLAKE2B 36f55d7eefe595395c108671d55a07cb8bd4d8d8c21944edb53465e32076d99cd23c38709993408694d54022c2e9362dd2c1943423b99e4829d2d5a663c1aec7 SHA512 5f5f96ce2ffa7b9e18a2ad82ebaa419537586356602de0feddf5884de3ecbf358d19cc2f59f2c6d883e18de9c029a901143d98ed2c48bb70fee3d7d8501f622e
AUX Tensile-6.0.2-expand-isa-compatibility.patch 1355 BLAKE2B daf73107efc31a4585c44627de3d2de8f6ba390da1ea47aea0f87613e11ca0c6332b2e8b9935d67c1c10b80bb373c33eff3d4d73f33500d7eea2c00a7bb02c86 SHA512 5e624082eac08f940cb01d4c33664c34eb0d79ec6a66ffe82700c6e4edc931c95ed5e990d2cfbfa66497c35a85a63620c06ad0dd3202476211bf723327b52545
AUX Tensile-6.1.1-fix-msgpack-dependency.patch 1221 BLAKE2B 8b3b1f2b94f0a5dfb5e4f4e973410a536c2d3bb306b7d0669fdf2d47d85ce54e2f34eb009843b99234f8bfdd42f20eb940c52db23a8099169d949bb4e3decf1b SHA512 02ca22defae159f13da6e717a94e2708c476012ed370ab46df54f529ae31079b5700afeed7b68a0f63a1d763edfb9ea2898b4ccc98de4fcf540e161aa06c3fbf
+AUX Tensile-6.1.1-ignore-asm-cap.patch 636 BLAKE2B 77421fa2ca2f3ecb088b7510375a705d8de1235fc98d9b6cc493feda8c3f24537cf5c80d9b91f7357f63d3d2b763e6ab53530068c41d6353d782cc76247b0039 SHA512 00869f06e1038b5d930cf452bce8c23d8a2089d3e70b50caf7682c5296b91f11c6b2a5d0758f8006723a6a0ac782f59f24b4aeab1ffbf922976a28dbca50fa93
AUX Tensile-change-cmake-name-for-msgpack-cxx-6-release.patch 422 BLAKE2B 791a8041667c29f2cd06d036e6f54530fc88ac4afff9bd2f3f5dd6ab3a6daa6b52ba7459c156e12dae02bd918f740d1e1d22bd6bc7e26bd14269a5ffd877aa13 SHA512 a738be31fd735bf3d8ff17d844771e6113f9868c1d73f1eecd75e1ecfb5d04c743c9463a1e599712b9bc0d7877d8d90fa38fbc7a266add8b61e7fb575693eb4f
DIST Tensile-5.0.2-PR1419.patch.gz 43754 BLAKE2B 3b1d7333ed0115f77816806e7735e25d897dbae3f7a40ece61d655c8f016d9d1c804b586b4e0e75661e20c517f5937a61d5ead25a545f0ce2e4a178bcbb3e7be SHA512 0154d8e14d335f4ecd86e5db335289f8662cede7e5d4b93bf6c56d8e48c1d7d0457271c078c9abbbca1f4aa91f028f6ce6a89efb783ba0207d0f39fd5de8a42c
DIST rocm-Tensile-5.1.3.tar.gz 14357517 BLAKE2B 7c5881cc2b1d25db39f54a99f9f0a08395a5f7a58deebe74d9868e8f7044db5ae2f3907196adf16dc6abeba0f1f47f5cce5c8900891276daff8e4ad614cf3b94 SHA512 4405cb6de65c1da1fd93910fc901402a24e996ff04eccadf483c25d8eb518e03ea9bbf00e372dd5fe377696e71c39355603095f3c5fc1e26d311ed15d8e3b734
@@ -21,5 +22,6 @@ DIST rocm-Tensile-6.1.1.tar.gz 12675289 BLAKE2B dfe3698d7dda14d5b20a6fe1ef6535ac
EBUILD Tensile-5.1.3-r3.ebuild 2811 BLAKE2B 77f941574f7586da7f8122c126ede4288004ca1a31860e12bdb22d340c7e9b017871bc362e698f8b797c3699965babd332742ff2832314aeef96324ea06142c6 SHA512 0275dfcec4c5b417444a5ebbff9eb1e896db69ca735ff082aa863e1aa6da12ea4b227d59d8794bf1d512d6a965d9ce1768418db830c2f27a3baf528f3f60b687
EBUILD Tensile-5.4.2-r2.ebuild 3348 BLAKE2B e92698536854d4157a2b408b781cdec49e0c9caedacca8ee5902d976867ec8712d721adacb9973178cffe96de4d5de44cbcf70bb58494958663e9dc4c101452e SHA512 985b6dbac41eeae088247a11adb387043afff952ea7f1e87a24eb94f81f18970ad9360bbf0a683bee26234afaf698da108e75a39eeda7ccb386ec9607c0359a8
EBUILD Tensile-5.7.1-r2.ebuild 3534 BLAKE2B eb31593d71f596d1f2c23f453fba30e8c723da3095291e46e3290e47e044e510cf57235b0b9ddafe79189b59efd1df928f2f8a7f6cc535865170740b91b94f74 SHA512 d576777ac8e31dfc7930efa2e9b16dca9c9eeca921b92cf299f8c42ab10c41463c88f6b928659b0e4056fda38e7aa5daccec3ab1996b30dbe997ee693391f79a
+EBUILD Tensile-6.1.1-r1.ebuild 3609 BLAKE2B a9d97e445441d3b64e8310b1fd104e8f55d0c9e27d41a1c3f02ea02f4f03835c8b394909eb6139fab06273ed1d0ce055a7ea1d8c356bc65ba41fa57e53201518 SHA512 93624bab219a5a93fd65100d3ff358959a3a39f3d248826b99afce707ed6d332539c45f5188f4cbf4d1b7734bc23afb7ac0de565bca0927583f31ca253c8e7f3
EBUILD Tensile-6.1.1.ebuild 3561 BLAKE2B fcdad2de9653d8c1e0a8ddb68b5decd243c95a4baf3ed248bba5ca4d58a87dbd31d754a1121ac3780596dda9cac5667f45ae15613019752a81f8a6b041d8e73d SHA512 6d055e210890fc44e389b82bbcdb361e7424b62d6855420345e1179fa37138d62fb03e1b8a878aeba676f90ae71b1894c4bf52fb34c5da0b4a9be37820b1df25
MISC metadata.xml 478 BLAKE2B 4931f453630761d3272371d09065c23cd9fea6e9a80f3b78a07e672e5d2e891c2ad7661883e1cb1f41e89fb2cd725a7189937c7b3cc7fc39b23ef0caaf0b3ce7 SHA512 d57284ff50913d95f092a5b8e4e566d0d6668b56afadfeb2e7003f2af6ed2106f14df82be880b2ea71dec29b614c5cb286a085098fbe8eed16e8bd3588149be6
diff --git a/dev-util/Tensile/Tensile-6.1.1-r1.ebuild b/dev-util/Tensile/Tensile-6.1.1-r1.ebuild
new file mode 100644
index 000000000000..f10408b60b93
--- /dev/null
+++ b/dev-util/Tensile/Tensile-6.1.1-r1.ebuild
@@ -0,0 +1,140 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{10..12} )
+DISTUTILS_USE_PEP517=setuptools
+ROCM_VERSION=${PV}
+LLVM_COMPAT=( 18 )
+
+inherit cmake distutils-r1 llvm-r1 prefix rocm
+
+DESCRIPTION="Stretching GPU performance for GEMMs and tensor contractions"
+HOMEPAGE="https://github.com/ROCmSoftwarePlatform/Tensile"
+SRC_URI="https://github.com/ROCmSoftwarePlatform/Tensile/archive/rocm-${PV}.tar.gz -> rocm-Tensile-${PV}.tar.gz"
+S="${WORKDIR}/${PN}-rocm-${PV}"
+
+LICENSE="MIT"
+SLOT="0/$(ver_cut 1-2)"
+KEYWORDS="~amd64"
+IUSE="client test"
+REQUIRED_USE="client? ( ${ROCM_REQUIRED_USE} )"
+
+RESTRICT="!test? ( test )"
+
+RDEPEND="${PYTHON_DEPS}
+ client? ( dev-libs/boost )
+ >=dev-cpp/msgpack-cxx-6.0.0
+ dev-python/pyyaml[${PYTHON_USEDEP}]
+ dev-python/msgpack[${PYTHON_USEDEP}]
+ dev-python/joblib[${PYTHON_USEDEP}]
+ =dev-util/hip-6*
+ >=dev-util/rocm-smi-4.3.0
+ $(llvm_gen_dep '
+ sys-devel/clang:${LLVM_SLOT}
+ ')
+"
+DEPEND="${RDEPEND}"
+BDEPEND="
+ test? (
+ dev-python/pytest-forked[${PYTHON_USEDEP}]
+ dev-python/pytest-xdist[${PYTHON_USEDEP}]
+ dev-python/filelock[${PYTHON_USEDEP}]
+ dev-python/joblib[${PYTHON_USEDEP}]
+ )
+"
+
+distutils_enable_tests pytest
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-4.3.0-output-commands.patch
+ "${FILESDIR}"/${PN}-5.4.2-fix-arch-parse.patch
+ "${FILESDIR}"/${PN}-5.4.2-use-ninja.patch
+ "${FILESDIR}"/${PN}-6.1.1-fix-msgpack-dependency.patch
+ "${FILESDIR}"/${PN}-6.0.2-expand-isa-compatibility.patch
+ "${FILESDIR}"/${PN}-6.1.1-ignore-asm-cap.patch
+)
+
+CMAKE_USE_DIR="${S}/${PN}/Source"
+
+src_prepare() {
+ distutils-r1_src_prepare
+ sed -e "s,\@LLVM_PATH\@,$(get_llvm_prefix),g" \
+ "${FILESDIR}"/${PN}-5.7.1-gentoopath.patch > "${S}"/gentoopath.patch || die
+ eapply $(prefixify_ro "${S}"/gentoopath.patch)
+
+ pushd ${PN} || die
+
+ sed -e "/ROCM_SMI_ROOT/s,lib,$(get_libdir)," \
+ -i Source/cmake/FindROCmSMI.cmake || die
+ sed -r -e "/TENSILE_USE_LLVM/s/ON/OFF/" \
+ -i Source/CMakeLists.txt || die
+
+ # ${Tensile_ROOT}/bin does not exists; call command directly
+ sed -e "s,\${Tensile_ROOT}/bin/,,g" -i cmake/TensileConfig.cmake || die
+
+ local Tensile_share_dir="\"${EPREFIX}/usr/share/${PN}\""
+ sed -e "/HipClangVersion/s/0.0.0/$(hipconfig -v)/" -i Common.py || die
+
+ sed -e "s,os.path.dirname(os.path.realpath(__file__)),${Tensile_share_dir},g" \
+ -i ReplacementKernels.py Common.py ${PN}.py || die
+
+ sed -e "s|os\.path\.dirname.*$|\"${EPREFIX}/usr/share/Tensile/Source\", end='')|" -i __init__.py || die
+
+ popd || die
+
+ sed -e "/package_data/d" -e "/data_files/d" -i setup.py || die
+ use client && PATCHES= cmake_src_prepare # do not apply patches again in cmake_src_prepare
+}
+
+src_configure() {
+ rocm_use_hipcc
+
+ distutils-r1_src_configure
+ if use client; then
+ local mycmakeargs=(
+ -DCMAKE_SKIP_RPATH=ON
+ -DTENSILE_USE_MSGPACK=ON
+ -DTENSILE_USE_LLVM=ON
+ -DTensile_LIBRARY_FORMAT=msgpack
+ -DAMDGPU_TARGETS="$(get_amdgpu_flags)"
+ )
+ cmake_src_configure
+ fi
+}
+
+src_compile() {
+ distutils-r1_src_compile
+ use client && cmake_src_compile
+}
+
+python_install() {
+ distutils-r1_python_install
+
+ python_moduleinto Tensile
+ pushd Tensile || die
+ python_domodule Components
+ python_newexe Utilities/merge.py ${PN}-merge
+}
+
+src_install() {
+ distutils-r1_src_install
+
+ pushd ${PN} || die
+ insinto /usr/share/${PN}
+ doins -r Configs Perf Source CustomKernels
+ insinto /usr/$(get_libdir)/cmake/${PN}
+ doins cmake/*.cmake
+
+ if use client; then
+ pushd "${BUILD_DIR}" || die
+ dobin client/tensile_client
+ fi
+}
+
+# Test suite fails to start without this
+python_test() {
+ export ROCM_PATH="${EPREFIX}/usr"
+ epytest
+}
diff --git a/dev-util/Tensile/files/Tensile-6.1.1-ignore-asm-cap.patch b/dev-util/Tensile/files/Tensile-6.1.1-ignore-asm-cap.patch
new file mode 100644
index 000000000000..b0ad3b276fba
--- /dev/null
+++ b/dev-util/Tensile/files/Tensile-6.1.1-ignore-asm-cap.patch
@@ -0,0 +1,11 @@
+--- a/Tensile/Common.py 2024-11-09 20:38:11.186998794 -0000
++++ b/Tensile/Common.py 2024-11-09 20:43:18.524804845 -0000
+@@ -2030,7 +2030,7 @@
+ if len(compilerVer) >= 2:
+ ignoreCacheCheck = ignoreCacheCheck or \
+ compilerVer[0] < 5 or \
+- (compilerVer[0] == 5 and compilerVer[1] <= 2)
++ (compilerVer[0] == 6 and compilerVer[1] <= 1)
+
+ if not derivedAsmCaps["SupportedISA"] and CACHED_ASM_CAPS[isaVersion]["SupportedISA"]:
+ printWarning("Architecture {} not supported by ROCm {}".format(isaVersion, globalParameters['HipClangVersion']))