From d69399c7befdd98cda62d6a1788ae2aa7f104c5e Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Tue, 7 Jan 2025 06:41:06 +0000 Subject: gentoo auto-resync : 07:01:2025 - 06:41:06 --- sci-libs/composable-kernel/Manifest | 9 +- .../composable-kernel-6.1.1.ebuild | 2 +- .../composable-kernel-6.3.0.ebuild | 119 +++++++++++++++++++++ ...sable-kernel-6.3.0-conditional-ckprofiler.patch | 17 +++ ...mposable-kernel-6.3.0-conditional-kernels.patch | 16 +++ .../composable-kernel-6.3.0-no-inline-all.patch | 16 +++ sci-libs/composable-kernel/metadata.xml | 3 + 7 files changed, 179 insertions(+), 3 deletions(-) create mode 100644 sci-libs/composable-kernel/composable-kernel-6.3.0.ebuild create mode 100644 sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-ckprofiler.patch create mode 100644 sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-kernels.patch create mode 100644 sci-libs/composable-kernel/files/composable-kernel-6.3.0-no-inline-all.patch (limited to 'sci-libs/composable-kernel') diff --git a/sci-libs/composable-kernel/Manifest b/sci-libs/composable-kernel/Manifest index 52fbc7b635e5..0b7899cc6cb0 100644 --- a/sci-libs/composable-kernel/Manifest +++ b/sci-libs/composable-kernel/Manifest @@ -3,9 +3,14 @@ AUX composable-kernel-6.1.1-enable-examples.patch 379 BLAKE2B 38c3909c98686f97d5 AUX composable-kernel-6.1.1-fix-clang-17-no-offload-uniform-block.patch 918 BLAKE2B 04a17e4e9fd1a2c340a3d93a41f072ad24a836dcf5956644e3eeccb9269f7058a18135f324327aadf48f0e4369bcce8af900a72344515b46992c6deb68b15c71 SHA512 f8ac68ecc9d42673b1b66d3ddde80d042dab2e548a89ebeb50db153c3ec60308f1019a67d1a644d3320435936af0aef4e744b1c12a9f504dc32b18b808921767 AUX composable-kernel-6.1.1-fix-libcxx.patch 1383 BLAKE2B e1b77cb7926d843e71f8b3cc3642966ea1f5612cef527e08b7eddeca7dccbc7af2992d9bea9d61e84acd0dcb523fecbb5f8055a3f5916f6e5e56faa57c060a5b SHA512 fa2a5bb0f9347da46d509c47026f9af38933cb7d883c28f86c880b397341eb3f98fd67ecd46d4ddb857b16b3294933c18887abb99d221db558c5337bd224f841 AUX composable-kernel-6.1.1-no-git-no-hash.patch 688 BLAKE2B e3588a306816cf4380bf8987a6fc1660a70a6fc29b811d31381bae4aa2a00b55340d13f43246b70bbc439a462fcb8f664505bfaaac0e4cab793f2e4cb0611aed SHA512 94c59971b95b48e267280989d332240e236cea4cda8b6153945940f01c8f367a8da569403d802d733b7d46728861110b1d916b32be797e62c7a927a42b7b72b7 +AUX composable-kernel-6.3.0-conditional-ckprofiler.patch 483 BLAKE2B e82e3a25d9ea9d222dec60b04ac2047ee5f82a8d39586dd770d28df09efdbb004c94c5c74e7083543d17e1ae774a884d1c72055bfeff535a4688e5867265657f SHA512 b77875f6ebef73893a5161cbf1fcdac3cbed7964da562ae60c938fd442c3bab72ee266195a6b30cd6b7880a494e0c10f4d5814bf2d870824aad08f2fd157d71c +AUX composable-kernel-6.3.0-conditional-kernels.patch 837 BLAKE2B e803daf002c5711306df18c07ca2a9fea5e1b3cfe3bf589b8766e7b5eeefbd86f5773afda158161066e45c78f4a03684de27100143518df89a3eb25c2a255070 SHA512 ceb831cf69d90ce6c3638ab6d428aa1d0a4c737873a5227596a4a2f91973820773128438cc3dfe30cd2cb5fe730d57a16e28ac03ac1aa98171e3a6720021240e +AUX composable-kernel-6.3.0-no-inline-all.patch 831 BLAKE2B 44430951aff2aa3a74dc72d4092637fe777b4dd49b0fb588011e431a0426b9c19237d1b4ced996ece62b854f95be8c93891fc010af33a717f4c0350692263170 SHA512 9b0b3491f595572213246be8f78aa27ddb2b033d89b723effdd6a010658957e88be0c990f29eb4712f78aeebfc3e2a949712bbbda342c6440ea33465a2c9b3cf DIST composable-kernel-5.7.1.tar.gz 2158402 BLAKE2B 660c205c2a99cd17f29a9077e9e7b8b88e41f42ab40d92d0a235e7a60683a04234cce6b2eb6110265c2f461dd132c40151b2521b7d64df4cebb7f27094d8b2b0 SHA512 3931c5dbcab59513541103ebf7446311a1e318421a9e12aeafa7a98cf0717a75e1519140e6b2fbcaf4cb90829a11f03a724ff3ccc6636139c61667ac82558c55 DIST composable-kernel-6.1.1.tar.gz 2520967 BLAKE2B 549d76c5c36b0a273a4c51159abd162403ad035520f97c43dd4b66560ad30021199d2f4cf7e2c12ffe33beee2fb49604db6d7c40b3b33fdcbfde111b9d4833aa SHA512 3f7667cea91760447c3f6ac0bfc261c0bca95abafbfce209d1c889e04f01ec29849e8d7f0e1cb1d77a4309ac06b3c2557721a773e4a67be383de91668cb279b2 +DIST composable-kernel-6.3.0.tar.gz 3376552 BLAKE2B ad3dde27d0134fa8bf6b5935603f7cac17c959ab7b123e8d69cfe82bee188ade0fe9d3666d46d9819de479e875e46c0fdad2574f68a3bcf0e9acbb871f163b24 SHA512 4fa7be3f54d06d894dca7ef9fa8e3db24971fb857fee96e7ccff89844fa466789756d5f140d2791a984311d59a044b5351d0358e676c218ea0b0aadf60954d8e DIST gtest-1.14.0_p20220421.tar.gz 849107 BLAKE2B e9c32d9c1d98959583b696430a6be411f5d69e3db96669b16cffc0f1dcad42512391c0a4733f6e829c82953ff33fa243ee782f3cf6e86436f0d290f45d1a3db7 SHA512 967aac7d85da0e216fe13b17d10f894a31d763d9b88201bac7d3dfc37600552b5472d30a166a6ef27f2778677e73fd3e43d082695a48f47824262eb9cd4fcd2f EBUILD composable-kernel-5.7.1-r1.ebuild 1769 BLAKE2B 4e51c1eb8f331df322d9427b00d2cb8cba81f10b335533bc131142719d224d9bc89f98a0b54ec20d65f9622a081ab74d2a6bbae9289d1807958a9ded7f08fe4a SHA512 610bc66d4a374c6de7a0afb15a84255dae71911175c05674550478f5850b20f99a5bd0f5c40103c17e42ca774c80423d6a68b5bd0307be9c0ef3eaffa2912a58 -EBUILD composable-kernel-6.1.1.ebuild 1877 BLAKE2B 22e3ef40648776eee7c698a57a5c280dacc8b54ef8c55897e17f9c02e258e795844dd3b61e396ae8fd528b9270fc799da6475cfb0d0e77d0fd9ab3dfa78c89a4 SHA512 bbd1a01db84259a430bae47d768091b081a7a0ca04f809649290cd568e5b7e12d77a2b06f9909b5fc2cc12446c06a60751d89a702e05ebf18301ca4c949ddd86 -MISC metadata.xml 457 BLAKE2B 3ea71ee5eb1ef715b76f1ff2132c8d487f9360d5ea4a062bcb785eda19a997bed1ffcb251a98046661d647c3eac24db5cf5eeb9b3a6792c450c277038ac8c9e3 SHA512 efc4309c8c4ac98a59cb9634d64410d8a0c8b136accc13aff2f943594a0b4fe8d333010fd5ad59b46fbd7c2d29a244839bb3687cfef6e2c880431ffd80ed873b +EBUILD composable-kernel-6.1.1.ebuild 1885 BLAKE2B 07a795ad81748763eac5aa3fcb074eba9e11f96a8b81b7810f7bbe07e9ca8175bf00733376792ce3ed2385683b5cab6fc42e8396cc7720b8779d5a049a51f456 SHA512 5dcb45957ac5a8c659ea2f8cb796cc46b2d3432d44c5ae70d02e8a2835d80838610eff04e9a42e81c533afdc86f611419837e327251e5c9adb6eb648661ce2fb +EBUILD composable-kernel-6.3.0.ebuild 2865 BLAKE2B 6bb823d2f1938f77c200adf8565298b9a9b20ecce5e0526cb188761b4f1187a9e42b209b9aa7bae54347109c79a17a0b4cfa921cb028ea2e88d009d02ddaa3d7 SHA512 375e3c356575f539e85f95a9c44cf3746c63c29b2d758503a19351f1b25bc9d5a0118e03c99cd54216f890b1e4efc7dae2ef6c18c3bf40ad52ed1beb2954c610 +MISC metadata.xml 565 BLAKE2B 9644f1c5275c8a60e37a7220d561b3461a9e76d27d6bf2c640e09a3fa38c902d1b1efc51fbc34eb987ba930b635b7969a73ae079f9de9df34d7f75c0226bcfc6 SHA512 f4b46d0faa827007925289f210e12977d8ce852d77da1e46cd1427132782dab78cd05c0137fa9632ace209ecfedf7b6eb99d53dacaba856c451491aab6b223d6 diff --git a/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild b/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild index 44abf5d59c81..59853bd41e85 100644 --- a/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild +++ b/sci-libs/composable-kernel/composable-kernel-6.1.1.ebuild @@ -25,7 +25,7 @@ REQUIRED_USE="${ROCM_REQUIRED_USE}" RESTRICT="!test? ( test )" RDEPEND=" - dev-util/hip + dev-util/hip:${SLOT} >=dev-db/sqlite-3.17 sci-libs/rocBLAS:${SLOT}[${ROCM_USEDEP}] >=dev-libs/boost-1.72 diff --git a/sci-libs/composable-kernel/composable-kernel-6.3.0.ebuild b/sci-libs/composable-kernel/composable-kernel-6.3.0.ebuild new file mode 100644 index 000000000000..bbd6854cb1e8 --- /dev/null +++ b/sci-libs/composable-kernel/composable-kernel-6.3.0.ebuild @@ -0,0 +1,119 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# shellcheck disable=SC2317 +EAPI=8 + +ROCM_VERSION=${PV} +PYTHON_COMPAT=( python3_{10..13} python3_13t ) + +inherit cmake flag-o-matic python-r1 rocm + +GTEST_COMMIT="b85864c64758dec007208e56af933fc3f52044ee" +GTEST_FILE="gtest-1.14.0_p20220421.tar.gz" + +DESCRIPTION="High Performance Composable Kernel for AMD GPUs" +HOMEPAGE="https://github.com/ROCm/composable_kernel" +SRC_URI="https://github.com/ROCm/composable_kernel/archive/rocm-${PV}.tar.gz -> ${P}.tar.gz + test? ( https://github.com/google/googletest/archive/${GTEST_COMMIT}.tar.gz -> ${GTEST_FILE} )" +S="${WORKDIR}/composable_kernel-rocm-${PV}" + +LICENSE="MIT" +SLOT="0/$(ver_cut 1-2)" +KEYWORDS="~amd64" + +IUSE="debug profiler test" +REQUIRED_USE="${ROCM_REQUIRED_USE} ${PYTHON_REQUIRED_USE}" +RESTRICT="!test? ( test )" + +RDEPEND=" + dev-util/hip:${SLOT} + ${PYTHON_DEPS} +" + +DEPEND="${RDEPEND}" + +BDEPEND=" + dev-build/rocm-cmake +" + +PATCHES=( + "${FILESDIR}"/${PN}-6.1.1-enable-examples.patch + "${FILESDIR}"/${PN}-6.1.1-no-git-no-hash.patch + "${FILESDIR}"/${PN}-6.3.0-no-inline-all.patch + "${FILESDIR}"/${PN}-6.3.0-conditional-kernels.patch + "${FILESDIR}"/${PN}-6.3.0-conditional-ckprofiler.patch +) + +pkg_pretend() { + targets=($AMDGPU_TARGETS) + if [[ ${#targets[@]} -gt 1 ]]; then + ewarn "composable-kernel will be compiled for multiple GPU architectures," + ewarn "which will take a significant amount of time." + ewarn "Please consider setting AMDGPU_TARGETS USE_EXPAND variable to a single architecture." + fi +} + +src_prepare() { + sed -e '/-Werror/d' -i cmake/EnableCompilerWarnings.cmake || die + cmake_src_prepare +} + +src_configure() { + rocm_use_hipcc + + if ! use debug; then + append-cflags "-DNDEBUG" + append-cxxflags "-DNDEBUG" + CMAKE_BUILD_TYPE="Release" + else + CMAKE_BUILD_TYPE="Debug" + fi + + local mycmakeargs=( + -DCMAKE_SKIP_RPATH=ON + -DBUILD_DEV=OFF + -DGPU_TARGETS="$(get_amdgpu_flags)" + -DCMAKE_INSTALL_PREFIX="${EPREFIX}/usr" + -DBUILD_TESTING=$(usex test ON OFF) + -DCK_USE_PROFILER=$(usex profiler ON OFF) + -Wno-dev + ) + + if use test; then + mycmakeargs+=( + -DFETCHCONTENT_SOURCE_DIR_GTEST="${WORKDIR}/googletest-${GTEST_COMMIT}" + ) + fi + + cmake_src_configure +} + +src_install() { + cmake_src_install + + installation() { + python_domodule python/ck4inductor + + # install package-data manually, as there is no PEP517 compliance + shopt -s globstar + package_data=( + include/ck/**/*.hpp + library/src/tensor_operation_instance/gpu/gemm_universal/**/*.hpp + ) + shopt -u globstar + + inst_path="${D}$(python_get_sitedir)/ck4inductor" + for file in "${package_data[@]}"; do + location="${inst_path}/$(dirname "$file")" + mkdir -p "${location}" + cp "${file}" "${location}" + done + } + python_foreach_impl installation +} + +src_test() { + check_amdgpu + LD_LIBRARY_PATH="${BUILD_DIR}"/lib cmake_src_test -j1 +} diff --git a/sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-ckprofiler.patch b/sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-ckprofiler.patch new file mode 100644 index 000000000000..5a0c81de9879 --- /dev/null +++ b/sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-ckprofiler.patch @@ -0,0 +1,17 @@ +Add a flag to build without ckprofiler, which takes few GB of space and not used in many cases. +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -561,11 +561,13 @@ if(NOT GPU_ARCHS AND USER_GPU_TARGETS) + endif() + endif() + ++if(CK_USE_PROFILER) + rocm_package_setup_component(profiler + LIBRARY_NAME composablekernel + PACKAGE_NAME ckprofiler + ) + add_subdirectory(profiler) ++endif() + + if(CK_USE_CODEGEN AND (GPU_TARGETS MATCHES "gfx9" OR GPU_ARCHS)) + add_subdirectory(codegen) diff --git a/sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-kernels.patch b/sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-kernels.patch new file mode 100644 index 000000000000..64a8e0b96905 --- /dev/null +++ b/sci-libs/composable-kernel/files/composable-kernel-6.3.0-conditional-kernels.patch @@ -0,0 +1,16 @@ +Fix component discovery, when some targets are not installed. +Upstream bug: https://github.com/ROCm/composable_kernel/issues/1646 +--- a/Config.cmake.in ++++ b/Config.cmake.in +@@ -6,6 +6,10 @@ foreach(_comp ${composable_kernel_FIND_COMPONENTS}) + if(NOT _comp IN_LIST _composable_kernel_supported_components) + set(composable_kernel_FOUND False) + set(composable_kernel_NOT_FOUND_MESSAGE "Unsupported component: ${_comp}") ++ elseif(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/composable_kernel${_comp}Targets.cmake") ++ set(composable_kernel_FOUND False) ++ set(composable_kernel_NOT_FOUND_MESSAGE "Unsupported component for current targets: ${_comp}") ++ else() ++ include("${CMAKE_CURRENT_LIST_DIR}/composable_kernel${_comp}Targets.cmake") + endif() +- include("${CMAKE_CURRENT_LIST_DIR}/composable_kernel${_comp}Targets.cmake") + endforeach() diff --git a/sci-libs/composable-kernel/files/composable-kernel-6.3.0-no-inline-all.patch b/sci-libs/composable-kernel/files/composable-kernel-6.3.0-no-inline-all.patch new file mode 100644 index 000000000000..5ccf5239cb1e --- /dev/null +++ b/sci-libs/composable-kernel/files/composable-kernel-6.3.0-no-inline-all.patch @@ -0,0 +1,16 @@ +Flag -amdgpu-early-inline-all explodes memory consumption, so that build does not fit 64GB of RAM. +LLVM bug: https://github.com/llvm/llvm-project/issues/86332 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -213,11 +213,6 @@ if(NOT WIN32 AND check-coerce AND ${hip_VERSION_FLAT} GREATER 600241132 AND ${hi + message("Adding the amdgpu-coerce-illegal-types=1") + add_compile_options("SHELL: -mllvm -amdgpu-coerce-illegal-types=1") + endif() +-if(NOT WIN32 AND ${hip_VERSION_FLAT} GREATER 600241132) +- message("Adding -amdgpu-early-inline-all=true and -amdgpu-function-calls=false") +- add_compile_options("SHELL: -mllvm -amdgpu-early-inline-all=true") +- add_compile_options("SHELL: -mllvm -amdgpu-function-calls=false") +-endif() + # + # Seperate linking jobs from compiling + # Too many concurrent linking jobs can break the build diff --git a/sci-libs/composable-kernel/metadata.xml b/sci-libs/composable-kernel/metadata.xml index afd22272458c..304ae9aafa5e 100644 --- a/sci-libs/composable-kernel/metadata.xml +++ b/sci-libs/composable-kernel/metadata.xml @@ -9,6 +9,9 @@ sci@gentoo.org Science Project + + Build and install the Composable Kernal profiler (ckProfiler) + ROCm/composable_kernel -- cgit v1.2.3