## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global upstreamname Tensile %global rocm_release 6.2 %global rocm_patch 4 %global rocm_version %{rocm_release}.%{rocm_patch} # This doesn't work quite yet: # Also depends on local gpu hw %bcond_with check %global toolchain rocm # hipcc does not support some clang flags %global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/') Name: python-tensile Version: %{rocm_version} Release: %autorelease Summary: Tool for creating benchmark-driven backend libraries for GEMMs Url: https://github.com/ROCmSoftwarePlatform/Tensile License: MIT Source0: %{url}/archive/refs/tags/rocm-%{version}.tar.gz#/%{upstreamname}-%{version}.tar.gz Patch1: 0001-More-gfx1151.patch Patch2: 0001-Add-gfx1103.patch Patch3: 0001-Add-gfx1035.patch #Patch0: 0001-enable-gfx1103-for-Tensile.patch # In 6.1, work around this error # Tensile::FATAL: Cached asm caps differ from derived asm caps for (9, 0, 10) # Patch1: 0001-tensile-workaround-cache-problem.patch BuildRequires: python3-devel %if %{with check} # Some of these might not be needed BuildRequires: compiler-rt BuildRequires: clang-devel BuildRequires: lld BuildRequires: llvm-devel BuildRequires: rocm-cmake BuildRequires: rocm-comgr-devel BuildRequires: rocm-hip-devel BuildRequires: rocm-rpm-macros BuildRequires: rocm-runtime-devel %endif Requires: hipcc Requires: rocminfo # Straight python, but only usable for ROCm which is only on x86_64 BuildArch: noarch ExclusiveArch: x86_64 %description Tensile is a tool for creating benchmark-driven backend libraries for GEMMs, GEMM-like problems (such as batched GEMM), and general N-dimensional tensor contractions on a GPU. The Tensile library is mainly used as backend library to rocBLAS. Tensile acts as the performance backbone for a wide variety of 'compute' applications running on AMD GPUs. %package -n python3-tensile Summary: %{summary} Requires: cmake-filesystem %description -n python3-tensile Tensile is a tool for creating benchmark-driven backend libraries for GEMMs, GEMM-like problems (such as batched GEMM), and general N-dimensional tensor contractions on a GPU. The Tensile library is mainly used as backend library to rocBLAS. Tensile acts as the performance backbone for a wide variety of 'compute' applications running on AMD GPUs. %prep %autosetup -p1 -n %{upstreamname}-rocm-%{version} #Fix a few things: chmod 755 Tensile/Configs/miopen/convert_cfg.py %py3_shebang_fix Tensile/Configs/miopen/convert_cfg.py %py3_shebang_fix Tensile/Tests/create_tests.py # I'm assuming we don't need these: rm -r %{upstreamname}/Configs/miopen/archives # hack where TensileGetPath is located sed -i -e 's@${Tensile_PREFIX}/bin/TensileGetPath@TensileGetPath@g' Tensile/cmake/TensileConfig.cmake # Use /usr instead of /opt/rocm for prefix sed -i -e 's@opt/rocm@usr@g' Tensile/Common.py sed -i -e 's@opt/rocm@usr@g' Tensile/Tests/yaml_only/test_config.py # Ignora asm cap sed -i -e 's@globalParameters["IgnoreAsmCapCache"] = False@globalParameters["IgnoreAsmCapCache"] = True@' Tensile/Common.py sed -i -e 's@arguments["IgnoreAsmCapCache"] = args.IgnoreAsmCapCache@arguments["IgnoreAsmCapCache"] = True@' Tensile/TensileCreateLibrary.py sed -i -e 's@if not ignoreCacheCheck and derivedAsmCaps@if False and derivedAsmCaps@' Tensile/Common.py %generate_buildrequires %pyproject_buildrequires -t %build %pyproject_wheel %install %pyproject_install %pyproject_save_files %{upstreamname} mkdir -p %{buildroot}%{_datadir}/cmake/Tensile mv %{buildroot}%{_prefix}/cmake/* %{buildroot}%{_datadir}/cmake/Tensile/ rm -rf %{buildroot}%{_prefix}/cmake # Do not distribute broken bins rm %{buildroot}%{_bindir}/tensile* %check %if %{with check} %tox %endif %files -n python3-tensile -f %{pyproject_files} %doc README.md %license LICENSE.md %{_bindir}/%{upstreamname}* %{_datadir}/cmake/Tensile %exclude %{python3_sitelib}/%{upstreamname}/Tests %changelog ## START: Generated by rpmautospec * Thu Nov 07 2024 Tom Rix - 6.2.4-1 - Update to 6.2.4 * Tue Oct 29 2024 Tom Rix - 6.2.0-2 - Add tensile for gfx1035,gfx1103 and gfx1151 * Thu Aug 08 2024 Tom Rix - 6.2.0-1 - Update to ROCm 6.2 * Fri Jul 19 2024 Fedora Release Engineering - 6.1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Fri Jun 14 2024 Tom Rix - 6.1.2-1 - Update to 6.1.2 * Sat Jun 08 2024 Python Maint - 6.1.1-2 - Rebuilt for Python 3.13 * Wed May 15 2024 Tom Rix - 6.1.1-1 - Update to 6.1.1 * Tue Mar 05 2024 Tom Rix - 6.0.2-1 - Update to 6.0.2 * Fri Jan 26 2024 Fedora Release Engineering - 6.0.0-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 6.0.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Jan 10 2024 Jeremy Newton - 6.0.0-3 - Add missing requires cmake-filesystem * Tue Jan 9 2024 Tom Rix - 6.0.0-2 - Fix /opt/rocm paths with sed * Sat Jan 6 2024 Tom Rix - 6.0.0-1 - Update to 6.0 * Fri Jun 30 2023 Jeremy Newton - 5.6.0-1 - Initial package ## END: Generated by rpmautospec