From patchwork Wed Sep 13 01:49:40 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: zamfofex X-Patchwork-Id: 53774 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 7CF9627BBE9; Wed, 13 Sep 2023 02:51:20 +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,URIBL_BLOCKED autolearn=unavailable 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 8785C27BBE2 for ; Wed, 13 Sep 2023 02:51:18 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qgF1z-0005en-0t; Tue, 12 Sep 2023 21:51:03 -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 1qgF1v-0005dp-5Y for guix-patches@gnu.org; Tue, 12 Sep 2023 21:50:59 -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 1qgF1t-0005Ko-6B for guix-patches@gnu.org; Tue, 12 Sep 2023 21:50:57 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qgF1y-0007N2-3L for guix-patches@gnu.org; Tue, 12 Sep 2023 21:51:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63088] [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero. Resent-From: zamfofex Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 13 Sep 2023 01:51:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63088 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63088@debbugs.gnu.org Cc: zamfofex , liliana.prikler@gmail.com Received: via spool by 63088-submit@debbugs.gnu.org id=B63088.169456982228263 (code B ref 63088); Wed, 13 Sep 2023 01:51:02 +0000 Received: (at 63088) by debbugs.gnu.org; 13 Sep 2023 01:50:22 +0000 Received: from localhost ([127.0.0.1]:60369 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgF1K-0007Lm-1M for submit@debbugs.gnu.org; Tue, 12 Sep 2023 21:50:22 -0400 Received: from mta-12-4.privateemail.com ([198.54.127.107]:12738) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qgF1G-0007LJ-4g for 63088@debbugs.gnu.org; Tue, 12 Sep 2023 21:50:19 -0400 Received: from mta-12.privateemail.com (localhost [127.0.0.1]) by mta-12.privateemail.com (Postfix) with ESMTP id AE23E1800049; Tue, 12 Sep 2023 21:50:07 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=twdb.moe; s=default; t=1694569807; bh=s8q0zGSfYj5/ArheY5ZQKPiRT7zRKgZODJVSrVoz1SM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eurG8597GXgzm++9/T2Mbg2PipaMj8zs+K4w8+9AwFYVZ22/yKq9Sd8XUZKuMJ0qQ WQIxFlFh98X+H1nYnsO+MgnqNJqgS3oJMKHxLdFDEnv8o/79+s8zp0LTVIyp13OlBu L2ptlHmv1YGYIZJIgvTOdjHgtsO1dg65IoIQBF2vQ5Z1fPAVbE27QzScGn1vwAA7FG wjU6owzQVu5TPMa32i3W58zV2yB/KWVoWkENBieakv5w0GOUpzsv4lNCE8vKUaCbHk cDVfHyhhta65+cHkezHutdAe0j7uALbfcA+qDr0DqxrRrkL8x00M5DM/8yeef5o9dX ei9Bht791JJ1g== Received: from localhost.localdomain (unknown [189.35.108.242]) by mta-12.privateemail.com (Postfix) with ESMTPA; Tue, 12 Sep 2023 21:50:03 -0400 (EDT) From: zamfofex Date: Tue, 12 Sep 2023 22:49:40 -0300 Message-ID: <2e0cabfab0e7ffb98bc220264c678345a336644f.1694569781.git.zamfofex@twdb.moe> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 X-Virus-Scanned: ClamAV using ClamSMTP 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/lc0.scm (make-lc0-net, make-lc0-official-net) (make-lc0-contrib-net): New procedures. * gnu/packages/lc0.scm (lc0-t2, lc0-t1, lc0-t1-512, lc0-t1-256) (lc0-611246, lc0-791556, lc0-815383): New variables. --- gnu/packages/lc0.scm | 84 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 84 insertions(+) diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm index e19436c381..f49d71538e 100644 --- a/gnu/packages/lc0.scm +++ b/gnu/packages/lc0.scm @@ -17,7 +17,10 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages lc0) + #:use-module (guix build utils) #:use-module (guix build-system meson) + #:use-module (guix build-system trivial) + #:use-module (guix download) #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix packages) @@ -69,3 +72,84 @@ (define-public lc0 is necessary to use Leela Chess Zero and should be installed separately.") (home-page "https://lczero.org") (license license:gpl3+))) + +(define (make-lc0-net name file-name url hash description) + (package + (name (string-append "lc0-" name)) + (version "0") + (source (origin + (method url-fetch) + (uri url) + (file-name (string-append "lc0-" file-name)) + (sha256 + (base32 + hash)))) + (build-system trivial-build-system) + (arguments + (list #:builder (with-imported-modules '((guix build utils)) + #~(let ((share (string-append (assoc-ref + %outputs + "out") + "/share/lc0/"))) + (use-modules (guix build utils)) + (mkdir-p share) + (copy-file (assoc-ref + %build-inputs + "source") + (string-append + share + #$file-name)))))) + (synopsis "Pretrained neural network for Leela Chess Zero") + (description description) + (home-page "https://lczero.org") + (license license:gpl3+))) + +(define-public (make-lc0-official-net name url-hash hash description) + (make-lc0-net name + (string-append name ".pb.gz") + (string-append "https://storage.lczero.org/files/networks/" + url-hash) hash description)) + +(define-public (make-lc0-contrib-net name file-name hash description) + (make-lc0-net name file-name + (string-append + "https://storage.lczero.org/files/networks-contrib/" + file-name) hash description)) + +(define-public lc0-t2 + (make-lc0-contrib-net "t2" "t2-768x15x24h-swa-5230000.pb.gz" + "126305hby24k5agxiixadp1lcgmv8drm1dkpb4jf5jzq7k4m855w" + "T2 is currently one of the best neural networks for Leela Chess Zero, superceeding the neural network T1.")) + +(define-public lc0-t1 + (make-lc0-contrib-net "t1" "t1-768x15x24h-swa-4000000.pb.gz" + "0zm9v91gfnm69n4x2fckair24fypjrwiip3j86ylsqncsi1sh5nq" + "T1 is currently one of the best neural networks for Leela Chess Zero, however, it was superceeded by the neural network T2.")) + +(define-public lc0-t1-512 + (make-lc0-contrib-net "t1-512" "t1-512x15x8h-distilled-swa-3395000.pb.gz" + "1s4pq06qkdpaq0a4z6j5qqnf6h7njpmwh7i0v7qh6bmhwlcibnqz" + "This is a smaller version of the T1 neural network, which is currently one of the best neural networks for Leela Chess Zero.")) + +(define-public lc0-t1-256 + (make-lc0-contrib-net "t1-256" "t1-256x10-distilled-swa-2432500.pb.gz" + "01ilar7y2nf3kfkq3x77n4jxlvqdpgddjsham2wz4dmdx35ac9xw" + "This is a smaller version of the T1 neural network, which is currently one of the best neural networks for Leela Chess Zero.")) + +(define-public lc0-611246 + (make-lc0-official-net "611246" + "7ca2381cfeac5c280f304e7027ffbea1b7d87474672e5d6fb16d5cd881640e04" + "0rapfvjqqrhydhp8a6r3skmjci2dc2yxz912bglv9yd9k00l9rww" + "This is an official neural network of a “main run” of the Leela Chess Zero project that was finished being trained in January of 2022.")) + +(define-public lc0-791556 + (make-lc0-official-net "791556" + "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34" + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi" + "This is an official neural network of the Leela Chess Zero project that was finished being trained in April of 2022.")) + +(define-public lc0-815383 + (make-lc0-official-net "815383" + "8af6098d6fb76e2bef6ef9ee87e61fadcb99f0b789013a72953a95ad10a9e933" + "09gm8lgaick60rn4x9h9w5sxdqivr4ign73viviadw1gj7wsbnsg" + "This is an official neural network of a “main run” of the Leela Chess Zero project. The network was finished being trained in September of 2023."))