diff --git a/cmssw-tools.spec b/cmssw-tools.spec index c7315086051..1a81c187f3c 100644 --- a/cmssw-tools.spec +++ b/cmssw-tools.spec @@ -172,7 +172,7 @@ Requires: icc Requires: icx Requires: intel-vtune Requires: ruff -%{!?without_rocm:Requires: rocm rocm-rocrand} +%{!?without_rocm:Requires: rocm} Requires: cmsmon-tools Requires: dip %else diff --git a/fwlite-tools.spec b/fwlite-tools.spec index afffbc5a513..216e981a5bb 100644 --- a/fwlite-tools.spec +++ b/fwlite-tools.spec @@ -3,7 +3,7 @@ # tool is added ## INITENV SET CMSSW_TOOL_CONF_ROOT $FWLITE_TOOL_CONF_ROOT -%{!?without_rocm:Requires: rocm rocm-rocrand} +%{!?without_rocm:Requires: rocm} %{!?without_cuda:Requires: cuda cuda-compatible-runtime} Requires: alpaka diff --git a/rocm-flags.file b/rocm-flags.file new file mode 100644 index 00000000000..0c6ba9c8960 --- /dev/null +++ b/rocm-flags.file @@ -0,0 +1,11 @@ +### FILE rocm-flags +# define the ROCm compilation flags in a way that can be shared by SCRAM-based and regular tools + +# build support for Instinct MI100 (gfx908), Instinct MI210/MI250X (gfx90a), Instinct MI300X (gfx942), Radeon Pro W6800 (gfx1030), Radeon Pro W7800/W7900 (gfx1100), and Radeon Pro W7600 (gfx1102) +%define rocm_archs gfx908:sramecc+ gfx90a:sramecc+ gfx942:sramecc+ gfx1030 gfx1100 gfx1102 + +# LLVM/hipcc style for listing the supported ROCm compute architectures +%define hipcc_flags_rocm_archs %(echo $(for ARCH in %rocm_archs; do echo "--offload-arch=$ARCH"; done)) + +# all ROCm flags +%define rocm_flags %{hipcc_flags_rocm_archs} diff --git a/rocm-rocrand.spec b/rocm-rocrand.spec deleted file mode 100644 index d152fe63460..00000000000 --- a/rocm-rocrand.spec +++ /dev/null @@ -1,34 +0,0 @@ -### RPM external rocm-rocrand 6.2.4 -## NOCOMPILER - -%if 0%{?rhel} == 7 -# allow rpm2cpio dependency on the bootstrap bundle -%undefine drop_bootstrap_lib -%define drop_bootstrap_lib true -%define repository repo.radeon.com/rocm/yum -%else -%define repository repo.radeon.com/rocm/rhel%{rhel} -%endif - -# AMD repositories are numbered 6.1, 6.1.1, 6.1.2, ..., 6.2 -# without any .0 in the directory name -%define repoversion %(echo %{realversion} | sed -e's/\.0$//') - -Source0: https://%{repository}/%{repoversion}/main/rocrand-3.1.1.60204-139.el%{rhel}.%{_arch}.rpm -Source1: https://%{repository}/%{repoversion}/main/rocrand-devel-3.1.1.60204-139.el%{rhel}.%{_arch}.rpm -Requires: rocm -AutoReq: no - -%prep - -%build -rpm2cpio %{SOURCE0} | cpio -idmv -rpm2cpio %{SOURCE1} | cpio -idmv - -%install -rmdir %{i} -mv opt/rocm-%{realversion} %{i} -rm -rf opt -rm -rf usr - -%post diff --git a/rocm.spec b/rocm.spec index d26ac00bcc7..dcd203f1bda 100644 --- a/rocm.spec +++ b/rocm.spec @@ -23,43 +23,39 @@ %define rocprofiler_register_pkg rocprofiler-register-%{rocprofiler_register_tag} Source0: https://%{repository}/%{repoversion}/main/amd-smi-lib-24.7.1.60302-66.el%{rhel}.%{_arch}.rpm -Source1: https://%{repository}/%{repoversion}/main/amd-smi-lib-debuginfo-24.7.1.60302-66.el%{rhel}.%{_arch}.rpm -Source2: https://%{repository}/%{repoversion}/main/comgr-2.8.0.60302-66.el%{rhel}.%{_arch}.rpm -Source3: https://%{repository}/%{repoversion}/main/comgr-debuginfo-2.8.0.60302-66.el%{rhel}.%{_arch}.rpm -Source4: https://%{repository}/%{repoversion}/main/hip-devel-6.3.42134.60302-66.el%{rhel}.%{_arch}.rpm -Source5: https://%{repository}/%{repoversion}/main/hip-runtime-amd-6.3.42134.60302-66.el%{rhel}.%{_arch}.rpm -Source6: https://%{repository}/%{repoversion}/main/hip-runtime-amd-debuginfo-6.3.42134.60302-66.el%{rhel}.%{_arch}.rpm -Source7: https://%{repository}/%{repoversion}/main/hipcc-1.1.1.60302-66.el%{rhel}.%{_arch}.rpm -Source8: https://%{repository}/%{repoversion}/main/hipcc-debuginfo-1.1.1.60302-66.el%{rhel}.%{_arch}.rpm -Source9: https://%{repository}/%{repoversion}/main/hsa-rocr-1.14.0.60302-66.el%{rhel}.%{_arch}.rpm -Source10: https://%{repository}/%{repoversion}/main/hsa-rocr-debuginfo-1.14.0.60302-66.el%{rhel}.%{_arch}.rpm -Source11: https://%{repository}/%{repoversion}/main/openmp-extras-devel-18.63.0.60302-66.el%{rhel}.%{_arch}.rpm -Source12: https://%{repository}/%{repoversion}/main/openmp-extras-runtime-18.63.0.60302-66.el%{rhel}.%{_arch}.rpm -Source13: https://%{repository}/%{repoversion}/main/rocm-core-6.3.2.60302-66.el%{rhel}.%{_arch}.rpm -Source14: https://%{repository}/%{repoversion}/main/rocm-dbgapi-0.77.0.60302-66.el%{rhel}.%{_arch}.rpm -Source15: https://%{repository}/%{repoversion}/main/rocm-dbgapi-debuginfo-0.77.0.60302-66.el%{rhel}.%{_arch}.rpm -Source16: https://%{repository}/%{repoversion}/main/rocm-device-libs-1.0.0.60302-66.el%{rhel}.%{_arch}.rpm -Source17: https://%{repository}/%{repoversion}/main/rocm-llvm-18.0.0.25012.60302-66.el%{rhel}.%{_arch}.rpm -Source18: https://%{repository}/%{repoversion}/main/rocm-smi-lib-7.4.0.60302-66.el%{rhel}.%{_arch}.rpm -Source19: https://%{repository}/%{repoversion}/main/rocm-smi-lib-debuginfo-7.4.0.60302-66.el%{rhel}.%{_arch}.rpm -Source20: https://%{repository}/%{repoversion}/main/rocminfo-1.0.0.60302-66.el%{rhel}.%{_arch}.rpm -Source21: https://%{repository}/%{repoversion}/main/rocminfo-debuginfo-1.0.0.60302-66.el%{rhel}.%{_arch}.rpm -Source22: https://%{repository}/%{repoversion}/main/rocprim-devel-3.3.0.60302-66.el%{rhel}.%{_arch}.rpm -Source23: https://%{repository}/%{repoversion}/main/rocprofiler-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm -Source24: https://%{repository}/%{repoversion}/main/rocprofiler-compute-3.0.0.60302-66.el%{rhel}.%{_arch}.rpm -Source25: https://%{repository}/%{repoversion}/main/rocprofiler-debuginfo-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm -Source26: https://%{repository}/%{repoversion}/main/rocprofiler-devel-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm -Source27: https://%{repository}/%{repoversion}/main/rocprofiler-docs-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm -Source28: https://%{repository}/%{repoversion}/main/rocprofiler-plugins-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm -Source29: https://%{repository}/%{repoversion}/main/rocprofiler-plugins-debuginfo-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm -Source30: https://%{repository}/%{repoversion}/main/rocprofiler-register-0.4.0.60302-66.el%{rhel}.%{_arch}.rpm -Source31: https://%{repository}/%{repoversion}/main/rocprofiler-systems-0.1.1.60302-66.el%{rhel}.%{_arch}.rpm -Source32: https://%{repository}/%{repoversion}/main/rocprofiler-systems-debuginfo-0.1.1.60302-66.el%{rhel}.%{_arch}.rpm -Source33: https://%{repository}/%{repoversion}/main/rocthrust-devel-3.3.0.60302-66.el%{rhel}.%{_arch}.rpm - +Source1: https://%{repository}/%{repoversion}/main/comgr-2.8.0.60302-66.el%{rhel}.%{_arch}.rpm +Source2: https://%{repository}/%{repoversion}/main/hip-devel-6.3.42134.60302-66.el%{rhel}.%{_arch}.rpm +Source3: https://%{repository}/%{repoversion}/main/hip-runtime-amd-6.3.42134.60302-66.el%{rhel}.%{_arch}.rpm +Source4: https://%{repository}/%{repoversion}/main/hipcc-1.1.1.60302-66.el%{rhel}.%{_arch}.rpm +Source5: https://%{repository}/%{repoversion}/main/hsa-rocr-1.14.0.60302-66.el%{rhel}.%{_arch}.rpm +Source6: https://%{repository}/%{repoversion}/main/hsa-rocr-devel-1.14.0.60302-66.el%{rhel}.%{_arch}.rpm +Source7: https://%{repository}/%{repoversion}/main/openmp-extras-devel-18.63.0.60302-66.el%{rhel}.%{_arch}.rpm +Source8: https://%{repository}/%{repoversion}/main/openmp-extras-runtime-18.63.0.60302-66.el%{rhel}.%{_arch}.rpm +Source9: https://%{repository}/%{repoversion}/main/rocm-core-6.3.2.60302-66.el%{rhel}.%{_arch}.rpm +Source10: https://%{repository}/%{repoversion}/main/rocm-dbgapi-0.77.0.60302-66.el%{rhel}.%{_arch}.rpm +Source11: https://%{repository}/%{repoversion}/main/rocm-device-libs-1.0.0.60302-66.el%{rhel}.%{_arch}.rpm +Source12: https://%{repository}/%{repoversion}/main/rocm-llvm-18.0.0.25012.60302-66.el%{rhel}.%{_arch}.rpm +Source13: https://%{repository}/%{repoversion}/main/rocm-smi-lib-7.4.0.60302-66.el%{rhel}.%{_arch}.rpm +Source14: https://%{repository}/%{repoversion}/main/rocminfo-1.0.0.60302-66.el%{rhel}.%{_arch}.rpm +Source15: https://%{repository}/%{repoversion}/main/rocprim-devel-3.3.0.60302-66.el%{rhel}.%{_arch}.rpm +Source16: https://%{repository}/%{repoversion}/main/rocprofiler-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm +Source17: https://%{repository}/%{repoversion}/main/rocprofiler-compute-3.0.0.60302-66.el%{rhel}.%{_arch}.rpm +Source18: https://%{repository}/%{repoversion}/main/rocprofiler-devel-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm +Source19: https://%{repository}/%{repoversion}/main/rocprofiler-docs-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm +Source20: https://%{repository}/%{repoversion}/main/rocprofiler-plugins-2.0.60302.60302-66.el%{rhel}.%{_arch}.rpm +Source21: https://%{repository}/%{repoversion}/main/rocprofiler-register-0.4.0.60302-66.el%{rhel}.%{_arch}.rpm +Source22: https://%{repository}/%{repoversion}/main/rocprofiler-systems-0.1.1.60302-66.el%{rhel}.%{_arch}.rpm +Source23: https://%{repository}/%{repoversion}/main/hipcub-devel-3.3.0.60302-66.el%{rhel}.%{_arch}.rpm +Source24: https://%{repository}/%{repoversion}/main/rocthrust-devel-3.3.0.60302-66.el%{rhel}.%{_arch}.rpm +Source25: https://%{repository}/%{repoversion}/main/hiprand-2.11.1.60302-66.el%{rhel}.%{_arch}.rpm +Source26: https://%{repository}/%{repoversion}/main/hiprand-devel-2.11.1.60302-66.el%{rhel}.%{_arch}.rpm +Source27: https://%{repository}/%{repoversion}/main/rocrand-3.2.0.60302-66.el%{rhel}.%{_arch}.rpm +Source28: https://%{repository}/%{repoversion}/main/rocrand-devel-3.2.0.60302-66.el%{rhel}.%{_arch}.rpm +Source29: https://%{repository}/%{repoversion}/main/rccl-2.21.5.60302-66.el%{rhel}.%{_arch}.rpm +Source30: https://%{repository}/%{repoversion}/main/rccl-devel-2.21.5.60302-66.el%{rhel}.%{_arch}.rpm # sources for rocprofiler-register -Source34: git+https://github.com/ROCm/rocprofiler-register.git?obj=%{rocprofiler_register_branch}/%{rocprofiler_register_tag}&export=%{rocprofiler_register_pkg}&submodules=1&output=/%{rocprofiler_register_pkg}.tgz +Source99: git+https://github.com/ROCm/rocprofiler-register.git?obj=%{rocprofiler_register_branch}/%{rocprofiler_register_tag}&export=%{rocprofiler_register_pkg}&submodules=1&output=/%{rocprofiler_register_pkg}.tgz BuildRequires: gmake cmake Requires: numactl zstd fmt @@ -70,7 +66,7 @@ AutoReq: no # unpack rocprofiler-register mkdir src -tar xavf %{SOURCE34} -C src +tar xavf %{SOURCE99} -C src %build rpm2cpio %{SOURCE0} | cpio -idmv @@ -104,9 +100,6 @@ rpm2cpio %{SOURCE27} | cpio -idmv rpm2cpio %{SOURCE28} | cpio -idmv rpm2cpio %{SOURCE29} | cpio -idmv rpm2cpio %{SOURCE30} | cpio -idmv -rpm2cpio %{SOURCE31} | cpio -idmv -rpm2cpio %{SOURCE32} | cpio -idmv -rpm2cpio %{SOURCE33} | cpio -idmv # build rocprofiler-register sed -i -e 's|add_subdirectory(external)|find_package(fmt REQUIRED)\nadd_subdirectory(external)|' src/%{rocprofiler_register_pkg}/CMakeLists.txt diff --git a/scram-tools.file/tool-env.file b/scram-tools.file/tool-env.file index 575db77b7ae..1bde44f7360 100644 --- a/scram-tools.file/tool-env.file +++ b/scram-tools.file/tool-env.file @@ -13,6 +13,7 @@ export COMPILER_WARNINGS="%{?warning_flags}" export ORACLE_ENV_ROOT="" export CUDA_FLAGS="%{nvcc_cuda_flags}" export CUDA_HOST_CXXFLAGS="%{nvcc_flags_stdcxx}" +export ROCM_FLAGS="%{rocm_flags}" export LTO_FLAGS="%{?lto_build_flags}" export PGO_FLAGS="%{?pgo_build_flags}" if [ $(echo ' %requiredtools ' | grep ' python3 ' |wc -l) -gt 0 ] ; then export PYTHON3_LIB_SITE_PACKAGES ; fi diff --git a/scram-tools.file/tools/rocm-rocrand/rocm-rocrand.xml b/scram-tools.file/tools/rocm-rocrand/rocm-rocrand.xml deleted file mode 100644 index 90f03f5451c..00000000000 --- a/scram-tools.file/tools/rocm-rocrand/rocm-rocrand.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - - - diff --git a/scram-tools.file/tools/rocm/rocm-rccl.xml b/scram-tools.file/tools/rocm/rocm-rccl.xml new file mode 100644 index 00000000000..a8dd9ca4909 --- /dev/null +++ b/scram-tools.file/tools/rocm/rocm-rccl.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/scram-tools.file/tools/rocm/rocm-rocrand.xml b/scram-tools.file/tools/rocm/rocm-rocrand.xml new file mode 100644 index 00000000000..0dc371077d1 --- /dev/null +++ b/scram-tools.file/tools/rocm/rocm-rocrand.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/scram-tools.file/tools/rocm/rocm.xml b/scram-tools.file/tools/rocm/rocm.xml index 067d4f75f04..c26fc86f75c 100644 --- a/scram-tools.file/tools/rocm/rocm.xml +++ b/scram-tools.file/tools/rocm/rocm.xml @@ -1,5 +1,5 @@ - - + + @@ -11,12 +11,7 @@ - - - - - - + %if "%{default_microarch_name}" %if "%{default_microarch_name}" != "%{min_microarch_name}" @@ -28,5 +23,6 @@ + diff --git a/toolflags.file b/toolflags.file index af29ff42caa..4638bee9bd6 100644 --- a/toolflags.file +++ b/toolflags.file @@ -1,6 +1,7 @@ ## INCLUDE compilation_flags ## INCLUDE compilation_flags_lto ## INCLUDE cuda-flags +## INCLUDE rocm-flags ## INCLUDE cpp-standard ## INCLUDE warning-flags ## INCLUDE vecgeom-opt