diff options
Diffstat (limited to 'dev-util/Tensile')
-rw-r--r-- | dev-util/Tensile/Manifest | 6 | ||||
-rw-r--r-- | dev-util/Tensile/Tensile-5.7.1-r2.ebuild | 1 | ||||
-rw-r--r-- | dev-util/Tensile/Tensile-6.1.1.ebuild | 137 | ||||
-rw-r--r-- | dev-util/Tensile/files/Tensile-6.0.2-expand-isa-compatibility.patch | 34 | ||||
-rw-r--r-- | dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch | 31 |
5 files changed, 208 insertions, 1 deletions
diff --git a/dev-util/Tensile/Manifest b/dev-util/Tensile/Manifest index 1c4c02b31a58..43b80f0a5ba4 100644 --- a/dev-util/Tensile/Manifest +++ b/dev-util/Tensile/Manifest @@ -10,12 +10,16 @@ AUX Tensile-5.4.2-use-ninja.patch 1164 BLAKE2B 41d6dbb68fa41b53d230afd06af95acb0 AUX Tensile-5.7.1-expand-isa-compatibility.patch 1632 BLAKE2B 807df38c99852b58801cb84bccf8cdd28b5575a460130e4463b483fb875f7adfb1d7902a47ca7e9f8735285bfaf3aa1a422595e57ec616faf2af423892301384 SHA512 3cf82928780532d32dfd0680a0ea8d8b990055186795ddc6d93a85941eeb9f0968979fe33fc4155f79413c54b8809d52eb3327624d51c187bfb8cd8bfef66bd4 AUX Tensile-5.7.1-fix-msgpack-dependency.patch 1069 BLAKE2B 888447b0e8d3b2314c104b7cbf85fecc7645e681fdd91e325197f016274f3f7bd5c6f0e9a84c84a17ee31611c661a15a5fbf203814a932bfe5bda731af1ee766 SHA512 39198a95351584b1693c714cbe571012e8ad49aafda4c68ba2fe252685314d40213d6c23bae39834cc98207a58fe5881aae08e6bdedfbab63b9e2acf26ee79dc 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-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 DIST rocm-Tensile-5.4.2.tar.gz 14413805 BLAKE2B ca1c13785164439f6fe83f16b36b7a0b06a63b70b9f0741d77b0fff98f38d1e1c7e9a54ef61897e6eb0a4eaf52ec9e5f14f42a7e6fd657f26306afa3de0c74a2 SHA512 d99736a202c7353979e732941199b4b20e53ff2b6c19a7175609440a840aa5624bc53a8013c435f31ac37933527771521ff02137c1c8fd53c5317eca8533be80 DIST rocm-Tensile-5.7.1.tar.gz 12396002 BLAKE2B ec2c2bc3f07fe22abd800b642c998ea80b9e4e2d0d28c4763d574dbd2fcb14c735223ddc7571d4ab3a48f0bd819cc835c16df9882049c5bf56f25ef729e6d654 SHA512 8f356f36cfec74ee9b000d1180cf52077dc5c595e5c5a40792fc3eb13f3139980c7440f9bc912218f946cf8137e2481d23fe39f110511c1bb55fe85a933ffd36 +DIST rocm-Tensile-6.1.1.tar.gz 12675289 BLAKE2B dfe3698d7dda14d5b20a6fe1ef6535ac9737ac330b71678a3a94e939adc2350e2dcf33e58c711ee90dae543efba59fe210bfa39fc69b63910ec4537db3f209bf SHA512 cf8b014b1ff7cd5d45236b8a9a6f5604b02e34a9245a163c672847b535d565151bf7e3a5127601681e80e6fe26964a0e544594044efe2fe68e39b0f1128f96e2 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 3496 BLAKE2B 5dce5371520fd9f491b69f147a845baa42d212c07e2ff7f71f1f5a33cdc4290e888fcc1e79f19115841316161f601c335f3fc7b123b2e219fbb2cebe4c065fec SHA512 93007f1ca76a0a9961f11cff3c3eaedd62591d7063e334b2002f61770fbf9abeecc836b59331128dfc69780456ae89f3fa54f85c561f1289150207f0d243e856 +EBUILD Tensile-5.7.1-r2.ebuild 3534 BLAKE2B eb31593d71f596d1f2c23f453fba30e8c723da3095291e46e3290e47e044e510cf57235b0b9ddafe79189b59efd1df928f2f8a7f6cc535865170740b91b94f74 SHA512 d576777ac8e31dfc7930efa2e9b16dca9c9eeca921b92cf299f8c42ab10c41463c88f6b928659b0e4056fda38e7aa5daccec3ab1996b30dbe997ee693391f79a +EBUILD Tensile-6.1.1.ebuild 3554 BLAKE2B 721027444a768c8e4d4330acc7fea8ee85882af8a45d8576cdf2f03c68bd1e241e0f750819f32855370e3a7b11a433f83f272f0b4f30c33e39d7a0eb67b872fd SHA512 207e7a8f659c6aff1be8d5202fb99ac2ca09023247e5e5ff0827fd001bb95aaf4ab7eb12b97e5b44fb676827fa6e407093ad9eea46f41ff7766867a774ee6469 MISC metadata.xml 478 BLAKE2B 4931f453630761d3272371d09065c23cd9fea6e9a80f3b78a07e672e5d2e891c2ad7661883e1cb1f41e89fb2cd725a7189937c7b3cc7fc39b23ef0caaf0b3ce7 SHA512 d57284ff50913d95f092a5b8e4e566d0d6668b56afadfeb2e7003f2af6ed2106f14df82be880b2ea71dec29b614c5cb286a085098fbe8eed16e8bd3588149be6 diff --git a/dev-util/Tensile/Tensile-5.7.1-r2.ebuild b/dev-util/Tensile/Tensile-5.7.1-r2.ebuild index 94b4aac75b1b..64902c86549c 100644 --- a/dev-util/Tensile/Tensile-5.7.1-r2.ebuild +++ b/dev-util/Tensile/Tensile-5.7.1-r2.ebuild @@ -38,6 +38,7 @@ BDEPEND=" dev-python/pytest-forked[${PYTHON_USEDEP}] dev-python/pytest-xdist[${PYTHON_USEDEP}] dev-python/filelock[${PYTHON_USEDEP}] + dev-python/joblib[${PYTHON_USEDEP}] ) " diff --git a/dev-util/Tensile/Tensile-6.1.1.ebuild b/dev-util/Tensile/Tensile-6.1.1.ebuild new file mode 100644 index 000000000000..c8debc3456c3 --- /dev/null +++ b/dev-util/Tensile/Tensile-6.1.1.ebuild @@ -0,0 +1,137 @@ +# 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 +) + +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() { + 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)" + ) + CXX=hipcc 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.0.2-expand-isa-compatibility.patch b/dev-util/Tensile/files/Tensile-6.0.2-expand-isa-compatibility.patch new file mode 100644 index 000000000000..7a72d833bba0 --- /dev/null +++ b/dev-util/Tensile/files/Tensile-6.0.2-expand-isa-compatibility.patch @@ -0,0 +1,34 @@ +diff --git a/Tensile/Source/lib/source/hip/HipHardware.cpp b/Tensile/Source/lib/source/hip/HipHardware.cpp +index ffa4f0f..f894366 100644 +--- a/Tensile/Source/lib/source/hip/HipHardware.cpp ++++ b/Tensile/Source/lib/source/hip/HipHardware.cpp +@@ -24,6 +24,8 @@ + * + *******************************************************************************/ + ++#include <cstring> ++ + #include <Tensile/AMDGPU.hpp> + #include <Tensile/hip/HipHardware.hpp> + #include <Tensile/hip/HipUtils.hpp> +@@ -55,6 +57,20 @@ namespace Tensile + { + hipDeviceProp_t prop; + HIP_CHECK_EXC(hipGetDeviceProperties(&prop, deviceId)); ++ // coerce to compatible arch ++ int gcnArch = strncmp(prop.gcnArchName, "gfx", 3) == 0 ? std::stoi(prop.gcnArchName + 3) : 0; ++ switch(gcnArch) ++ { ++ case 902: case 909: case 912: ++ std::strcpy(prop.gcnArchName, "gfx900"); ++ break; ++ case 1013: ++ std::strcpy(prop.gcnArchName, "gfx1010"); ++ break; ++ case 1031: case 1032: case 1033: case 1034: case 1035: case 1036: ++ std::strcpy(prop.gcnArchName, "gfx1030"); ++ break; ++ } + #if HIP_VERSION >= 50220730 + int hip_version; + HIP_CHECK_EXC(hipRuntimeGetVersion(&hip_version)); diff --git a/dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch b/dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch new file mode 100644 index 000000000000..7a3b1884c074 --- /dev/null +++ b/dev-util/Tensile/files/Tensile-6.1.1-fix-msgpack-dependency.patch @@ -0,0 +1,31 @@ +Gentoo uses "msgpack-cxx" as library name and adds important +MSGPACK_NO_BOOST compile definition when msgpack-cxx us installed with USE=-boost +--- a/Tensile/Source/lib/CMakeLists.txt ++++ b/Tensile/Source/lib/CMakeLists.txt +@@ -98,24 +98,9 @@ if(TENSILE_USE_LLVM OR TENSILE_USE_MSGPACK) + endif() + + if(TENSILE_USE_MSGPACK) +- find_package(msgpack REQUIRED NAMES msgpack msgpack-cxx msgpack-c) ++ find_package(msgpack-cxx REQUIRED) + target_compile_definitions(TensileHost PUBLIC -DTENSILE_MSGPACK=1) +- +- if(TARGET msgpackc-cxx) +- get_target_property(msgpack_inc msgpackc-cxx INTERFACE_INCLUDE_DIRECTORIES) +- elseif(TARGET msgpackc) +- get_target_property(msgpack_inc msgpackc INTERFACE_INCLUDE_DIRECTORIES) +- elseif(TARGET msgpack-cxx) +- get_target_property(msgpack_inc msgpack-cxx INTERFACE_INCLUDE_DIRECTORIES) +- endif() +- +- if(DEFINED msgpack_inc) +- # include C++ headers manually +- # External header includes included as system files +- target_include_directories(TensileHost +- SYSTEM PRIVATE $<BUILD_INTERFACE:${msgpack_inc}> +- ) +- endif() ++ target_link_libraries(TensileHost PRIVATE msgpack-cxx) + endif() + + if(TENSILE_USE_LLVM) |