|
|
|
@@ -22,10 +22,7 @@
|
|
|
|
|
%global hipblaslt_name hipblaslt
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
|
%{?sle15_python_module_pythons}
|
|
|
|
|
%{?!python_module:%define python_module() python3-%{**}}
|
|
|
|
|
%else
|
|
|
|
|
%if 0%{!?suse_version:1}
|
|
|
|
|
%define python_exec python3
|
|
|
|
|
%define python_expand python3
|
|
|
|
|
%endif
|
|
|
|
@@ -89,7 +86,7 @@
|
|
|
|
|
|
|
|
|
|
Name: %{hipblaslt_name}
|
|
|
|
|
Version: %{rocm_version}
|
|
|
|
|
Release: 1%{?dist}
|
|
|
|
|
Release: 3%{?dist}
|
|
|
|
|
Summary: ROCm general matrix operations beyond BLAS
|
|
|
|
|
URL: https://github.com/ROCmSoftwarePlatform/%{upstreamname}
|
|
|
|
|
License: MIT
|
|
|
|
@@ -119,7 +116,6 @@ BuildRequires: rocm-rpm-macros
|
|
|
|
|
BuildRequires: rocm-runtime-devel
|
|
|
|
|
BuildRequires: rocm-smi-devel
|
|
|
|
|
BuildRequires: rocminfo
|
|
|
|
|
BuildRequires: roctracer-devel
|
|
|
|
|
BuildRequires: zlib-devel
|
|
|
|
|
|
|
|
|
|
# For tensilelite
|
|
|
|
@@ -131,7 +127,11 @@ BuildRequires: %{python_module setuptools}
|
|
|
|
|
BuildRequires: msgpack-cxx-devel
|
|
|
|
|
BuildRequires: python-rpm-macros
|
|
|
|
|
%global tensile_verbose 2
|
|
|
|
|
%else
|
|
|
|
|
BuildRequires: %{python_module dataclasses if %python-base < 3.11}
|
|
|
|
|
BuildRequires: %{python_module distro}
|
|
|
|
|
BuildRequires: %{python_module simplejson}
|
|
|
|
|
BuildRequires: %{python_module ujson}
|
|
|
|
|
%else # %suse_version
|
|
|
|
|
BuildRequires: python3-devel
|
|
|
|
|
BuildRequires: python3dist(pyyaml)
|
|
|
|
|
BuildRequires: python3dist(setuptools)
|
|
|
|
@@ -147,11 +147,26 @@ BuildRequires: msgpack-devel
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with test}
|
|
|
|
|
BuildRequires: blas-static
|
|
|
|
|
BuildRequires: rocm-omp-devel
|
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
|
BuildRequires: gcc-fortran
|
|
|
|
|
BuildRequires: gmock
|
|
|
|
|
BuildRequires: gtest
|
|
|
|
|
BuildRequires: openblas-devel
|
|
|
|
|
%global blaslib openblas
|
|
|
|
|
%else
|
|
|
|
|
BuildRequires: gcc-gfortran
|
|
|
|
|
BuildRequires: gmock-devel
|
|
|
|
|
BuildRequires: gtest-devel
|
|
|
|
|
%if 0%{?rhel}
|
|
|
|
|
BuildRequires: flexiblas-devel
|
|
|
|
|
%global blaslib flexiblas
|
|
|
|
|
%else
|
|
|
|
|
BuildRequires: blas-static
|
|
|
|
|
BuildRequires: lapack-static
|
|
|
|
|
%global blaslib cblas
|
|
|
|
|
%endif
|
|
|
|
|
%endif
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if %{with ninja}
|
|
|
|
@@ -220,7 +235,8 @@ sed -i -e 's@set(CMAKE_INSTALL_LIBDIR@#set(CMAKE_INSTALL_LIBDIR@' CMakeLists.txt
|
|
|
|
|
sed -i -e 's@virtualenv_install@#virtualenv_install@' CMakeLists.txt
|
|
|
|
|
# do not mess with prefix path
|
|
|
|
|
sed -i -e 's@APPEND CMAKE_PREFIX_PATH@APPEND NO_CMAKE_PREFIX_PATH@' CMakeLists.txt
|
|
|
|
|
|
|
|
|
|
# Remove orjson from requirements list as fallbacks exist
|
|
|
|
|
%{?suse_version:sed -i -e '/orjson/d' tensilelite/requirements.txt}
|
|
|
|
|
# For debugging
|
|
|
|
|
# set threads to 1
|
|
|
|
|
# sed -i -e 's@default=-1@default=1@' tensilelite/Tensile/TensileCreateLibrary.py
|
|
|
|
@@ -234,15 +250,10 @@ sed -i -e 's@APPEND CMAKE_PREFIX_PATH@APPEND NO_CMAKE_PREFIX_PATH@' C
|
|
|
|
|
sed -i -e 's@-lgfortran -lflang -lflangrti@-lgfortran@' clients/gtest/CMakeLists.txt
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if 0%{?suse_version} >= 1600
|
|
|
|
|
%if 0%{?suse_version}
|
|
|
|
|
sed -i -e 's@msgpack REQUIRED@msgpack-cxx REQUIRED@' tensilelite/Tensile/Source/lib/CMakeLists.txt
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%if 0%{?sle_version} == 150600
|
|
|
|
|
sed -i 's@#!/usr/bin/env python3@#!/usr/bin/python3.11@' tensilelite/Tensile/bin/Tensile*
|
|
|
|
|
sed -i 's@python3@python3.11@' clients/common/hipblaslt_gentest.py cmake/virtualenv.cmake tensilelite/Tensile/Ops/gen_assembly.sh
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
sed -i 's@find_package(LLVM REQUIRED CONFIG)@find_package(LLVM REQUIRED CONFIG PATHS "%{rocmllvm_cmakedir}")@' tensilelite/Tensile/Source/lib/CMakeLists.txt
|
|
|
|
|
|
|
|
|
|
# Reduce requirements
|
|
|
|
@@ -269,6 +280,13 @@ if [ "$GPUS" -lt "$HIP_JOBS" ]; then
|
|
|
|
|
fi
|
|
|
|
|
sed -i -e "s@--offload-arch@-parallel-jobs=${HIP_JOBS} --offload-arch@" library/src/amd_detail/rocblaslt/src/kernels/compile_code_object.sh
|
|
|
|
|
|
|
|
|
|
# change looking for cblas to blaslib
|
|
|
|
|
sed -i -e 's@find_package( cblas REQUIRED CONFIG )@#find_package( cblas REQUIRED CONFIG )@' clients/CMakeLists.txt
|
|
|
|
|
sed -i -e 's@set( BLAS_LIBRARY "blas" )@set( BLAS_LIBRARY "%blaslib" )@' clients/CMakeLists.txt
|
|
|
|
|
%if ! 0%{?fedora}
|
|
|
|
|
sed -i -e 's@lapack cblas@%blaslib@' clients/gtest/CMakeLists.txt
|
|
|
|
|
%endif
|
|
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
|
|
|
|
|
# Do a manual install instead of cmake's virtualenv
|
|
|
|
@@ -301,6 +319,8 @@ export Tensile_DIR=${TL}%{python3_sitelib}/Tensile
|
|
|
|
|
# Use ld.lld to work around a problem with ld
|
|
|
|
|
%cmake %{cmake_generator} \
|
|
|
|
|
-DAMDGPU_TARGETS=%{amdgpu_targets} \
|
|
|
|
|
-DBLAS_INCLUDE_DIR=%{_includedir}/%{blaslib} \
|
|
|
|
|
-DBLAS_LIBRARY=%{blaslib} \
|
|
|
|
|
-DBUILD_CLIENTS_TESTS=%{build_test} \
|
|
|
|
|
-DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \
|
|
|
|
|
-DBUILD_VERBOSE=ON \
|
|
|
|
@@ -311,15 +331,13 @@ export Tensile_DIR=${TL}%{python3_sitelib}/Tensile
|
|
|
|
|
-DCMAKE_CXX_FLAGS="-fuse-ld=%{rocmllvm_bindir}/ld.lld" \
|
|
|
|
|
-DCMAKE_VERBOSE_MAKEFILE=ON \
|
|
|
|
|
-DHIP_PLATFORM=amd \
|
|
|
|
|
-DHIPBLASLT_ENABLE_MARKER=OFF \
|
|
|
|
|
-DROCM_SYMLINK_LIBS=OFF \
|
|
|
|
|
-DBUILD_WITH_TENSILE=ON \
|
|
|
|
|
-DTensile_COMPILER=%{rocmllvm_bindir}/clang++ \
|
|
|
|
|
-DTensile_LIBRARY_FORMAT=msgpack \
|
|
|
|
|
-DTensile_VERBOSE=%{tensile_verbose} \
|
|
|
|
|
-DVIRTUALENV_BIN_DIR=%{_bindir} \
|
|
|
|
|
%if 0%{?sle_version} == 150600
|
|
|
|
|
-DPYTHON_EXECUTABLE:FILEPATH=python3.11 \
|
|
|
|
|
%endif
|
|
|
|
|
%{nil}
|
|
|
|
|
|
|
|
|
|
%cmake_build
|
|
|
|
|