[PATCH] gnu: llama-cpp: support OpenBLAS for faster prompt processing

  • Done
  • quality assurance status badge
Details
2 participants
  • John Fremlin
  • Christopher Baines
Owner
unassigned
Submitted by
John Fremlin
Severity
normal

Debbugs page

J
J
John Fremlin wrote on 3 Apr 20:46 -0700
(address . guix-patches@gnu.org)(name . John Fremlin)(address . john@fremlin.org)
7f9fe9d92aff101a12057e8571772428028dc6ae.1712202385.git.john@fremlin.org
OpenBLAS is recommended by https://github.com/ggerganov/llama.cpp

Change-Id: Iaf6f22252da13e2d6f503992878b35b0da7de0aa
---
gnu/packages/machine-learning.scm | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

Toggle diff (28 lines)
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm
index 225bff0ca2..ea3674ce3e 100644
--- a/gnu/packages/machine-learning.scm
+++ b/gnu/packages/machine-learning.scm
@@ -542,6 +542,8 @@ (define-public llama-cpp
(build-system cmake-build-system)
(arguments
(list
+ #:configure-flags
+ '(list "-DLLAMA_BLAS=ON" "-DLLAMA_BLAS_VENDOR=OpenBLAS")
#:modules '((ice-9 textual-ports)
(guix build utils)
((guix build python-build-system) #:prefix python:)
@@ -576,8 +578,9 @@ (define-public llama-cpp
(lambda _
(copy-file "bin/main" (string-append #$output "/bin/llama")))))))
(inputs (list python))
+ (native-inputs (list pkg-config))
(propagated-inputs
- (list python-numpy python-pytorch python-sentencepiece))
+ (list python-numpy python-pytorch python-sentencepiece openblas))
(home-page "https://github.com/ggerganov/llama.cpp")
(synopsis "Port of Facebook's LLaMA model in C/C++")
(description "This package provides a port to Facebook's LLaMA collection

base-commit: 1441a205b1ebb610ecfae945b5770734cbe8478c
--
2.41.0
C
C
Christopher Baines wrote on 5 Apr 04:35 -0700
(name . John Fremlin via Guix-patches via)(address . guix-patches@gnu.org)
871q7kghzt.fsf@cbaines.net
John Fremlin via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (7 lines)
> OpenBLAS is recommended by https://github.com/ggerganov/llama.cpp
>
> Change-Id: Iaf6f22252da13e2d6f503992878b35b0da7de0aa
> ---
> gnu/packages/machine-learning.scm | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)

Looks good to me, I tweaked the commit message a bit and pushed this to
master as d8a63bbcee616f224c10462dbfb117ec009c50d8.

Chris
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmYP4eZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XfO6BAAtxZdsEz/eVJTh/1r+U0chxX+DVw8a9y9
R3qG2Eiwi9Q9Pt4xhys/CB8KGFK7USrk22931rLLBib4PRyUFjxv2URtJ66eBMVB
DSUN2kbhKjcljUnfo1/pgi9bVkVSaoWcEH7b52QfoV0AhPxbTWOFGxlNn9tCCv43
x/DLaAiRulKn51FgZBxpgtJYvaJ0GvFg7+ufyZWXpu05544sErYeMl+hpnsAgPMw
H0YrnRbSV/Sym42hgft0+rkQACMZHbHrX8Pa0PjJnCqtiy394YwH2Dx/g3P/MYeH
K2rYQ9YUKX/Fq6P510kcr1FPfN8h9S0VA3q+9Ao0LJf68ejSHSPhTxOLqJqOseZK
XbdU7q5jO+ak0hU/7cgyOx0g0SlSM2tHCt+c09Goa3osfRE9G1stnl4Ib1OYAwyl
9YPIq3r84pQ7MBiFKwWH2qs4n8u680ah1LeJPhWXQTrAuAFh+UrZ/p76j185+aFv
VmYJL6jeKSvaYILU/8t7FpNrM9UO9dr0NC/2j3oeXb1A3tp/ygtmsTCm+r9wnodK
BWR9hMrU4O4SAqcr8y3xVK5cnN59yTSkVnVLTTSuIKeFdx8bL1jHcEBqJHaL4/kX
+k/C1WU6Xdz8ZPqaRiG4BsbGorWfp1u2HLBKiS5aRZbv/CJAYEOcX+zn37Pyxh2F
/W5FvZwW+Ak=
=jNzz
-----END PGP SIGNATURE-----

?
Your comment

This issue is archived.

To comment on this conversation send an email to 70175@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70175
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch