2024-01-10 17:19:52 -05:00
|
|
|
%global upstreamname Tensile
|
|
|
|
|
2024-08-08 13:37:32 -07:00
|
|
|
%global rocm_release 6.2
|
2024-11-07 10:33:27 -08:00
|
|
|
%global rocm_patch 4
|
2024-01-10 17:19:52 -05:00
|
|
|
%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}
|
2024-11-26 12:41:08 -08:00
|
|
|
%if 0%{?fedora}
|
2024-01-10 17:22:32 -05:00
|
|
|
Release: %autorelease
|
2024-11-26 12:41:08 -08:00
|
|
|
%else
|
|
|
|
Release: 100%{?dist}
|
|
|
|
%endif
|
2024-01-10 17:19:52 -05:00
|
|
|
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
|
|
|
|
|
2024-11-07 10:33:27 -08:00
|
|
|
Patch1: 0001-More-gfx1151.patch
|
|
|
|
Patch2: 0001-Add-gfx1103.patch
|
|
|
|
Patch3: 0001-Add-gfx1035.patch
|
2024-10-28 17:55:20 -07:00
|
|
|
|
|
|
|
#Patch0: 0001-enable-gfx1103-for-Tensile.patch
|
2024-05-15 11:07:07 -06:00
|
|
|
# In 6.1, work around this error
|
|
|
|
# Tensile::FATAL: Cached asm caps differ from derived asm caps for (9, 0, 10)
|
2024-08-08 13:37:32 -07:00
|
|
|
# Patch1: 0001-tensile-workaround-cache-problem.patch
|
2024-05-15 11:07:07 -06:00
|
|
|
|
2024-11-27 06:21:02 -08:00
|
|
|
BuildRequires: fdupes
|
2024-01-10 17:19:52 -05:00
|
|
|
BuildRequires: python3-devel
|
2024-11-26 13:01:46 -08:00
|
|
|
%if 0%{?suse_version}
|
|
|
|
# TW
|
|
|
|
BuildRequires: python311-setuptools
|
|
|
|
%else
|
2024-11-26 12:41:08 -08:00
|
|
|
BuildRequires: python3dist(setuptools)
|
2024-11-26 13:01:46 -08:00
|
|
|
%endif
|
2024-01-10 17:19:52 -05:00
|
|
|
|
|
|
|
%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
|
|
|
|
|
|
|
|
# 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.
|
|
|
|
|
2024-11-27 06:21:02 -08:00
|
|
|
# There are headers and code as part of the code generation.
|
|
|
|
# This make rpm checkers unhappy
|
|
|
|
%package -n python3-tensile-devel
|
|
|
|
Summary: Tool for creating benchmark-driven backend libraries for GEMMs
|
|
|
|
%if 0%{?fedora}
|
|
|
|
Requires: cmake-filesystem
|
|
|
|
%endif
|
|
|
|
Requires: hipcc
|
|
|
|
Requires: rocminfo
|
|
|
|
Requires: python3dist(joblib)
|
|
|
|
Requires: python3dist(msgpack)
|
|
|
|
Requires: python3dist(pyyaml)
|
|
|
|
Provides: python3dist(tensile)
|
2024-01-10 17:19:52 -05:00
|
|
|
|
2024-11-27 06:21:02 -08:00
|
|
|
%description -n python3-tensile-devel
|
2024-01-10 17:19:52 -05:00
|
|
|
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.
|
|
|
|
|
2024-11-27 06:21:02 -08:00
|
|
|
|
2024-01-10 17:19:52 -05:00
|
|
|
%prep
|
|
|
|
%autosetup -p1 -n %{upstreamname}-rocm-%{version}
|
|
|
|
|
|
|
|
#Fix a few things:
|
|
|
|
chmod 755 Tensile/Configs/miopen/convert_cfg.py
|
2024-11-26 12:41:08 -08:00
|
|
|
sed -i -e 's@bin/python@bin/python3@' Tensile/Configs/miopen/convert_cfg.py
|
|
|
|
sed -i -e 's@bin/python@bin/python3@' Tensile/Tests/create_tests.py
|
2024-11-27 06:21:02 -08:00
|
|
|
sed -i -e 's@bin/env python3@bin/python3@' Tensile/bin/Tensile
|
|
|
|
sed -i -e 's@bin/env python3@bin/python3@' Tensile/bin/TensileCreateLibrary
|
2024-01-10 17:19:52 -05:00
|
|
|
|
|
|
|
# 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
|
|
|
|
|
2024-08-08 13:37:32 -07:00
|
|
|
# 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
|
|
|
|
|
2024-01-10 17:19:52 -05:00
|
|
|
%build
|
2024-11-26 12:41:08 -08:00
|
|
|
%py3_build
|
2024-01-10 17:19:52 -05:00
|
|
|
|
|
|
|
%install
|
2024-11-26 12:41:08 -08:00
|
|
|
%py3_install
|
2024-01-10 17:19:52 -05:00
|
|
|
|
|
|
|
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*
|
|
|
|
|
2024-11-26 12:41:08 -08:00
|
|
|
# Do not distribute tests
|
|
|
|
rm -rf %{buildroot}%{python3_sitelib}/%{upstreamname}/Tests
|
|
|
|
|
2024-11-27 06:21:02 -08:00
|
|
|
#Clean up dupes:
|
|
|
|
%fdupes %{buildroot}%{_prefix}
|
|
|
|
|
|
|
|
# rm hard links and replace
|
|
|
|
rm %{buildroot}%{python3_sitelib}/%{upstreamname}/cmake/*.cmake
|
|
|
|
cp %{buildroot}%{_datadir}/cmake/Tensile/*.cmake %{buildroot}%{python3_sitelib}/%{upstreamname}/cmake/
|
|
|
|
|
2024-01-10 17:19:52 -05:00
|
|
|
%check
|
|
|
|
%if %{with check}
|
|
|
|
%tox
|
|
|
|
%endif
|
|
|
|
|
2024-11-27 06:21:02 -08:00
|
|
|
%files -n python3-tensile-devel
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
# Should not have to do this
|
|
|
|
%dir %{_datadir}/cmake
|
|
|
|
%endif
|
2024-11-26 12:41:08 -08:00
|
|
|
%dir %{_datadir}/cmake/Tensile
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}
|
2024-11-27 06:21:02 -08:00
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/__pycache__
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/bin
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/cmake
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/Components
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/Configs
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/CustomKernels
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/Source
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/Perf
|
|
|
|
%dir %{python3_sitelib}/%{upstreamname}/Utilities
|
2024-11-26 12:41:08 -08:00
|
|
|
%dir %{python3_sitelib}/%{upstreamname}*.egg-info
|
2024-01-10 17:19:52 -05:00
|
|
|
%doc README.md
|
|
|
|
%license LICENSE.md
|
|
|
|
%{_bindir}/%{upstreamname}*
|
2024-11-26 12:41:08 -08:00
|
|
|
%{_datadir}/cmake/Tensile/*.cmake
|
2024-11-27 06:21:02 -08:00
|
|
|
%{python3_sitelib}/%{upstreamname}/*.py
|
|
|
|
%{python3_sitelib}/%{upstreamname}/__pycache__/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/bin/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/cmake/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/Components/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/Configs/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/CustomKernels/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/Perf/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/Source/*
|
|
|
|
%{python3_sitelib}/%{upstreamname}/Utilities/*
|
2024-11-26 12:41:08 -08:00
|
|
|
%{python3_sitelib}/%{upstreamname}*.egg-info/*
|
2024-01-10 17:19:52 -05:00
|
|
|
|
|
|
|
%changelog
|
2024-11-26 12:41:08 -08:00
|
|
|
%if 0%{?fedora}
|
2024-01-10 17:22:32 -05:00
|
|
|
%autochangelog
|
2024-11-26 12:41:08 -08:00
|
|
|
%endif
|
|
|
|
|