From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id EJJtGFwUH2SU5wAASxT56A (envelope-from ) for ; Sat, 25 Mar 2023 16:33:48 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id SCtMGFwUH2TyfwAAauVa8A (envelope-from ) for ; Sat, 25 Mar 2023 16:33:48 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 07159AB39 for ; Sat, 25 Mar 2023 16:33:47 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1679758428; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=9EycWXeJ1nZBoUyNR4a1yPJiO3y+m+Ad1kewedEPlGo=; b=HzXipFEOmEHowCvT/WN2oiyV1eqYVaSkT619SqasG5cIY3R9NjC64E1saGgQwvZssokU3C XlEWDeJm8sI6kkxpsKelf8BdSQbl9u7ZWecr5kHto3LLMX+XDLfcGD/Yv5s0zSbSnu9DEK HaEdp7wWTtQEruVGIlzhLGiYlRkMikdWmBn0u28Ya9D8G4RsYzBKXinjR6IQBe9Z1S3Y2W Z74JcbhDQ1NX036d5QDDxAgNwc6I+eS+y91ziX6fagvgcRJCe+Cvcm/ufkiDf+ykPD8jKj u0cRnqF8+YtVu4sgPs48tga0NAKwp5mcX3jUR54dBpTGBiu17eyL8elJ1WWnFA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1679758428; a=rsa-sha256; cv=none; b=lKb6ZE7YfxNu6ikyu/XrCWoePPTj7tkiVsoi39yy80904KDoN/1cGQNFVx5xN3Pdq+gdrE FucrEKCMRN6qrHv0i3tDGgWaiBUsZ1F90Yww8xS/6LXK6Aqi5IqfY0hDHmgRktcSx6D2dv d24t6sjfgc0vpBuO2kkaSZRrqrYfE/Hl21hjgO/ze0MJ1iJUnKkS5z2vQZUTu5C/40Kkp1 oaz6nqTZxws0nt6Ut3j+bbo5eDT+cKrf5WDZOP4N3bF7X+1q46Csnxjx/5Rlvj07Y8OunM GqjBzbqRoEg5QAycAogtNy+oCA6xtXFhvvEcby0BmRnzuQ3Jfk04dvSZeiy5PQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gnu.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pg5tE-0000oJ-Nm; Sat, 25 Mar 2023 11:33:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pg5tB-0000nG-CQ for guix-patches@gnu.org; Sat, 25 Mar 2023 11:33:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pg5tA-0004P8-4t for guix-patches@gnu.org; Sat, 25 Mar 2023 11:33:04 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pg5t8-0001p5-Lk for guix-patches@gnu.org; Sat, 25 Mar 2023 11:33:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62443] [PATCH 3/3] gnu: Add llama-cpp. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 25 Mar 2023 15:33:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62443 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: To: 62443@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 62443-submit@debbugs.gnu.org id=B62443.16797583606961 (code B ref 62443); Sat, 25 Mar 2023 15:33:02 +0000 Received: (at 62443) by debbugs.gnu.org; 25 Mar 2023 15:32:40 +0000 Received: from localhost ([127.0.0.1]:43270 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg5sl-0001o7-Vp for submit@debbugs.gnu.org; Sat, 25 Mar 2023 11:32:40 -0400 Received: from 3.mo576.mail-out.ovh.net ([188.165.52.203]:41773) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pg5si-0001nj-Gl for 62443@debbugs.gnu.org; Sat, 25 Mar 2023 11:32:37 -0400 Received: from director5.ghost.mail-out.ovh.net (unknown [10.108.1.68]) by mo576.mail-out.ovh.net (Postfix) with ESMTP id 0D2E9240BE for <62443@debbugs.gnu.org>; Sat, 25 Mar 2023 15:32:34 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-qsfm8 (unknown [10.110.115.59]) by director5.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 83D181FD5A; Sat, 25 Mar 2023 15:32:34 +0000 (UTC) Received: from ngraves.fr ([37.59.142.108]) by ghost-submission-6684bf9d7b-qsfm8 with ESMTPSA id OzTnGBIUH2Qh/wEA0T1X6A (envelope-from ); Sat, 25 Mar 2023 15:32:34 +0000 X-OVh-ClientIp: 90.45.24.108 Date: Sat, 25 Mar 2023 16:32:20 +0100 Message-Id: <20230325153220.26027-3-ngraves@ngraves.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230325153220.26027-1-ngraves@ngraves.fr> References: <20230325153220.26027-1-ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 1446218431806431970 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvdegkedgjeelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepvdehleeiffehtedvlefhffffjeefgfduhfetkeevheeiteduiedugfekuedtheejnecuffhomhgrihhnpehgihhthhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepiedvgeegfeesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheejiedpmhhouggvpehsmhhtphhouhht X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Migadu-Queue-Id: 07159AB39 X-Spam-Score: -5.33 X-Migadu-Spam-Score: -5.33 X-Migadu-Scanner: scn0.migadu.com From: Nicolas Graves via Guix-patches via Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN X-TUID: yaByH2Ch9FZG * gnu/packages/machine-learning.scm (llama-cpp): New variable. --- gnu/packages/machine-learning.scm | 64 +++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index df1989d316..6c78b14fc6 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -400,6 +400,70 @@ (define-public guile-aiscm (define-public guile-aiscm-next (deprecated-package "guile-aiscm-next" guile-aiscm)) +(define-public llama-cpp + (let ((commit "3cd8dde0d1357b7f11bdd25c45d5bf5e97e284a0") + (revision "0")) + (package + (name "llama-cpp") + (version (git-version "0.0.0" revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ggerganov/llama.cpp") + (commit (string-append "master-" (string-take commit 7))))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0i7c92cxqs31xklrn688978kk29agivgxjgvsb45wzm65gc6hm5c")))) + (build-system cmake-build-system) + (arguments + (list + #:modules '((ice-9 textual-ports) + (guix build utils) + ((guix build python-build-system) #:prefix python:) + (guix build cmake-build-system)) + #:imported-modules `(,@%cmake-build-system-modules + (guix build python-build-system)) + #:phases + #~(modify-phases %standard-phases + (add-before 'install 'install-python-scripts + (lambda _ + (let ((bin (string-append #$output "/bin/"))) + (define (make-script script) + (let ((suffix (if (string-suffix? ".py" script) "" ".py"))) + (call-with-input-file + (string-append "../source/" script suffix) + (lambda (input) + (call-with-output-file (string-append bin script) + (lambda (output) + (format output "#!~a/bin/python3\n~a" + #$(this-package-input "python") + (get-string-all input)))))) + (chmod (string-append bin script) #o555))) + (mkdir-p bin) + (make-script "convert-pth-to-ggml") + (make-script "convert-gptq-to-ggml") + (make-script "quantize.py") + (substitute* (string-append bin "quantize.py") + (("os\\.getcwd\\(\\), quantize_script_binary") + (string-append "\"" bin "\", quantize_script_binary")))))) + (add-after 'install-python-scripts 'wrap-python-scripts + (assoc-ref python:%standard-phases 'wrap)) + (replace 'install + (lambda _ + (let ((bin (string-append #$output "/bin/"))) + (install-file "bin/quantize" bin) + (copy-file "bin/main" (string-append bin "llama")))))))) + (propagated-inputs + (list python-pytorch python-sentencepiece python-numpy)) + (inputs (list python)) + (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 +of foundation language models. It requires models parameters to be downloaded +independently to be able to run a LLaMA model.") + (license license:expat)))) + (define-public mcl (package (name "mcl") -- 2.39.2