From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5F2A01582EF for ; Fri, 21 Feb 2025 12:04:43 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id 4A22734315E for ; Fri, 21 Feb 2025 12:04:43 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 43091110482; Fri, 21 Feb 2025 12:04:12 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id 2DDDF11047E for ; Fri, 21 Feb 2025 12:04:12 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id D84213430F0 for ; Fri, 21 Feb 2025 12:04:11 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6346327ED for ; Fri, 21 Feb 2025 12:04:08 +0000 (UTC) From: "David Roman" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "David Roman" Message-ID: <1740063474.e01288b79918003e5e4a26936c4ce46aa746e5b3.davidroman@gentoo> Subject: [gentoo-commits] repo/proj/guru:master commit in: sci-misc/llama-cpp/ X-VCS-Repository: repo/proj/guru X-VCS-Files: sci-misc/llama-cpp/llama-cpp-0_pre4576.ebuild sci-misc/llama-cpp/llama-cpp-9999.ebuild sci-misc/llama-cpp/metadata.xml X-VCS-Directories: sci-misc/llama-cpp/ X-VCS-Committer: davidroman X-VCS-Committer-Name: David Roman X-VCS-Revision: e01288b79918003e5e4a26936c4ce46aa746e5b3 X-VCS-Branch: master Date: Fri, 21 Feb 2025 12:04:08 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 33f97147-7bc0-4d33-bbb6-1f3278b11901 X-Archives-Hash: 005da357441575c72067534db8826b19 commit: e01288b79918003e5e4a26936c4ce46aa746e5b3 Author: Sergey Alirzaev riseup net> AuthorDate: Thu Feb 20 14:57:54 2025 +0000 Commit: David Roman gmail com> CommitDate: Thu Feb 20 14:57:54 2025 +0000 URL: https://gitweb.gentoo.org/repo/proj/guru.git/commit/?id=e01288b7 sci-misc/llama-cpp: Add ROCm 6.3 HIP support Closes: https://bugs.gentoo.org/949856 Signed-off-by: Sergey Alirzaev riseup.net> sci-misc/llama-cpp/llama-cpp-0_pre4576.ebuild | 35 +++++++++++++++++++++++++-- sci-misc/llama-cpp/llama-cpp-9999.ebuild | 35 +++++++++++++++++++++++++-- sci-misc/llama-cpp/metadata.xml | 1 + 3 files changed, 67 insertions(+), 4 deletions(-) diff --git a/sci-misc/llama-cpp/llama-cpp-0_pre4576.ebuild b/sci-misc/llama-cpp/llama-cpp-0_pre4576.ebuild index 1e6b82c0d..b4db64b49 100644 --- a/sci-misc/llama-cpp/llama-cpp-0_pre4576.ebuild +++ b/sci-misc/llama-cpp/llama-cpp-0_pre4576.ebuild @@ -3,7 +3,9 @@ EAPI=8 -inherit cmake +ROCM_VERSION="6.3" + +inherit cmake rocm if [[ "${PV}" != "9999" ]]; then KEYWORDS="~amd64" @@ -21,15 +23,37 @@ HOMEPAGE="https://github.com/ggerganov/llama.cpp" LICENSE="MIT" SLOT="0" CPU_FLAGS_X86=( avx avx2 f16c ) -IUSE="curl openblas blis" +IUSE="curl openblas blis hip" REQUIRED_USE="?? ( openblas blis )" +AMDGPU_TARGETS_COMPAT=( + gfx900 + gfx90c + gfx902 + gfx1010 + gfx1011 + gfx1012 + gfx1030 + gfx1031 + gfx1032 + gfx1034 + gfx1035 + gfx1036 + gfx1100 + gfx1101 + gfx1102 + gfx1103 + gfx1150 + gfx1151 +) + # curl is needed for pulling models from huggingface # numpy is used by convert_hf_to_gguf.py DEPEND=" curl? ( net-misc/curl:= ) openblas? ( sci-libs/openblas:= ) blis? ( sci-libs/blis:= ) + hip? ( >=dev-util/hip-6.3:= ) " RDEPEND="${DEPEND} dev-python/numpy @@ -58,5 +82,12 @@ src_configure() { ) fi + if use hip; then + rocm_use_hipcc + mycmakeargs+=( + -DGGML_HIP=ON -DAMDGPU_TARGETS=$(get_amdgpu_flags) + ) + fi + cmake_src_configure } diff --git a/sci-misc/llama-cpp/llama-cpp-9999.ebuild b/sci-misc/llama-cpp/llama-cpp-9999.ebuild index 1e6b82c0d..b4db64b49 100644 --- a/sci-misc/llama-cpp/llama-cpp-9999.ebuild +++ b/sci-misc/llama-cpp/llama-cpp-9999.ebuild @@ -3,7 +3,9 @@ EAPI=8 -inherit cmake +ROCM_VERSION="6.3" + +inherit cmake rocm if [[ "${PV}" != "9999" ]]; then KEYWORDS="~amd64" @@ -21,15 +23,37 @@ HOMEPAGE="https://github.com/ggerganov/llama.cpp" LICENSE="MIT" SLOT="0" CPU_FLAGS_X86=( avx avx2 f16c ) -IUSE="curl openblas blis" +IUSE="curl openblas blis hip" REQUIRED_USE="?? ( openblas blis )" +AMDGPU_TARGETS_COMPAT=( + gfx900 + gfx90c + gfx902 + gfx1010 + gfx1011 + gfx1012 + gfx1030 + gfx1031 + gfx1032 + gfx1034 + gfx1035 + gfx1036 + gfx1100 + gfx1101 + gfx1102 + gfx1103 + gfx1150 + gfx1151 +) + # curl is needed for pulling models from huggingface # numpy is used by convert_hf_to_gguf.py DEPEND=" curl? ( net-misc/curl:= ) openblas? ( sci-libs/openblas:= ) blis? ( sci-libs/blis:= ) + hip? ( >=dev-util/hip-6.3:= ) " RDEPEND="${DEPEND} dev-python/numpy @@ -58,5 +82,12 @@ src_configure() { ) fi + if use hip; then + rocm_use_hipcc + mycmakeargs+=( + -DGGML_HIP=ON -DAMDGPU_TARGETS=$(get_amdgpu_flags) + ) + fi + cmake_src_configure } diff --git a/sci-misc/llama-cpp/metadata.xml b/sci-misc/llama-cpp/metadata.xml index c93fd3afb..70af1186d 100644 --- a/sci-misc/llama-cpp/metadata.xml +++ b/sci-misc/llama-cpp/metadata.xml @@ -6,6 +6,7 @@ Build a BLIS backend + Build a HIP (ROCm) backend Build an OpenBLAS backend