Message ID | 0c08fdb11c2641ece7d267340877c58f144df110.1720587166.git.atai@atai.org |
---|---|
State | New |
Headers |
Return-Path: <guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org> X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id BEA0527BBEA; Wed, 10 Jul 2024 05:54:09 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS 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 83B5527BBE2 for <patchwork@mira.cbaines.net>; Wed, 10 Jul 2024 05:54:06 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from <guix-patches-bounces@gnu.org>) id 1sRPL6-0007xN-2q; Wed, 10 Jul 2024 00:54:01 -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 <Debian-debbugs@debbugs.gnu.org>) id 1sRPL2-0007wy-Qp for guix-patches@gnu.org; Wed, 10 Jul 2024 00:53:56 -0400 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 <Debian-debbugs@debbugs.gnu.org>) id 1sRPL2-0001br-Id for guix-patches@gnu.org; Wed, 10 Jul 2024 00:53:56 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1sRPL8-0004QY-9T for guix-patches@gnu.org; Wed, 10 Jul 2024 00:54:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72027] [PATCH] gnu: Add whisper-cpp. Resent-From: Andy Tai <atai@atai.org> Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org> Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 10 Jul 2024 04:54:02 +0000 Resent-Message-ID: <handler.72027.B.172058721416961@debbugs.gnu.org> Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 72027 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72027@debbugs.gnu.org Cc: Andy Tai <atai@atai.org> X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.172058721416961 (code B ref -1); Wed, 10 Jul 2024 04:54:02 +0000 Received: (at submit) by debbugs.gnu.org; 10 Jul 2024 04:53:34 +0000 Received: from localhost ([127.0.0.1]:54669 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>) id 1sRPKf-0004PV-Jk for submit@debbugs.gnu.org; Wed, 10 Jul 2024 00:53:33 -0400 Received: from lists.gnu.org ([209.51.188.17]:41346) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from <lichengtai@gmail.com>) id 1sRPKe-0004PM-MW for submit@debbugs.gnu.org; Wed, 10 Jul 2024 00:53:33 -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 <lichengtai@gmail.com>) id 1sRPKY-0007us-HU for guix-patches@gnu.org; Wed, 10 Jul 2024 00:53:26 -0400 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <lichengtai@gmail.com>) id 1sRPKU-0001UX-B0 for guix-patches@gnu.org; Wed, 10 Jul 2024 00:53:26 -0400 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1fbc3a9d23bso7880295ad.1 for <guix-patches@gnu.org>; Tue, 09 Jul 2024 21:53:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1720587200; x=1721192000; darn=gnu.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=dhOaXpY1cmuGArDqJBo8imcnIQK18l68+Fud7zoZB5k=; b=ZSLTvSLLgjT6AsmkzhV7H5c9j7sWD65/tV2EYls+pgLE+DZfVcoUKQMC8AptSXENFR xf9x4cLOoqFXuAowa7BxLUGcp8G3lS7kMSUjRbrm+KvdhUHf8Os1smnivEMyMcNgOvgx nyB2p29B3qK1xVicXeM6QLEm0epjHxVea6n/RV/9cjkl8gLhZvkdF/zqht7HU9WrqRub qVyy+O12vIsQx61juE1SEJb8H2j9eftmIkx/GpGMXIf9++o+W/IrH2hdcbbptgvMvo4F 4HwViSqhmeaVCFjHSsR3l+hTWCkHC3HVjP3IJQiU2e9Oec7Bp6wrpdvRSV3m0XdixFCD Xevg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1720587200; x=1721192000; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dhOaXpY1cmuGArDqJBo8imcnIQK18l68+Fud7zoZB5k=; b=wuHOIrxmdop9eEIoHlUc3WkEUm/cgyexNk2h3j6DQQFmJUnzExeGNFVCJ/153GVX+z B4nYRrPUgOKwSSOMXFFHlSILucT67r6lHlzp7BP2VxRF9NdPlbuG+AgwmeFsdP8B44LN z4sIHyDNYtX5F7/TIw0wHR7SUR91FdArRNrXIugbuN/GMUtKsQDBeFR9DhwdG0piHERu ZPibx9unSRiKMXtz/kUf7PU5ZXg+QXtxmPGYYxNERIpgxP1iofIWrOO757/Ooj/TZTey AJTNL8zW98fyOpHAljyz6FJX0QWQSdm1lTOnXmIzz9wuXoHOod8+kKpdIz3UAhZRyY7b R/Ag== X-Gm-Message-State: AOJu0YyqwDMPwq+GNVCDy3yDqHFXm2P32WLdusgD4RQEaE3HQDYZQ5bc NgP1z//u68w8EtFoK5wcOWJBkJr2ri80O0vgQNRNCt/HCmRmSHrKOfNFIQ== X-Google-Smtp-Source: AGHT+IGlir7cytd/rNCfKhGf5tIgMPqyuydRYqBf1UBF65LlqMTZdNyxPCqLGMqdIOVANJLePmhXHw== X-Received: by 2002:a17:902:e84a:b0:1fb:6ddf:655a with SMTP id d9443c01a7336-1fbb6f0fa71mr38308745ad.69.1720587200175; Tue, 09 Jul 2024 21:53:20 -0700 (PDT) Received: from DEskMiniX300.. (c-98-37-226-154.hsd1.ca.comcast.net. [98.37.226.154]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fbb6a2a2e9sm24480885ad.97.2024.07.09.21.53.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jul 2024 21:53:19 -0700 (PDT) From: Andy Tai <atai@atai.org> Date: Tue, 9 Jul 2024 21:53:16 -0700 Message-Id: <0c08fdb11c2641ece7d267340877c58f144df110.1720587166.git.atai@atai.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::62b; envelope-from=lichengtai@gmail.com; helo=mail-pl1-x62b.google.com X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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: <guix-patches.gnu.org> List-Unsubscribe: <https://lists.gnu.org/mailman/options/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=unsubscribe> List-Archive: <https://lists.gnu.org/archive/html/guix-patches> List-Post: <mailto:guix-patches@gnu.org> List-Help: <mailto:guix-patches-request@gnu.org?subject=help> List-Subscribe: <https://lists.gnu.org/mailman/listinfo/guix-patches>, <mailto:guix-patches-request@gnu.org?subject=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 |
Series |
[bug#72027] gnu: Add whisper-cpp.
|
|
Commit Message
Andy Tai
July 10, 2024, 4:53 a.m. UTC
* gnu/packages/machine-learning.scm (whisper-cpp): New variable. Change-Id: If191f434a3f66b16afdc702069eaed1ca22e2427 --- gnu/packages/machine-learning.scm | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) base-commit: e13f7d48e5b989f5dbd27c19ac81989ec6b3ec6e
Comments
Hi Andy, Thanks for submitting this patch! I'm suffering from RSI pain at the moment and was tasked, as I ease back into working, with packaging this and the associated Emacs mode to help avoid RSI issues in the future. Seeing there is already a patch up, I am quite excited and thankful I don't have to write one myself! I had planned to review this patch, but I notice there are several TODOs. So instead, I will ask: what is the status of this patch? Is it in a state where it is ready for review, or is there more work to be done first? If it is the latter, what (if anything) can I do to help out? Thanks, Juli
Well, I know I just asked if this was ready for review, but I figured I'd go ahead and do some "low-hanging fruit review" while I wait for you to get a chance to respond ;) Fortunately, most of what I've noticed so far is minor and stylistic. There are some bigger, discussion-opening comments near the end. Firstly, TODO comments are conventionally spelled as one word. This is not grammatically correct, nor is it a requirement, but it is the convention and folks searching files for such comments will likely search for "TODO" rather than "TO DO". Secondly, the synopsis should probably either drop the "Port of" or change "in" to "to". I don't think this is a major issue; it just flows better like that imo. I wouldn't oppose merging over this so if you prefer it the way it is, that's fine. Next, the description wants expansion. It should be three to five sentences. The sentence there now is a fine start, though it needs ending punctuation. Perhaps a sentence explaining how this package can be used ("whisper-cpp can be integrated with other programs to provide speech-to-text support" or something) and one explaining what makes it unique ("because whisper-cpp uses a leading speech recognition model, it is able to perform speech recognition rapidly with relatively few resources"). You could perhaps mention that it can run on CPU as well as GPU, that it offers some integrations with certain hardware, or so on. Whatever you think is important or interesting; these are just some ideas :) Now we enter the discussion-launching comments. I notice that ggml is vendored. This one is tricky. Firstly, there is no standalone ggml package (yet; I saw your patch 65284). Usually, Guix only asks that dependencies be unvendored if there is already a standalone package for the dependency, so unless and until that is merged there is no real issue. Secondly, though, and this touches on the ggml patches, it seems that there are no formal releases of ggml yet, and development is happening in the repositories for whisper-cpp and llama-cpp as well as its own repository. It seems these three versions of ggml are all slightly out of sync with each other. It would be nice if upstream used git submodules to ensure their work was synchronized. Alas, we as Guix can't do anything about that, and we must ensure the packages we offer work correctly. The inconsistencies between these versions of ggml make me think packaging it separately would risk breakage. With that in mind, might it be best to drop the standalone ggml patchset and just let llama-cpp and whisper-cpp vendor their versions? While suboptimal because it results in building "the same package" multiple times, I would argue that the divergence in the code means they are not, in fact, the same package. Finally, is this package complete? Looking at the store directory for the package, I see headers and the like but no actual models. Is this sufficient for using the inference? Are client libraries or programs supposed to install models themselves? Or can this package be used to generate models as described in the project's README? If not, should it be able to? I am admittedly fairly ignorant about the machine learning ecosystem, so feel free to explain as much as you think may be necessary. My goal in these questions is ensuring users get what they expect from this package. Relatedly, if this package is complete but requires further setup, I would strongly support explaining that in the package description. As a user, I've encountered a few packages that require more setup and don't mention that they do, and I'm then frustrated and confused when I learn this from trying to use the package and then have no support from Guix in trying to make things work properly. (Another step beyond this may be offering a system service which performs configuration, but that can be a future, separate patch.) To circle back to what I mentioned in my first email, I would like to package the whisper.el Emacs mode[1]. Currently, whisper.el plans to install and compile whisper.cpp and its models itself; I think we as Guix should make this unnecessary for an imagined future emacs-whisper package. Looking forward to hearing from you, Juli [1] https://github.com/natrys/whisper.el
I will take a look of your review. Thanks On Fri, Aug 23, 2024 at 7:16 AM Juliana Sims <juli@incana.org> wrote: > > Hi Andy, > > Thanks for submitting this patch! I'm suffering from RSI pain at the > moment and was tasked, as I ease back into working, with packaging this > and the associated Emacs mode to help avoid RSI issues in the future. > Seeing there is already a patch up, I am quite excited and thankful I > don't have to write one myself! > > I had planned to review this patch, but I notice there are several > TODOs. So instead, I will ask: what is the status of this patch? Is > it in a state where it is ready for review, or is there more work to be > done first? If it is the latter, what (if anything) can I do to help > out? > > Thanks, > Juli > >
Juliana, I have made some minor adjustments per your review, in a new patch. I think the patch is usable but not complete; integration with ffmpeg is missing. So feel free to take over the patch and to update it with anything you see missing such as information on ML model. Generally I do not package ML models together with the software as a ML model can be tricky being free or not, so I avoid that. > > On Fri, Aug 23, 2024 at 7:16 AM Juliana Sims <juli@incana.org> wrote: > > > > Hi Andy, > > > > Thanks for submitting this patch! I'm suffering from RSI pain at the > > moment and was tasked, as I ease back into working, with packaging this > > and the associated Emacs mode to help avoid RSI issues in the future. > > Seeing there is already a patch up, I am quite excited and thankful I > > don't have to write one myself! > > > > I had planned to review this patch, but I notice there are several > > TODOs. So instead, I will ask: what is the status of this patch? Is > > it in a state where it is ready for review, or is there more work to be > > done first? If it is the latter, what (if anything) can I do to help > > out? > > > > Thanks, > > Juli > > > >
Hi, Oops, I had overlooked this oatch before. I've merged a variant of your patch to guix master as commit a707ebe5d3875a49523bc17de2d36af6f1c18f7e. Though I'm not sure what enabling SDL does when none of the programs are installed in the first place. How is this supposed to be? Cheers, Danny
diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 8ca9a6376e..61c25b49da 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -5982,6 +5982,29 @@ (define-public oneapi-dnnl-for-r-torch (sha256 (base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6")))))) +(define-public whisper-cpp + (package + (name "whisper-cpp") + (version "1.6.2") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ggerganov/whisper.cpp") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "01q4j602wkvsf9vw0nsazzgvjppf4fhpy90vqnm9affynyxhi0c4")))) + (build-system cmake-build-system) + (properties '((tunable? . #true))) ;use AVX512, FMA, etc. when available + (home-page "https://github.com/ggerganov/whisper.cpp") + (synopsis "Port of OpenAI's Whisper model in C/C++ ") + (description "This package is a high-performance inference of OpenAI's +Whisper automatic speech recognition (ASR) model, implemented in plain C/C++ +without dependencies") + (license license:expat))) + + (define-public python-gguf (package (name "python-gguf")