diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-11-27 22:51:10 +0000 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-11-27 22:51:10 +0000 |
commit | ee0c4d5e506a6c64994a15c3af5cf1ca22045567 (patch) | |
tree | bdf578939023d42f04092ddb4bcd190eb391770f /dev-util | |
parent | 161eaa4b12ca6314376288834bba20b7824d0d77 (diff) |
gentoo auto-resync : 27:11:2023 - 22:51:09
Diffstat (limited to 'dev-util')
-rw-r--r-- | dev-util/Manifest.gz | bin | 70303 -> 70303 bytes | |||
-rw-r--r-- | dev-util/Tensile/Manifest | 4 | ||||
-rw-r--r-- | dev-util/Tensile/Tensile-5.7.1-r1.ebuild | 132 | ||||
-rw-r--r-- | dev-util/Tensile/files/Tensile-5.7.1-expand-isa-compatibility.patch | 49 | ||||
-rw-r--r-- | dev-util/Tensile/files/Tensile-5.7.1-gentoopath.patch | 57 |
5 files changed, 242 insertions, 0 deletions
diff --git a/dev-util/Manifest.gz b/dev-util/Manifest.gz Binary files differindex 52b3dfca4cf0..92e5f5a0fccc 100644 --- a/dev-util/Manifest.gz +++ b/dev-util/Manifest.gz diff --git a/dev-util/Tensile/Manifest b/dev-util/Tensile/Manifest index ae57e3ff7df3..5a6854be51c4 100644 --- a/dev-util/Tensile/Manifest +++ b/dev-util/Tensile/Manifest @@ -7,10 +7,14 @@ AUX Tensile-5.4.2-fix-arch-parse.patch 538 BLAKE2B 80b83774452c06f4ced24988ed5e9 AUX Tensile-5.4.2-gentoopath.patch 3149 BLAKE2B fd033093654683524f4ce51ee36ea1d84d53dc95c0556f9eb86d3f7870728fbac744322c8ce915a6dc13907b2fb249543a791ccf6051701feaeee595e65f32e0 SHA512 ab2afad72ffd04328701462161bec9627bf35a42be7be4775e8601e51b3b50b9cd18acbed547d51621923e3ec33ec4872039025124a2fe593f68145f468df30b AUX Tensile-5.4.2-gfx1031.patch 5051 BLAKE2B d043b94403069f9b4b4c379cf7c361b30f3c0c145f740d37e5cf787636fa3f5c00ca1b7c375f311c9f067e8e6c7d383fbc34157e4b9d4f65a93ed53e9e14b814 SHA512 53cae079788f0478ba7a0af48ddb279a39496a3238263352ff17f555f588ebc1e9463d5b466f1e819ba29a4857c65a644d7a93fe0c2dca3403f994ade4f2bc0f AUX Tensile-5.4.2-use-ninja.patch 1164 BLAKE2B 41d6dbb68fa41b53d230afd06af95acb014163d14b7f0e61d5a2945ef02c7a3d376f327a3f82fa86085c8eb95820d95883bdc05024e87b69dad61caf39c3b124 SHA512 b73271b637b4b3c045813638b1cebf6c3b4ac50350a62a76351e6fdf3e74b20104bbb135085c96c9c0e99f20f971af316d9686c8347a894361ee90abb66175fa +AUX Tensile-5.7.1-expand-isa-compatibility.patch 1632 BLAKE2B 807df38c99852b58801cb84bccf8cdd28b5575a460130e4463b483fb875f7adfb1d7902a47ca7e9f8735285bfaf3aa1a422595e57ec616faf2af423892301384 SHA512 3cf82928780532d32dfd0680a0ea8d8b990055186795ddc6d93a85941eeb9f0968979fe33fc4155f79413c54b8809d52eb3327624d51c187bfb8cd8bfef66bd4 +AUX Tensile-5.7.1-gentoopath.patch 2284 BLAKE2B 36f55d7eefe595395c108671d55a07cb8bd4d8d8c21944edb53465e32076d99cd23c38709993408694d54022c2e9362dd2c1943423b99e4829d2d5a663c1aec7 SHA512 5f5f96ce2ffa7b9e18a2ad82ebaa419537586356602de0feddf5884de3ecbf358d19cc2f59f2c6d883e18de9c029a901143d98ed2c48bb70fee3d7d8501f622e 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 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-r1.ebuild 3479 BLAKE2B 9ccae568bef633982cd9b48162efdab134b51d55ac6361a4a08e6eade52097e9e904c1470f742cd6ae3e3ac4e68711dbc36340a5792e803a5975eeb096e41557 SHA512 00bb959dd1c5f8a9b27e91db43535b18955804a6ce2e6175a0e729ec6bc74f1796f572cb8aa3f0cfdf47b8b541499313c5c9c49a8c9dae007afbed3681810f73 MISC metadata.xml 478 BLAKE2B 4931f453630761d3272371d09065c23cd9fea6e9a80f3b78a07e672e5d2e891c2ad7661883e1cb1f41e89fb2cd725a7189937c7b3cc7fc39b23ef0caaf0b3ce7 SHA512 d57284ff50913d95f092a5b8e4e566d0d6668b56afadfeb2e7003f2af6ed2106f14df82be880b2ea71dec29b614c5cb286a085098fbe8eed16e8bd3588149be6 diff --git a/dev-util/Tensile/Tensile-5.7.1-r1.ebuild b/dev-util/Tensile/Tensile-5.7.1-r1.ebuild new file mode 100644 index 000000000000..709189734d4a --- /dev/null +++ b/dev-util/Tensile/Tensile-5.7.1-r1.ebuild @@ -0,0 +1,132 @@ +# Copyright 1999-2023 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} +inherit cmake distutils-r1 llvm prefix rocm + +LLVM_MAX_SLOT=17 + +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" +KEYWORDS="~amd64" +SLOT="0/$(ver_cut 1-2)" +IUSE="client test" +REQUIRED_USE="client? ( ${ROCM_REQUIRED_USE} )" + +RESTRICT="!test? ( test )" + +RDEPEND="${PYTHON_DEPS} + >=dev-cpp/msgpack-cxx-6.0.0 + dev-python/pyyaml[${PYTHON_USEDEP}] + dev-python/msgpack[${PYTHON_USEDEP}] + dev-util/hip + >=dev-util/rocm-smi-4.3.0 + sys-devel/clang:${LLVM_MAX_SLOT} +" +DEPEND="${RDEPEND}" +BDEPEND=" + test? ( + dev-python/pytest-forked[${PYTHON_USEDEP}] + dev-python/pytest-xdist[${PYTHON_USEDEP}] + dev-python/filelock[${PYTHON_USEDEP}] + ) +" + +distutils_enable_tests pytest + +PATCHES=( + "${FILESDIR}"/${PN}-change-cmake-name-for-msgpack-cxx-6-release.patch + "${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}-5.7.1-expand-isa-compatibility.patch +) + +CMAKE_USE_DIR="${S}/${PN}/Source" + +src_prepare() { + distutils-r1_src_prepare + sed -e "s,\@LLVM_PATH\@,$(get_llvm_prefix ${LLVM_MAX_SLOT}),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 ReplacementKernels-cov3 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-5.7.1-expand-isa-compatibility.patch b/dev-util/Tensile/files/Tensile-5.7.1-expand-isa-compatibility.patch new file mode 100644 index 000000000000..ebfc537c5c4d --- /dev/null +++ b/dev-util/Tensile/files/Tensile-5.7.1-expand-isa-compatibility.patch @@ -0,0 +1,49 @@ +Allow Tensile 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/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> +@@ -56,6 +58,31 @@ namespace Tensile + { + 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; ++ } + #if HIP_VERSION >= 50220730 + int hip_version; + HIP_CHECK_EXC(hipRuntimeGetVersion(&hip_version)); diff --git a/dev-util/Tensile/files/Tensile-5.7.1-gentoopath.patch b/dev-util/Tensile/files/Tensile-5.7.1-gentoopath.patch new file mode 100644 index 000000000000..c8bc360cc39b --- /dev/null +++ b/dev-util/Tensile/files/Tensile-5.7.1-gentoopath.patch @@ -0,0 +1,57 @@ +Fix incorrect path in scripts and CMakeLists, in order to build tensile_client + +--- a/HostLibraryTests/CMakeLists.txt ++++ b/HostLibraryTests/CMakeLists.txt +@@ -139,7 +139,7 @@ set(test_sources ${test_sources} + ) + + if(TENSILE_USE_LLVM) +- find_package(LLVM REQUIRED CONFIG) ++ find_package(LLVM PATHS @LLVM_PATH@ REQUIRED CONFIG) + + set(test_sources ${test_sources} + ContractionLibraryLoading_test.cpp +--- a/Tensile/ClientWriter.py ++++ b/Tensile/ClientWriter.py +@@ -176,7 +176,7 @@ def runClient(libraryLogicPath, forBenchmark, enableTileSelection, configPaths=N + def getBuildClientLibraryScript(buildPath, libraryLogicPath): + callCreateLibraryCmd = ["python"] if os.name == "nt" else [] + +- callCreateLibraryCmd += [os.path.join(globalParameters["ScriptPath"] , "bin", "TensileCreateLibrary")] ++ callCreateLibraryCmd += ["TensileCreateLibrary"] + + if globalParameters["MergeFiles"]: + callCreateLibraryCmd += ["--merge-files"] +--- a/Tensile/Common.py ++++ b/Tensile/Common.py +@@ -2108,7 +2108,7 @@ def assignGlobalParameters( config ): + else: + print2(" %24s: %8s (unspecified)" % (key, defaultValue)) + +- globalParameters["ROCmPath"] = "/opt/rocm" ++ globalParameters["ROCmPath"] = "@GENTOO_PORTAGE_EPREFIX@/usr" + if "ROCM_PATH" in os.environ: + globalParameters["ROCmPath"] = os.environ.get("ROCM_PATH") + if "TENSILE_ROCM_PATH" in os.environ: +--- a/Tensile/GenerateSummations.py ++++ b/Tensile/GenerateSummations.py +@@ -59,7 +59,7 @@ def createLibraryForBenchmark(logicPath, libraryPath, currentPath): + Selection. + """ + +- pythonExePath = os.path.join(os.path.dirname(os.path.realpath(__file__)), "bin", "TensileCreateLibrary") ++ pythonExePath = "TensileCreateLibrary" + args = [pythonExePath, \ + "--merge-files", "--new-client-only", "--no-short-file-names", "--no-library-print-debug", \ + "--architecture=all", "--cxx-compiler=hipcc", "--library-format=yaml", \ +--- a/Tensile/Source/lib/CMakeLists.txt ++++ b/Tensile/Source/lib/CMakeLists.txt +@@ -52,7 +52,7 @@ set(tensile_sources ${tensile_sources} + ) + + if(TENSILE_USE_LLVM) +- find_package(LLVM REQUIRED CONFIG) ++ find_package(LLVM PATHS @LLVM_PATH@ REQUIRED CONFIG) + + set(tensile_sources ${tensile_sources} + source/llvm/YAML.cpp |