From patchwork Sun Jan 14 20:32:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Pflug X-Patchwork-Id: 58868 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 5818C27BBE9; Sun, 14 Jan 2024 20:34:12 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, SPF_HELO_PASS,URIBL_BLOCKED,URIBL_SBL_A autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 94B1827BBE2 for ; Sun, 14 Jan 2024 20:34:10 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rP7BE-0006Et-HM; Sun, 14 Jan 2024 15:34:04 -0500 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 1rP7BD-0006Ei-8t for guix-patches@gnu.org; Sun, 14 Jan 2024 15:34:03 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rP7BD-0005jz-0j for guix-patches@gnu.org; Sun, 14 Jan 2024 15:34:03 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rP7BC-0003qR-5Q for guix-patches@gnu.org; Sun, 14 Jan 2024 15:34:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68455] [PATCH] gnu: llama-cpp: Update to 1873. Resent-From: David Pflug Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Jan 2024 20:34:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68455 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68455@debbugs.gnu.org Cc: David Pflug X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.170526442614753 (code B ref -1); Sun, 14 Jan 2024 20:34:01 +0000 Received: (at submit) by debbugs.gnu.org; 14 Jan 2024 20:33:46 +0000 Received: from localhost ([127.0.0.1]:44130 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rP7Aw-0003ps-1r for submit@debbugs.gnu.org; Sun, 14 Jan 2024 15:33:46 -0500 Received: from lists.gnu.org ([2001:470:142::17]:53944) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rP7As-0003pe-Or for submit@debbugs.gnu.org; Sun, 14 Jan 2024 15:33:44 -0500 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 1rP7An-0006AL-MY for guix-patches@gnu.org; Sun, 14 Jan 2024 15:33:37 -0500 Received: from mail-yw1-x112f.google.com ([2607:f8b0:4864:20::112f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rP7Al-0005WB-HA for guix-patches@gnu.org; Sun, 14 Jan 2024 15:33:37 -0500 Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-5edfcba97e3so85198057b3.2 for ; Sun, 14 Jan 2024 12:33:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tpflug-com.20230601.gappssmtp.com; s=20230601; t=1705264413; x=1705869213; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=3KCupbun9P+ig6od2iEITjV79dNbwvuswU9yKmLDQeg=; b=yB+sHgrdAoxOEszdYGS2neVE4675u6qH1tObJGZun7iLVq9BNJ8wDGZDbFq/LuMafk t4YWB/ZVUNMt9Xx2owAIM+DNr/e+itkQYCTqSPOw9FQtYL0TdSQO0WRcHU5cMiaowcpM wCuKM+vLumNUwNVYy8dmvQBrKJaU4YPvP9xCqpnUDjVgm1szBMu/roBItVFeLQPwerXN /MFxf6bFv/J/IZKzUepZK9BtR//YqLj2x6S50yVG84stRKA1cgqG4JR3kbvpk9RcEWw2 6Gj6KHCP6k9vd/0uQyf7MK9FgPlbjsEwi/FK6jK6IybLA5dzKsk/EbSJJWj1W/YQ26jv 2X5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705264413; x=1705869213; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=3KCupbun9P+ig6od2iEITjV79dNbwvuswU9yKmLDQeg=; b=NAsrc2U6HBWqFUTS9qWRso+aKt49xgYegmRG5YPAv5TbOkdwWBqNeD0Ct1hh1njdOL ZRa2xJC++j9nyb2hKBVF2z5PMEjldJjUK2LetZdpx/LsDTU/QsZtxE9VCpkUDRdtnSv0 3w19H4HGSDzB3Jsx8BOBpw2hxRZuV4VcKEctFEiWxYCTFY3di8nrfUpPAOTlEyWk8KRz oiryAqVwLotNjpuSDSZZAlV2zHbALtl0TVlwkauwzTdfuOb7oqZvBy1IKiR61gK3utEj 7s0HDL8gOEKhCHrkMRLmLCoLWQdU5VKY+qnkMFREH88gltX3wwIJAhTG1wq4mNQWiGyU FgSg== X-Gm-Message-State: AOJu0YwAKP2rGqciA4kk1xv70gkgXa8UZEYe4YTEo2/uoFexlM/TrF+3 SPt7/o+osaNEzV4xEnmofOimdQn1TrI9IfwOrXjlEs/8nYI= X-Google-Smtp-Source: AGHT+IH13l+30ZB7JlUxpx5E0tCXSQeKdz6rUx6IY6z5yR/+QXuPH/Wx1+oueUPS8VbUQ6Fdw8L20A== X-Received: by 2002:a05:690c:b08:b0:5ee:381a:3b33 with SMTP id cj8-20020a05690c0b0800b005ee381a3b33mr3485154ywb.94.1705264412860; Sun, 14 Jan 2024 12:33:32 -0800 (PST) Received: from localhost.localdomain (2603-9001-0600-4cc0-6e0b-84ff-fe93-fcd5.inf6.spectrum.com. [2603:9001:600:4cc0:6e0b:84ff:fe93:fcd5]) by smtp.gmail.com with ESMTPSA id cn7-20020a05690c0d0700b005f445345522sm3376470ywb.3.2024.01.14.12.33.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jan 2024 12:33:32 -0800 (PST) From: David Pflug Date: Sun, 14 Jan 2024 15:32:45 -0500 Message-ID: <20240114203255.26500-1-david@pflug.io> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::112f; envelope-from=david@tpflug.com; helo=mail-yw1-x112f.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01, URIBL_SBL_A=0.1 autolearn=no autolearn_force=no X-Spam_action: no action 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: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/machine-learning.scm (llama-cpp): Update to 1873. Change-Id: I091cd20192743c87b497ea3c5fd18a75ada75d9d --- gnu/packages/machine-learning.scm | 133 ++++++++++++++++++------------ 1 file changed, 78 insertions(+), 55 deletions(-) base-commit: 18393fcdddf5c3d834fa89ebf5f3925fc5b166ed diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 1616738399..0cdfe7bb08 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -22,6 +22,7 @@ ;;; Copyright © 2023 Navid Afkhami ;;; Copyright © 2023 Zheng Junjie <873216071@qq.com> ;;; Copyright © 2023 Troy Figiel +;;; Copyright © 2023 David Pflug ;;; ;;; This file is part of GNU Guix. ;;; @@ -517,63 +518,63 @@ (define-public guile-aiscm-next (deprecated-package "guile-aiscm-next" guile-aiscm)) (define-public llama-cpp - (let ((commit "f31b5397143009d682db90fd2a6cde83f1ef00eb") - (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 "0ys6n53n032zq1ll9f3vgxk8sw0qq7x3fi7awsyy13adzp3hn08p")))) - (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-lora-to-ggml") - (make-script "convert")))) - (add-after 'install-python-scripts 'wrap-python-scripts - (assoc-ref python:%standard-phases 'wrap)) - (replace 'install - (lambda _ - (copy-file "bin/main" (string-append #$output "/bin/llama"))))))) - (inputs (list python)) - (propagated-inputs - (list python-numpy python-pytorch python-sentencepiece)) - (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 + (package + (name "llama-cpp") + (version "1873") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ggerganov/llama.cpp") + (commit (string-append "b" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "11may9gkafg5bfma5incijvkypjgx9778gmygxp3x2dz1140809d")))) + (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-hf-to-gguf") + (make-script "convert-llama-ggml-to-gguf") + (make-script "convert-lora-to-ggml") + (make-script "convert-persimmon-to-gguf") + (make-script "convert")))) + (add-after 'install-python-scripts 'wrap-python-scripts + (assoc-ref python:%standard-phases 'wrap)) + (replace 'install + (lambda _ + (copy-file "bin/main" (string-append #$output "/bin/llama"))))))) + (inputs (list python)) + (propagated-inputs + (list python-numpy python-pytorch python-sentencepiece python-gguf)) + (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)))) + (license license:expat))) (define-public mcl (package @@ -5257,3 +5258,25 @@ (define-public oneapi-dnnl "OneAPI Deep Neural Network Library (oneDNN) is a cross-platform performance library of basic building blocks for deep learning applications.") (license license:asl2.0))) + +(define-public python-gguf + (package + (name "python-gguf") + (version "0.6.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "gguf" version)) + (sha256 + (base32 "0rbyc2h3kpqnrvbyjvv8a69l577jv55a31l12jnw21m1lamjxqmj")))) + (build-system pyproject-build-system) + (arguments + `(#:phases + (modify-phases %standard-phases + (delete 'check)))) + (inputs (list poetry python-pytest)) + (propagated-inputs (list python-numpy)) + (home-page "https://ggml.ai") + (synopsis "Read and write ML models in GGUF for GGML") + (description "Read and write ML models in GGUF for GGML") + (license license:expat)))