mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-10-12 17:51:11 -04:00
sci-misc/llama-cpp: version bump
Signed-off-by: Adam Pimentel <adam.pimentel@protonmail.com>
This commit is contained in:
2 files changed
+167
No files matched your search
@@ -1,4 +1,5 @@
|
||||
DIST ggml-org_models_tinyllamas_stories15M-q4_0-99dd1a73db5a37100bd4ae633f4cfce6560e1567.gguf 19077344 BLAKE2B 16e65adf9785e3091c51f1de59e5580f93fb47f79961513aeb3dbb8a0f5930f7120f0304f0f293a006170805e2b70ee1fcff0496b63356323d32c2caa55be8a8 SHA512 f9944886089958e0d97b1906cfd45020e0821c65429346e76fae29136c634ae5d039dffbae5933a95b0674f4acd87b656feb9f9e1b16dd434c5c9b5886f4f617
|
||||
DIST llama-cpp-0.3.0.tar.gz 36951021 BLAKE2B fa59feff83100b137710aeed91ffe721d057f891749aff8c0f5758c86dd22760d0456f808137aad7ee2faf8e14956f603dd6d0bbb44a0767f026c61a94ad2d30 SHA512 c92095a186920110cf9f542d00b004236d92f1ab3f22267bb6ed8fc4b65dc1c32b2705efab202849756d464ed2213c6ee4d5613482f56dad26ae6eb3ba16a91d
|
||||
DIST llama-cpp-0_pre6980.tar.gz 26431911 BLAKE2B b7d7c0dcdabde01acb816e73bc344564823dd1fc498fb98bf3c611b2d7a964af4d94f7cad533fe675a30685d510829160e392ab0f3bd16f4757a2f3446b8e3ca SHA512 33e63336ad7c0fc653acd409d9314ce3fc3755ed1c03b4806c647b7c80d91b3c883aec6633334555c3855a24276d4975a54c96af91df8d2f818d4dd1dbcbabfb
|
||||
DIST llama-cpp-0_pre7276.tar.gz 27765814 BLAKE2B d0553ab1dd29c9d93a18c6217aab4553faf09e385a94b90732a537bbcf9bded54d5cda28553543e2c0cc71b6a157bfb80a48405f3f8281c51525757967b33e16 SHA512 3035fe53fea2ca3b0f35e479f4eaec75e38a2ea670600445776cd6fa696fc83ca19eb6dd7cd2ab1da69e78293c62318b5182e6e5b3423ae6c1f00854c5132a4c
|
||||
DIST llama-cpp-0_pre7611.tar.gz 28622786 BLAKE2B 3c345645c9bcf07d8a513b9e883619b31b5254581f73429d638403758429fd2dfc5f78a22d538e8d88eb6c1be74bf805481af697480727ed750492ddec5c37fe SHA512 c6c4780d7e68adfc385b57c6f7530423f8205bfa283572b0d414d55e143c03307e98676e41ad527c37d7837f831f8ff24be0f7bf59e366ea82f3802cdc946821
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
# Copyright 2026 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
EAPI=8
|
||||
|
||||
ROCM_VERSION="7.1"
|
||||
|
||||
inherit cmake cuda rocm linux-info
|
||||
|
||||
TINY_LLAMAS_COMMIT="99dd1a73db5a37100bd4ae633f4cfce6560e1567"
|
||||
|
||||
DESCRIPTION="Port of Facebook's LLaMA model in C/C++"
|
||||
HOMEPAGE="https://github.com/ggml-org/llama.cpp"
|
||||
|
||||
if [[ ${PV} == *9999* ]]; then
|
||||
inherit git-r3
|
||||
EGIT_REPO_URI="https://github.com/ggml-org/llama.cpp.git"
|
||||
else
|
||||
MY_PV="v${PV}"
|
||||
SRC_URI="https://github.com/ggml-org/llama.cpp/archive/refs/tags/${MY_PV}.tar.gz -> ${P}.tar.gz"
|
||||
S="${WORKDIR}/llama.cpp-${PV}"
|
||||
KEYWORDS="~amd64"
|
||||
fi
|
||||
|
||||
SRC_URI+="
|
||||
examples? (
|
||||
https://huggingface.co/ggml-org/tiny-llamas/resolve/${TINY_LLAMAS_COMMIT}/stories15M-q4_0.gguf
|
||||
-> ggml-org_models_tinyllamas_stories15M-q4_0-${TINY_LLAMAS_COMMIT}.gguf
|
||||
)
|
||||
"
|
||||
|
||||
LICENSE="MIT"
|
||||
SLOT="0"
|
||||
CPU_FLAGS_X86=( avx avx2 f16c )
|
||||
|
||||
# wwma USE explained here: https://github.com/ggml-org/llama.cpp/blob/master/docs/build.md#hip
|
||||
IUSE="curl openblas +openmp blis rocm cuda opencl openssl vulkan flexiblas wmma examples"
|
||||
|
||||
REQUIRED_USE="
|
||||
?? (
|
||||
openblas
|
||||
blis
|
||||
flexiblas
|
||||
)
|
||||
wmma? (
|
||||
rocm
|
||||
)
|
||||
"
|
||||
|
||||
# curl is needed for pulling models from huggingface
|
||||
# numpy is used by convert_hf_to_gguf.py
|
||||
CDEPEND="
|
||||
curl? ( net-misc/curl:= )
|
||||
openblas? ( sci-libs/openblas:= )
|
||||
openmp? ( llvm-runtimes/openmp:= )
|
||||
blis? ( sci-libs/blis:= )
|
||||
flexiblas? ( sci-libs/flexiblas:= )
|
||||
rocm? (
|
||||
>=dev-util/hip-${ROCM_VERSION}:=
|
||||
>=sci-libs/hipBLAS-${ROCM_VERSION}:=[${ROCM_USEDEP}]
|
||||
wmma? (
|
||||
>=sci-libs/rocWMMA-${ROCM_VERSION}:=[${ROCM_USEDEP}]
|
||||
)
|
||||
)
|
||||
cuda? ( dev-util/nvidia-cuda-toolkit:= )
|
||||
openssl? ( dev-libs/openssl:= )
|
||||
"
|
||||
DEPEND="${CDEPEND}
|
||||
opencl? ( dev-util/opencl-headers )
|
||||
vulkan? (
|
||||
dev-util/spirv-headers
|
||||
dev-util/vulkan-headers
|
||||
)
|
||||
"
|
||||
RDEPEND="${CDEPEND}
|
||||
dev-python/numpy
|
||||
opencl? ( dev-libs/opencl-icd-loader )
|
||||
vulkan? ( media-libs/vulkan-loader )
|
||||
"
|
||||
BDEPEND="media-libs/shaderc"
|
||||
|
||||
pkg_setup() {
|
||||
if use rocm; then
|
||||
linux-info_pkg_setup
|
||||
if linux-info_get_any_version && linux_config_exists; then
|
||||
if ! linux_chkconfig_present HSA_AMD_SVM; then
|
||||
ewarn "To use ROCm/HIP, you need to have HSA_AMD_SVM option enabled in your kernel."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
src_prepare() {
|
||||
use cuda && cuda_src_prepare
|
||||
cmake_src_prepare
|
||||
if use examples; then
|
||||
mkdir -p "${BUILD_DIR}/tinyllamas" || die
|
||||
cp "${DISTDIR}/ggml-org_models_tinyllamas_stories15M-q4_0-${TINY_LLAMAS_COMMIT}.gguf" \
|
||||
"${BUILD_DIR}/tinyllamas/stories15M-q4_0.gguf" || die
|
||||
fi
|
||||
}
|
||||
|
||||
src_configure() {
|
||||
local mycmakeargs=(
|
||||
-DLLAMA_BUILD_TESTS=OFF
|
||||
-DLLAMA_BUILD_EXAMPLES=$(usex examples)
|
||||
-DLLAMA_BUILD_SERVER=ON
|
||||
-DCMAKE_SKIP_BUILD_RPATH=ON
|
||||
-DGGML_NATIVE=0 # don't set march
|
||||
-DGGML_RPC=ON
|
||||
-DLLAMA_CURL=$(usex curl)
|
||||
-DLLAMA_OPENSSL=$(usex openssl)
|
||||
-DBUILD_NUMBER="1"
|
||||
-DGENTOO_REMOVE_CMAKE_BLAS_HACK=ON
|
||||
-DGGML_CUDA=$(usex cuda)
|
||||
-DGGML_OPENCL=$(usex opencl)
|
||||
-DGGML_OPENMP=$(usex openmp)
|
||||
-DGGML_VULKAN=$(usex vulkan)
|
||||
|
||||
# avoid clashing with whisper.cpp
|
||||
-DCMAKE_INSTALL_LIBDIR="${EPREFIX}/usr/$(get_libdir)/llama.cpp"
|
||||
-DCMAKE_INSTALL_RPATH="${EPREFIX}/usr/$(get_libdir)/llama.cpp"
|
||||
)
|
||||
|
||||
if use openblas ; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=OpenBLAS
|
||||
)
|
||||
fi
|
||||
|
||||
if use blis ; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=FLAME
|
||||
)
|
||||
fi
|
||||
|
||||
if use flexiblas; then
|
||||
mycmakeargs+=(
|
||||
-DGGML_BLAS=ON -DGGML_BLAS_VENDOR=FlexiBLAS
|
||||
)
|
||||
fi
|
||||
|
||||
if use cuda; then
|
||||
local -x CUDAHOSTCXX="$(cuda_gccdir)"
|
||||
# tries to recreate dev symlinks
|
||||
cuda_add_sandbox
|
||||
addpredict "/dev/char/"
|
||||
fi
|
||||
|
||||
if use rocm; then
|
||||
rocm_use_hipcc
|
||||
mycmakeargs+=(
|
||||
-DGGML_HIP=ON -DAMDGPU_TARGETS=$(get_amdgpu_flags)
|
||||
-DGGML_HIP_ROCWMMA_FATTN=$(usex wmma)
|
||||
)
|
||||
fi
|
||||
|
||||
cmake_src_configure
|
||||
}
|
||||
|
||||
src_install() {
|
||||
cmake_src_install
|
||||
|
||||
# avoid clashing with whisper.cpp
|
||||
rm -rf "${ED}/usr/include"
|
||||
}
|
||||
Reference in new issue
Block a user