%global upstreamname RCCL %global rocm_release 6.0 %global rocm_patch 2 %global rocm_version %{rocm_release}.%{rocm_patch} %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/') # $gpu will be evaluated in the loops below %global _vpath_builddir %{_vendor}-%{_target_os}-build-${gpu} # It is necessary to use this with a local build # export QA_RPATHS=0xff %bcond_with test Name: rccl Version: %{rocm_version} Release: %autorelease Summary: ROCm Communication Collectives Library Url: https://github.com/ROCmSoftwarePlatform License: BSD-3-Clause AND MIT AND Apache-2.0 # From License.txt the main license is BSD 3 # Modifications from Microsoft is MIT # The NVIDIA based header files below are Apache-2.0 # src/include/nvtx3/nv*.h and similar # The URL for NVIDIA in the License.txt https://github.com/NVIDIA/NVTX is Apache-2.0 Source0: %{url}/%{upstreamname}/archive/rocm-%{rocm_version}.tar.gz#/%{upstreamname}-%{rocm_version}.tar.gz Patch0: 0001-prepare-rccl-cmake-for-fedora.patch BuildRequires: cmake BuildRequires: hipify BuildRequires: ninja-build BuildRequires: rocm-cmake BuildRequires: rocm-comgr-devel BuildRequires: rocm-hip-devel BuildRequires: rocm-runtime-devel BuildRequires: rocm-rpm-macros BuildRequires: rocm-rpm-macros-modules BuildRequires: rocm-smi-devel Requires: rocm-rpm-macros-modules Requires: %{name}-data = %{version}-%{release} # Only x86_64 works right now: ExclusiveArch: x86_64 %description RCCL (pronounced "Rickle") is a stand-alone library of standard collective communication routines for GPUs, implementing all-reduce, all-gather, reduce, broadcast, reduce-scatter, gather, scatter, and all-to-all. There is also initial support for direct GPU-to-GPU send and receive operations. It has been optimized to achieve high bandwidth on platforms using PCIe, xGMI as well as networking using InfiniBand Verbs or TCP/IP sockets. RCCL supports an arbitrary number of GPUs installed in a single node or multiple nodes, and can be used in either single- or multi-process (e.g., MPI) applications. The collective operations are implemented using ring and tree algorithms and have been optimized for throughput and latency. For best performance, small operations can be either batched into larger operations or aggregated through the API. %package devel Summary: Headers and libraries for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Headers and libraries for %{name} %package data Summary: Data for %{name} BuildArch: noarch %description data Data for %{name} %if %{with test} %package test Summary: Tests for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description test %{summary} %endif %prep %autosetup -p1 -n %{name}-rocm-%{version} # Allow user to set AMDGPU_TARGETS sed -i -e '/AMD GPU targets to compile for/d' CMakeLists.txt %build for gpu in %{rocm_gpu_list} do module load rocm/$gpu %cmake -G Ninja \ -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \ -DCMAKE_INSTALL_LIBDIR=%{_libdir} \ -DROCM_SYMLINK_LIBS=OFF \ -DAMDGPU_TARGETS=${ROCM_GPUS} \ -DCMAKE_INSTALL_LIBDIR=$ROCM_LIB \ -DCMAKE_INSTALL_BINDIR=$ROCM_BIN \ %if %{with test} -DBUILD_TESTS=ON \ %endif -DHIP_PLATFORM=amd %cmake_build module purge done %install for gpu in %{rocm_gpu_list} do %cmake_install done %files %license LICENSE.txt %{_libdir}/lib%{name}.so.1{,.*} %{_libdir}/rocm/gfx*/lib/lib%{name}.so.1{,.*} %exclude %{_docdir}/%{name}/LICENSE.txt %files data %dir %{_datadir}/%{name} %dir %{_datadir}/%{name}/msccl-algorithms %{_datadir}/%{name}/msccl-algorithms/*.xml %{_datadir}/%{name}/msccl-unit-test-algorithms/*.xml %files devel %doc README.md %dir %{_libdir}/cmake/%{name} %dir %{_libdir}/rocm/gfx*/lib/cmake/%{name} %dir %{_includedir}/%{name} %{_includedir}/%{name}/*.h %{_libdir}/lib%{name}.so %{_libdir}/rocm/gfx*/lib/lib%{name}.so %{_libdir}/cmake/%{name}/*.cmake %{_libdir}/rocm/gfx*/lib/cmake/%{name}/*.cmake %if %{with test} %files test %{_bindir}/%{name}* %{_libdir}/rocm/gfx*/bin/%{name}* %endif %changelog %autochangelog