From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id 6HQxDTrRSGeSigAAqHPOHw:P1 (envelope-from ) for ; Thu, 28 Nov 2024 20:23:22 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id 6HQxDTrRSGeSigAAqHPOHw (envelope-from ) for ; Thu, 28 Nov 2024 21:23:22 +0100 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=dra2r5LD; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=kQvuAOdN; dmarc=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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1732825402; a=rsa-sha256; cv=none; b=WtOtkeFJivv9NbIYsvYlg1X8ZpljNfvqAdbHxrMdLD1YlFDHoAHoeJDsoiMc8AHttblRjw CycN+YU5xGLGdT7WMa+AqMoM+QghsEH/gaaxFu3GgL3sypUCYpabq5HCgnW6zO5Md/pf4w y9chrB9dBLAL6Le/6X+oByeFTMfqaqcXU7HwpbSfU6/TXddMzM9NZpnGqADpXlnMAUZPjn XnI+r6QiFLxVNZYYyMploMbc+K29ZNM9iU32sfzmAcnB+3JPtEunRzmDsoKHUAOt6GW9Z2 TPu/L8xD6gTb6ubg+acDfg27c29Yt5wZUtWjxbSHZaH4pJ3fkd7ijSa22kdUpw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=dra2r5LD; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=kQvuAOdN; dmarc=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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1732825402; h=from:from:sender:sender: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:dkim-signature; bh=bUrnFI1kxPo5msxTg1MFBfiHEPWhGTJbHGMSG+eOuz0=; b=lmAfNNcz2qIzph++bet4nMxAdmue4SpU7Jb+lKXFNoWeG+lduvzMgEWnjPOLJBwELLdMDs v4sRDyECxdWInxq1omVEhO5pQGpJ/7ioBFvGAIO+iWK0ih27+IEtAuSVs8//7YBkrcyGk6 ZShBOuXa8OHpQkN8jNHUg71sWE+e2WexitBiU+N1kLV9VG9EqcrCqSAejpArgLe+unR/eB Ib1p0jT+qo1tLVSAVzuyszZY7IMqrXoXa2ugxGEhBOm6NSyL8xsXPrbmxXctREPsn+bobS 1HURT/LhiMyM1HB+rZCopqcWsU3iDFuWufPJf6+rfZoRFwR9UTYRTLt94bTOcQ== 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 570314F9F for ; Thu, 28 Nov 2024 21:23:21 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGl2a-0005lC-V0; Thu, 28 Nov 2024 15:23:09 -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 1tGl2U-0005kc-JP for guix-patches@gnu.org; Thu, 28 Nov 2024 15:23: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 1tGl2U-0005D3-9r for guix-patches@gnu.org; Thu, 28 Nov 2024 15:23:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:From:To:In-Reply-To:References:Subject; bh=bUrnFI1kxPo5msxTg1MFBfiHEPWhGTJbHGMSG+eOuz0=; b=dra2r5LDxsZ1fY0jWpeKIYJLBoJ9FWDpymzqrx+1kHpXHZx4GIUFBQ8Eoz9aYKZs7W0f+f0FFuXOHG1DsYjstV25w5vlc6MJeKg5qewBYQaX9QJNQMrqFh/5oVi/oSs92VtsnBCy9tmNn9Thl1yFB02cGhz5JXRjNeL6XOd8Rcp1PbWnr7Fb+6W12pf9cMZaZYcU7bNhf1Bx9UWC08azMFqvcx66SZWTA0IRXTkA73TMhZGqcNvHKkNc2e3X1ZQZkoz46aKL0QggW96Upy1ESklkDmruQ7gi72b0rUbD7EoBgErKVatWpjUWl1ZQ3GOWxn9funwbitWLiCb/RrSoIg==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGl2U-0007HD-2n for guix-patches@gnu.org; Thu, 28 Nov 2024 15:23:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#72027] [PATCH v10] gnu: Add whisper-cpp. References: <0c08fdb11c2641ece7d267340877c58f144df110.1720587166.git.atai@atai.org> In-Reply-To: <0c08fdb11c2641ece7d267340877c58f144df110.1720587166.git.atai@atai.org> Resent-From: Andy Tai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 28 Nov 2024 20:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72027 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72027@debbugs.gnu.org Cc: Andy Tai Received: via spool by 72027-submit@debbugs.gnu.org id=B72027.173282534427907 (code B ref 72027); Thu, 28 Nov 2024 20:23:02 +0000 Received: (at 72027) by debbugs.gnu.org; 28 Nov 2024 20:22:24 +0000 Received: from localhost ([127.0.0.1]:39888 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGl1r-0007G3-Ur for submit@debbugs.gnu.org; Thu, 28 Nov 2024 15:22:24 -0500 Received: from mail-pl1-f171.google.com ([209.85.214.171]:45247) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGl1q-0007Fv-Ab for 72027@debbugs.gnu.org; Thu, 28 Nov 2024 15:22:22 -0500 Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-21271dc4084so8146815ad.2 for <72027@debbugs.gnu.org>; Thu, 28 Nov 2024 12:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732825281; x=1733430081; darn=debbugs.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=bUrnFI1kxPo5msxTg1MFBfiHEPWhGTJbHGMSG+eOuz0=; b=kQvuAOdNoaLIgOzyGD0kI1xS+myzCQdqtYQz2hDTIkyp+vosEN3/n2TskLcSyUFwRP uNaGtykUWXiekdt5LWT7emyyy2k3hO8XNIfA2g8LqC8KWiquZrkrvTeWanlt/TeoX3HO cz+GukX4DUYyX2sjIbZamY4AoIExSoFHgc+LMfne2+/Hr1MX4f0UuKrvrHGiTu5ORfAb pePe13psEX3/btgMtCptOmta6woo8SlIK3buEwwXNRg0Mv9q8/PCioQcLVjSpFYNOg0t DFEmGGEhItIXCCp3aPwNgf98NcVorXyaUPXzI3xW9Rbppq7Z60w6ifHprrLaoMOtK/gZ znzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732825281; x=1733430081; 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=bUrnFI1kxPo5msxTg1MFBfiHEPWhGTJbHGMSG+eOuz0=; b=G7/srbVQtz3zp93TWG6h7YORHStmYOUbkwnBDHixY8a7hyTKk34wNP4S651zWz8g+e y4QvBGsjmWLiLg1crjSbesZFuQbALvVrToWLls4V2MI3VqwofRd1RhF4nO8B+hyCQN5v OSc2Ef/mRU4mGC9IEK9/7y2z4gyCiaiFdWVuq161v9n8Z4kt2EJgbmfKgRG4aSAvTFau WpmJiiHy2XPnmkVtqD69OuG7dZVGi0toQWCGDK2KGxFZW3KSF3CmrQOVwm4vHyKTkPbC IRsSUJA277JzhWldTn3zuAKR0AYWJAaX7tm15zQOAi+QpDmVVrBWRvWcI7mCwJyaf+wd lwJw== X-Gm-Message-State: AOJu0YyPmNEQaqm0jszupyQFKbq/JoitPue7BIbai0jJ4jl+6Gz+HoGz qYw+PNL9QPmNxXzrnhTSjx6NDi2pNxLshpN0U/ZTrHIoBHY64q8/hqcIfg== X-Gm-Gg: ASbGnctJTptJ4gWG901QuV1Sy9Qxahp3nPwMNHD9Evcar5/N6ZVbGiD4wkqbsiYPetR F6dgRJpKUaGFF4n/+G7Ku0BluSzUu01UoccN5TJRok2BDAhNgcGnfmN3L+KgKvvEQqPDAnHYla1 OK9rtFy5ojb1zLRSk5y83oJjCxYSOCyptsWiP9/pLmKSgmkPHtzshvwKDOo/wVWirszzuT1Qtu1 Yq9pQBsG9a6fMoAgu6gugz1pCf/hMmF8zgkK7G7Jjk= X-Google-Smtp-Source: AGHT+IEqILj2CwvNPu1PitP56oiLHpuHkf4nDFMg71DmSyAM80FZ4cJStB+iWgG0jiQRbijOSf7Zyw== X-Received: by 2002:a17:902:d50d:b0:212:10ff:4b80 with SMTP id d9443c01a7336-21501e6971fmr95822355ad.54.1732825281181; Thu, 28 Nov 2024 12:21:21 -0800 (PST) Received: from DEskMiniX300.. ([38.84.157.61]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2153a70bbd1sm3628915ad.231.2024.11.28.12.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 12:21:20 -0800 (PST) From: Andy Tai Date: Thu, 28 Nov 2024 12:21:17 -0800 Message-Id: X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Spam-Score: -4.18 X-Spam-Score: -4.18 X-Migadu-Queue-Id: 570314F9F X-Migadu-Scanner: mx12.migadu.com X-TUID: w+KVgphottcX * gnu/packages/machine-learning.scm (whisper-cpp): New variable. * gnu/packages/patches/whisper-cpp-enable-tests.patch: New file. Change-Id: I8db67dc543c0a1280e2cc5e8c03945b9ccdb9975 --- gnu/packages/machine-learning.scm | 54 +++++++++++++++++++ .../patches/whisper-cpp-enable-tests.patch | 19 +++++++ 2 files changed, 73 insertions(+) create mode 100644 gnu/packages/patches/whisper-cpp-enable-tests.patch diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 3696a81ea6..69b3ac48fb 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -118,6 +118,7 @@ (define-module (gnu packages machine-learning) #:use-module (gnu packages rdf) #:use-module (gnu packages regex) #:use-module (gnu packages rpc) + #:use-module (gnu packages sdl) #:use-module (gnu packages serialization) #:use-module (gnu packages sphinx) #:use-module (gnu packages statistics) @@ -6067,6 +6068,59 @@ (define-public oneapi-dnnl-for-r-torch (sha256 (base32 "1zyw5rd8x346bb7gac9a7x3saviw3zvp6aqz2z1l9sv163vmjfz6")))))) +(define-public whisper-cpp + (package + (name "whisper-cpp") + (version "1.7.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 "0fbxf43dfz0wgc2qx57gm7a56nqpbmvkzgk68jfj1pa5r9qijzfb")) + (patches (search-patches "whisper-cpp-enable-tests.patch")))) + (build-system cmake-build-system) + (arguments + (list + #:configure-flags #~'("-DWHISPER_STANDALONE=TRUE" "-DWHISPER_SDL2=TRUE" + "-DWHISPER_BUILD_TESTS=TRUE" ) + ;; "-DWHISPER_FFMPEG=TRUE" ; TODO + #:phases #~(modify-phases %standard-phases + #$@(if (not (target-64bit?)) + '((add-after 'unpack 'skip-failing-tests + (lambda _ + ;; 32-bit system + ;; large model does not fit in RAM in 32-bit system, + ;; disable large model test + (substitute* "tests/CMakeLists.txt" + (("LABELS \"large\"") + "DISABLED true"))))) + '())))) + (inputs (list sdl2)) ;ffmpeg openblas ;TODO: + (native-inputs (list pkg-config)) + (properties '((tunable? . #t))) ;use AVX512, FMA, etc. when available + (home-page "https://github.com/ggerganov/whisper.cpp") + (synopsis "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, with +@itemize +@item AVX intrinsics support for x86 architectures +@item VSX intrinsics support for POWER architectures +@item Mixed F16 / F32 precision +@item 4-bit and 5-bit integer quantization support +@item Zero memory allocations at runtime +@item Support for CPU-only inference +@item Efficient GPU support for NVIDIA +@item OpenVINO Support +@item C-style API +@end itemize") + (license license:expat))) + (define-public python-gguf (package (name "python-gguf") diff --git a/gnu/packages/patches/whisper-cpp-enable-tests.patch b/gnu/packages/patches/whisper-cpp-enable-tests.patch new file mode 100644 index 0000000000..c4340d4879 --- /dev/null +++ b/gnu/packages/patches/whisper-cpp-enable-tests.patch @@ -0,0 +1,19 @@ +Distribution specific patch + +restored tests commented out in CMakeLists.txt upstream + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index c53252b..ee06015 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -176,8 +176,8 @@ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/whisper.pc" + # + + if (WHISPER_BUILD_TESTS AND NOT CMAKE_JS_VERSION) +- #include(CTest) +- #add_subdirectory(tests) ++ include(CTest) ++ add_subdirectory(tests) + endif () + + if (WHISPER_BUILD_EXAMPLES) base-commit: ce877a777e6ec089dc347e9883387d3080b471cf -- 2.34.1