From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id uKOeGTjWSGcAQgEAqHPOHw:P1 (envelope-from ) for ; Thu, 28 Nov 2024 20:44:40 +0000 Received: from aspmx1.migadu.com ([2001:41d0:303:e16b::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0.migadu.com with LMTPS id uKOeGTjWSGcAQgEAqHPOHw (envelope-from ) for ; Thu, 28 Nov 2024 21:44:40 +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=jDkrCDuK; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=MPbpRFe6; 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=1732826680; a=rsa-sha256; cv=none; b=jHIIv3bPFbhh8/cIxEDv9jcVyz32GEbT8/Qnn/ipQB0AE4K+YAwB7grlji/gJ6NNKFKfD9 N0dKlx4gmaSvGWKJIPoz6BCW/XfvWO+c+8y3pDAJP+7IsfrKqK/jrj9qtlkdVBUJhjnMfS knMrlGMqqlEj1rw34A7Al1yYGPB4fW420siIn7mrrh8ZugB12fWoLdugPCeb00MLkHTha2 UhFFogf8vQcRTPi5C0hGTJ62ogw3Y32MuvInDasV5Ydj9R+HtH5tx1Vn/BlDmtaZLTiYDB ZVxGCQTNY6Ho+1pMTMPNVQc2+51XWMJ9LdxcYAlXhML9goBgCSMKvT6QQibFiQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=jDkrCDuK; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=MPbpRFe6; 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=1732826680; 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=OT/4PcNjrK67EGFeo4exTYa4kpPjdbvXu+LwU7ofLSE=; b=jeaAJRGNhlX8RfmCZ3PXyrqjlcOKJcpYxdhd3/4Ub05uMTacUz0NEmEbewyyt57KiJW9Il bvQ5z+Gy4fFMlZKtMTLgfRaOKUtfVmL8PWoP+lOhSEVnXMnR2X0vQ6KDQNzS6r4pNG6FCm uW2gM+/deEjGwvmt4VMQ7CZjcHEYW7B/WdWdNbaW89szhqA4V0IBYiHa/VI5ccToH6+MSK 9/2XO40fWQ+W9Rq19+FXdakqcbtHuW4QnOEJZC0m1nD73Qh3WwE3BIUk1ejFHwgsnMqPI2 5l0E4K6i6xuNuIVSVWfbNzfJgH8/i9yRkIvYpfnBt8+wRSNzSgrWvFnnH2evuA== 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 99B727A8A0 for ; Thu, 28 Nov 2024 21:44:39 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGlN4-00082P-SJ; Thu, 28 Nov 2024 15:44:18 -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 1tGlMq-00080h-86 for guix-patches@gnu.org; Thu, 28 Nov 2024 15:44:06 -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 1tGlMo-0000Ef-Qf for guix-patches@gnu.org; Thu, 28 Nov 2024 15:44:03 -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=OT/4PcNjrK67EGFeo4exTYa4kpPjdbvXu+LwU7ofLSE=; b=jDkrCDuK5BFUiPkSOOsTay3EZXv+pUsBosu6OcUw9cvq7pzmuJoIMH8ZUE5pZCNyTP/ZSwKJhusESUoF6KsKz4IWUkSbDzE0IRU9jOhaT5nPMSiDAwwUs+q71dN6wmUnxUb4iGbEl4G30ZG0kLN2pMZ/nIoZySh1TBErHdr/DzqH+cb41RJ3sdNT6GD5V8QA+sNjtDKOij3ePRLdwRQAfiXCx3ahafFGhXOGHsajA5YJX2qIWhc6b6qjnNwsuzHPIU82BVZo1bAytEc2dANGUJxaYXAMCJlQEkeBDtJtsIpV3eUyj8tNwL5gAq+ps5E7DGK750xcZKOOLJuVZtJl3w==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGlMo-0008Je-Fw for guix-patches@gnu.org; Thu, 28 Nov 2024 15:44:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#72027] [PATCH v11] 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:44: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.173282660931904 (code B ref 72027); Thu, 28 Nov 2024 20:44:02 +0000 Received: (at 72027) by debbugs.gnu.org; 28 Nov 2024 20:43:29 +0000 Received: from localhost ([127.0.0.1]:39917 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGlMG-0008IW-La for submit@debbugs.gnu.org; Thu, 28 Nov 2024 15:43:29 -0500 Received: from mail-pl1-f178.google.com ([209.85.214.178]:50538) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGlME-0008IH-Fq for 72027@debbugs.gnu.org; Thu, 28 Nov 2024 15:43:27 -0500 Received: by mail-pl1-f178.google.com with SMTP id d9443c01a7336-21200c749bfso10031715ad.1 for <72027@debbugs.gnu.org>; Thu, 28 Nov 2024 12:43:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732826540; x=1733431340; 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=OT/4PcNjrK67EGFeo4exTYa4kpPjdbvXu+LwU7ofLSE=; b=MPbpRFe6iE4ja8aj+lIJbfIEeQQrweXVvQ0c/fZQgQOUKULc4/R+ZVycbC2JKcptrq BmIF5hkAx8RTrrr3D1BWhfIt8o5baNAK2tfxQqeTnQPP37dDYBpd7xiPX9NJD11VA754 exV2An3LpclI2W+SXwI5VcgR+sj+vSUABCaRqbda41sv2H+TiVORX7fdif64VenurZWS 9yIbRvRWEncDtKGFx+PzlXGc85TixMCa/kGxI4NVv6SqFxCcVP1ZHxKUgVS121IvsfCE 3gPKmLLDJhPC+AdSsw9K4yaYMoLAyrHjWvHfZst7O8VxxeUIzhtZmzJt+6sZaBjLMiG+ nAzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732826540; x=1733431340; 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=OT/4PcNjrK67EGFeo4exTYa4kpPjdbvXu+LwU7ofLSE=; b=ThbrdtZmeLKKbGo1DLZIoswUhyAJ6QtzuzE3ONJ6+J4JmcO/n2qHJfV1Gb8bP6VxyR t2VjbjgH9VGBkuqhCr+bwTLU/h/oKlVXEsVIqa8K5xPjtHgP6+t2K9F503mnmAXJ+7t1 RySBGffXF6GxuPCv9thd6QFGzP/nAdESyxYwVZAcMO6pQWLeZHZ3OUt7Mgro7JeOxygz 92Ez1/PU4pkDNM4Gim3D6i0QItRiy96ZdwOT+3ENdGN1HRV5CnmK/V1WdY4hL9APOy8r achzHhJa2yulbdRqRXUVe9DJledqvL/E+COJvPOVmMXuR7uFFT8iC2nl6FwUf1R3W5Li wixw== X-Gm-Message-State: AOJu0YzyM3hvysxAuZBZU+O0KDwBT3t8jsac3IGT6WourxZ5OgI5kDlt OZh97BrJMbyPLpciFDxqnlWAwMr1lSZPBHW2xkSFUHPeBckg47sLlkBfdA== X-Gm-Gg: ASbGncvTCBGjoxxP3PMSUPL3fTK3HQ4V9B/5f4kHTPrMVgsBswKdVh1bRuNmKOvRtzV 3c4UA4Xv/r1t+UFzFXjCdFKh4yZkZcMT/V6PtMzA+sZcK0g9f9GYRceTn3DfIdB7MZ/34QAmUOT X0bsI0OGndGympUlZfzJUoff8nqcNBJTbeea2w1cGJ9xRZ2+NqmQTlVN3pBqZpZ+HPGnvDYaR12 d4LNmTYYtUiehW0cYftow+cz73pLjrblrD2ny8+N9Q= X-Google-Smtp-Source: AGHT+IFpQg+q2bWs5Zh8dLJApOFhMrK8hGx/H/3VKqj2/WTjFEpYttB3XsQgv5ZU2SjLQpjilZIvkA== X-Received: by 2002:a17:902:f683:b0:20c:9d9e:9049 with SMTP id d9443c01a7336-21501381bd4mr107919985ad.22.1732826540443; Thu, 28 Nov 2024 12:42:20 -0800 (PST) Received: from DEskMiniX300.. ([38.84.157.61]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21527515731sm15415405ad.192.2024.11.28.12.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Nov 2024 12:42:20 -0800 (PST) From: Andy Tai Date: Thu, 28 Nov 2024 12:42:17 -0800 Message-Id: <7db46c27de52eee64d925a6e8f9a7af378ed0263.1732826483.git.atai@atai.org> 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-Queue-Id: 99B727A8A0 X-Migadu-Scanner: mx13.migadu.com X-Migadu-Spam-Score: -5.64 X-Spam-Score: -5.64 X-TUID: 9MEZFItdmTlS * gnu/packages/machine-learning.scm (whisper-cpp): New variable. * gnu/packages/patches/whisper-cpp-enable-tests.patch: New file. * gnu/local.mk: Register new file. Change-Id: I8db67dc543c0a1280e2cc5e8c03945b9ccdb9975 --- gnu/local.mk | 1 + gnu/packages/machine-learning.scm | 54 +++++++++++++++++++ .../patches/whisper-cpp-enable-tests.patch | 19 +++++++ 3 files changed, 74 insertions(+) create mode 100644 gnu/packages/patches/whisper-cpp-enable-tests.patch diff --git a/gnu/local.mk b/gnu/local.mk index c89fd88282..346ef2e0fb 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -2327,6 +2327,7 @@ dist_patch_DATA = \ %D%/packages/patches/webrtc-audio-processing-x86-no-sse.patch \ %D%/packages/patches/webrtc-for-telegram-desktop-unbundle-libsrtp.patch \ %D%/packages/patches/websocketpp-fix-for-cmake-3.15.patch \ + %D%/packages/patches/whisper-cpp-enable-tests.patch \ %D%/packages/patches/wmctrl-64-fix.patch \ %D%/packages/patches/wmfire-dont-inline-draw-fire.patch \ %D%/packages/patches/wmfire-update-for-new-gdk-versions.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