Skip to content

Commit

Permalink
llm-frameworks/llama-cpp: rename cublas USE-flag to cuda
Browse files Browse the repository at this point in the history
Following upstream here:
ggerganov/llama.cpp#6299 .

Signed-off-by: Eric Joldasov <bratishkaerik@landless-city.net>
  • Loading branch information
BratishkaErik committed Apr 13, 2024
1 parent 71dad9c commit b2769cd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
18 changes: 9 additions & 9 deletions llm-frameworks/llama-cpp/llama-cpp-9999.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ HOMEPAGE="https://github.com/ggerganov/llama.cpp"

LICENSE="MIT"
SLOT="0"
IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_avx512bw cpu_flags_x86_f16c cpu_flags_x86_fma3 clblast cublas cublas-fp16 +lto mpi"
IUSE="cpu_flags_x86_avx cpu_flags_x86_avx2 cpu_flags_x86_avx512bw cpu_flags_x86_f16c cpu_flags_x86_fma3 clblast cuda cuda-fp16 +lto mpi"

REQUIRED_USE="
cublas-fp16? ( cublas )
!cublas? ( !cublas-fp16 )
?? ( clblast cublas )
cuda-fp16? ( cuda )
!cuda? ( !cuda-fp16 )
?? ( clblast cuda )
"

RDEPEND="
mpi? (
virtual/mpi[cxx(+),threads(+)]
)
cublas? (
cuda? (
>=dev-util/nvidia-cuda-toolkit-11.8.0[profiler(+)]
)
clblast? (
Expand Down Expand Up @@ -54,7 +54,7 @@ src_prepare() {
# No need, will be detected by "lto" USE-flag and managed by CMake.
filter-lto

use cublas && cuda_add_sandbox
use cuda && cuda_add_sandbox

cmake_src_prepare
}
Expand Down Expand Up @@ -96,8 +96,8 @@ src_configure() {
-DLLAMA_ACCELERATE=OFF
-DLLAMA_METAL=OFF

-DLLAMA_CUBLAS="$(usex cublas)"
-DLLAMA_CUDA_F16="$(usex cublas-fp16)"
-DLLAMA_CUDA="$(usex cuda)"
-DLLAMA_CUDA_F16="$(usex cuda-fp16)"
-DLLAMA_HIPBLAS=OFF
-DLLAMA_CLBLAST="$(usex clblast)"
-DLLAMA_MPI="$(usex mpi)"
Expand All @@ -122,7 +122,7 @@ pkg_postinst() {
elog "'main' and 'parallel' binaries were renamed to 'llama-cpp' and 'llama-cpp-parallel' respectively,"
elog "to avoid install collisions. Other binaries were not renamed."

if use cublas; then
if use cuda; then
elog ""
elog "If you see runtime errors such as this:"
elog " * the provided PTX was compiled with an unsupported toolchain."
Expand Down
4 changes: 2 additions & 2 deletions llm-frameworks/llama-cpp/metadata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
<flag name="clblast">
Enable OpenCL acceleration using CLBlast library
</flag>
<flag name="cublas">
<flag name="cuda">
Enable BLAS acceleration using the CUDA cores of Nvidia GPU (requires 52 (Maxwell) architecture or newer)
</flag>
<flag name="cublas-fp16">
<flag name="cuda-fp16">
Use half-precision (16 bits) floating point for the CUDA calculations (requires 60 (Pascal) architecture or newer)
</flag>
<flag name="lto">
Expand Down

0 comments on commit b2769cd

Please sign in to comment.