From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id GBMQFT3+r2b2BwAA62LTzQ:P1 (envelope-from ) for ; Sun, 04 Aug 2024 22:18:37 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id GBMQFT3+r2b2BwAA62LTzQ (envelope-from ) for ; Mon, 05 Aug 2024 00:18:37 +0200 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=NH0IPFfb; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=qaOKHnCn; dmarc=fail reason="SPF not aligned (strict), DKIM not aligned (strict)" header.from=posteo.net (policy=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=1722809917; 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=bbbtusPINZSF3oz1sBON4FytxvNc+tJ69vN4xPipTLI=; b=m9OmYwi7VyFWxiTC14v7Nh6groM33+yqX/MUKFb/bWyPoAhJcFw1LSfayL/NEoE/6so6Ly 2AfZrNpS+eErHpSHSl1lHtu8KUciwELvJnbwN0ZmqI7UHzOcy1MmgdMIO4C3mPJnfoEHyE kpXEcH+ZCqt2wP3VeZLYu69WkeExY+pBolCe+gCn3woqt1/X8Pf4iE53gvr+CA6edEa3W3 +/io8xb6Xq3pFoNL7P4VIto2xZ5Khy3KpeMIRYx6ekGq8654ISZGWKZYcN3pWuAmzdmEPf xSuanCkQU7J3leFusLUrPSQWnsR0OdRo/xZ+jb4XEa2viVfEK7o2WTFp+k3WMQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1722809917; a=rsa-sha256; cv=none; b=MeFhEe4uxrAzRwjqItD7pi9dmgMDK/Uu755QtjgrdmciCbTiXopporSyY19WEhEh41Eal2 AFU/2qLwHz0q/Wfl3AJ8CtDi0AMUH1abZE98wGXOA1zRDNpXzVzlHGF4q4IQZqxBFRqbe4 DBcoBPYB4zMQCFpUcWRu/mDeGQAAwL1V6PA/C6ynPiclxhWz+eX+8IhDnqRGm2e7dRFdh4 lnfxlkaMcZndPyp+RYyvkNxFLXbwLFbdjVXKStqz7ZsJywZ5JsurtMjk+NG53KEetHDJpU bkbuY5+vLW0OdxH3ztDiXr7/Ki0F5UPBGlt2qG167+cpzt5CssrSX96GbVissQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=debbugs.gnu.org header.s=debbugs-gnu-org header.b=NH0IPFfb; dkim=fail ("headers rsa verify failed") header.d=posteo.net header.s=2017 header.b=qaOKHnCn; dmarc=fail reason="SPF not aligned (strict), DKIM not aligned (strict)" header.from=posteo.net (policy=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" 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 1B22E8FC5 for ; Mon, 05 Aug 2024 00:18:37 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sajXv-0007ZS-Aa; Sun, 04 Aug 2024 18:17:47 -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 1sajXr-0007YF-Sl for guix-patches@gnu.org; Sun, 04 Aug 2024 18:17:44 -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 ) id 1sajXr-0000sH-Hu for guix-patches@gnu.org; Sun, 04 Aug 2024 18:17:43 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:References:In-Reply-To:Date:From:To:Subject; bh=bbbtusPINZSF3oz1sBON4FytxvNc+tJ69vN4xPipTLI=; b=NH0IPFfbCy54bMxUt7nzLLo+7JdCuaPmu/PTS7RKv3UOewJlJMe+vXf1z2aTw6uSADKzdl+kbQNRhMrEQonoiTx3jKNlaXq88lMuKjxZCR2IuPJsoPMMHWMG3t6VR3L4VACF9NU0/s8pv5CLcCiLDOZNv+jil2aEqYiYCN+TirnXPKHTXPI4Anfh333ncYynmtpDnaqIJ9uPtQdSW0qw96C8p0ich41T3aLGHqWv0/AnaqdJh7Fs/T05fhm3839PK6AcuJhgHDB9/uRkz5o+JcP5XzsYNNSwTCuW66HdxyX6cthmtKsWxwM1x3KGM1KSmAB+03sTLCBXuDL6ZgqPSw==; Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sajYD-0004Se-1g for guix-patches@gnu.org; Sun, 04 Aug 2024 18:18:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#72471] [PATCH 11/24] gnu: Add xnnpack-for-r-torch. Resent-From: David Elsing Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 04 Aug 2024 22:18:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 72471 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 72471@debbugs.gnu.org Cc: David Elsing Received: via spool by 72471-submit@debbugs.gnu.org id=B72471.172280986016888 (code B ref 72471); Sun, 04 Aug 2024 22:18:05 +0000 Received: (at 72471) by debbugs.gnu.org; 4 Aug 2024 22:17:40 +0000 Received: from localhost ([127.0.0.1]:57499 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sajXg-0004NU-Vp for submit@debbugs.gnu.org; Sun, 04 Aug 2024 18:17:39 -0400 Received: from mout01.posteo.de ([185.67.36.65]:38433) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sajXZ-0004KE-0C for 72471@debbugs.gnu.org; Sun, 04 Aug 2024 18:17:26 -0400 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id CBEEF240027 for <72471@debbugs.gnu.org>; Mon, 5 Aug 2024 00:16:57 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1722809817; bh=kpSFbD+vDKoqTbbB1oMtUH8W0T6wyzLKHrQAq7kp5Wo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=qaOKHnCn08/9rBzwAr6MwRVNMNGg8ECT2aoUsFsfiIEg29QDNyZDI55td9T2MFnVc 23diuTAoHE0VN/71M2NyqvrAHOVfHiRRmVL0zR84txwSrSKiA3zm5UTYECCA1JB6UU Vz5BGiW67o+5pK9Qs6tQYe71F8hqo++hyR+fTGwJngoKoYRqXw1sLfOWxItCyE24M7 XJFBRpClZ9XaDuz6NqjxZC3GPzdxKKJP82mzbkB5M0ad3vukBZmOXMpnPWjVIxQyD0 pWOlZPfo5VBpPEKjF6tWI2jLYDiw1wE4c/3D4/CuL3FLoJLqGyTeYnjMp9Xj/t3ddN 4/gykshV1A9BA== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4WcYp13Xr6z6tlh; Mon, 5 Aug 2024 00:16:57 +0200 (CEST) From: David Elsing Date: Sun, 4 Aug 2024 22:15:49 +0000 Message-ID: <20240804221635.3805-11-david.elsing@posteo.net> In-Reply-To: <20240804220847.15842-1-david.elsing@posteo.net> References: <20240804220847.15842-1-david.elsing@posteo.net> 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: -6.08 X-Spam-Score: -6.08 X-Migadu-Queue-Id: 1B22E8FC5 X-Migadu-Scanner: mx11.migadu.com X-TUID: vE/qoj7F4hxl * gnu/packages/machine-learning.scm (xnnpack-for-r-torch): New variable. (xnnpack)[inputs]: Use xnnpack-for-r-torch instead of xnnpack. --- gnu/packages/machine-learning.scm | 71 ++++++++++++++++++++++++++++++- 1 file changed, 70 insertions(+), 1 deletion(-) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 6fcfc1d167..71683c4df6 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -4251,6 +4251,74 @@ (define target-deps "") "i686-linux" "x86_64-linux")) (license license:bsd-3)))) +(define-public xnnpack-for-r-torch + (let ((version "0.0") + (commit "51a987591a6fc9f0fc0707077f53d763ac132cbf") + (revision "2")) + (package + (inherit xnnpack) + (version (git-version version revision commit)) + (source + (origin + (method git-fetch) + (uri (git-reference (url (package-home-page xnnpack)) (commit commit))) + (file-name (git-file-name (package-name xnnpack) version)) + (sha256 + (base32 + "1rzby82xq8d0rl1d148yz88jh9cpsw5c8b2yw7yg39mi7qmr55rm")) + (modules '((guix build utils) + (ice-9 ftw) + (ice-9 textual-ports) + (srfi srfi-26))) + (snippet + '(begin + ;; Remove autogenerated files + (for-each + (lambda (dir) + (let ((gendir (string-append "src/" dir "/gen"))) + (when (file-exists? gendir) + (delete-file-recursively gendir) + ;; Needed for the scripts generating the files + (mkdir gendir)))) + (scandir "src" (negate (cut member <> '("." ".."))))) + (delete-file-recursively "google3") + (delete-file "cmake/microkernels.cmake") + ;; Additional autogenerated files which contain the string + ;; "Auto-generated file" + (for-each + (lambda (dir) + (for-each + (lambda (name) + (let ((path (string-append dir "/" name))) + (when (call-with-input-file path + (lambda (port) + (string-contains + (get-string-all port) + "Auto-generated file"))) + (delete-file path)))) + (scandir dir (negate (cut member <> '("." "..")))))) + '("test" "bench" "eval" "models" "src/enums" "src/xnnpack")))))) + (arguments + (substitute-keyword-arguments (package-arguments xnnpack) + ((#:phases phases) + #~(modify-phases #$phases + (replace 'generate-files + (lambda _ + (for-each + (lambda (name) + (when (and (string-prefix? "generate" name) + (string-suffix? ".sh" name) + (not (equal? "generate-amalgamation.sh" name))) + (display (string-append name "\n")) + (invoke "bash" (string-append "scripts/" name)))) + (scandir "scripts")) + ;; These need to run after the above scripts + (display "Remaining files\n") + (invoke "python3" "tools/update-microkernels.py") + (substitute* "tools/amalgamate-microkernels.py" + (("BUILD") "BUILD.bazel")) + (invoke "bash" "scripts/generate-amalgamation.sh")))))))))) + ;; Warning: This package requires AVX2 or AVX-512 instructions. (define-public fbgemm (package @@ -4851,7 +4919,8 @@ (define-public python-pytorch-for-r-torch (inputs (modify-inputs (package-inputs python-pytorch) (replace "qnnpack-pytorch" qnnpack-pytorch-for-r-torch) - (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch))) + (replace "oneapi-dnnl" oneapi-dnnl-for-r-torch) + (replace "xnnpack" xnnpack-for-r-torch))) (propagated-inputs (modify-inputs (package-propagated-inputs python-pytorch) (append python-filelock -- 2.45.1