dev-util/Tensile: add 6.4.1

Signed-off-by: Sv. Lockal <lockalsash@gmail.com>
Part-of: https://github.com/gentoo/gentoo/pull/42554
Signed-off-by: Sam James <sam@gentoo.org>
This commit is contained in:
Sv. Lockal
2025-06-09 10:53:11 +00:00
committed by Sam James
parent 32c83abee9
commit cd8b0635bc
2 changed files with 141 additions and 0 deletions

View File

@@ -2,3 +2,4 @@ DIST rocm-Tensile-5.7.1.tar.gz 12396002 BLAKE2B ec2c2bc3f07fe22abd800b642c998ea8
DIST rocm-Tensile-6.1.1.tar.gz 12675289 BLAKE2B dfe3698d7dda14d5b20a6fe1ef6535ac9737ac330b71678a3a94e939adc2350e2dcf33e58c711ee90dae543efba59fe210bfa39fc69b63910ec4537db3f209bf SHA512 cf8b014b1ff7cd5d45236b8a9a6f5604b02e34a9245a163c672847b535d565151bf7e3a5127601681e80e6fe26964a0e544594044efe2fe68e39b0f1128f96e2
DIST rocm-Tensile-6.3.2.tar.gz 12723907 BLAKE2B aaabae87664340f3e044ac5fdc68331084cd597466f294d60f8ed3d523c0f1ebc0c6e3e353585d4bb85f4fe30c644b1a70f2123b6f62d67a6b7a1904f3d820bb SHA512 df8888d7250f9e3dc6818590c82a3e1dc3ff787e0eac29e45969ef408db92261d39faca29f5ac7a6bae5e5b614365ff6e37d087956697c25c65d9d7e4c1ba74d
DIST rocm-Tensile-6.3.3.tar.gz 12723968 BLAKE2B e8c14f85dd44767b685595180974d683d759f84fc044e98974beae107f78ec97d43de30232ea0bd3578aa6cd40e17309d603ce583925ed4dd65cc146241e5b7d SHA512 836e17aab29ace976595c5b3fbc6b1742c774eb0420488a1449e04649c424e5a877168cf71de96fddcfbad337e295206ec456aea7649fe9e67a8802739ddbabe
DIST rocm-Tensile-6.4.1.tar.gz 12731537 BLAKE2B cefa2d3fb5a0179e0373518141260a95746d539b06be9e10a6961db30c573bc4971fc40a32c450d4b75a3808e5eac54dd4568e97f814b73cb29b6dfa870c6f2e SHA512 6b72ecf4de41c0b01b1dceb3a135ed32d3fa73f9ae319de8ee09ada89b40a202838bedd62038e76668325213f36466b41e58fd9d948bdcf486a7a7566dd38aef

View File

@@ -0,0 +1,140 @@
# Copyright 1999-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..13} )
DISTUTILS_USE_PEP517=setuptools
ROCM_VERSION=${PV}
LLVM_COMPAT=( 20 )
inherit cmake distutils-r1 llvm-r1 prefix rocm
DESCRIPTION="Stretching GPU performance for GEMMs and tensor contractions"
HOMEPAGE="https://github.com/ROCm/Tensile"
SRC_URI="https://github.com/ROCm/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} )"
# tests can freeze machine depending on gpu/kernel
RESTRICT="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:${SLOT}
dev-util/rocm-smi:${SLOT}
$(llvm_gen_dep '
llvm-core/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}-5.4.2-fix-arch-parse.patch
"${FILESDIR}"/${PN}-6.3.0-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() {
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_domodule Utilities
python_domodule TensileCreateLib
}
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
}