Package: guix-patches;
Reported by: zamfofex <zamfofex <at> twdb.moe>
Date: Wed, 26 Apr 2023 13:15:01 UTC
Severity: normal
Tags: patch
Done: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 63088 in the body.
You can then email your comments to 63088 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
View this report as an mbox folder, status mbox, maintainer mbox
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 26 Apr 2023 13:15:01 GMT) Full text and rfc822 format available.zamfofex <zamfofex <at> twdb.moe>
:guix-patches <at> gnu.org
.
(Wed, 26 Apr 2023 13:15:01 GMT) Full text and rfc822 format available.Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: guix-patches <at> gnu.org Cc: zamfofex <zamfofex <at> twdb.moe> Subject: [PATCH 0/3] Add Lc0 Date: Wed, 26 Apr 2023 10:13:05 -0300
This patch series adds Lc0 “Leela Chess Zero” (a chess engine), alongside a few other optional dependencies that help improve its runtime performance. zamfofex (3): gnu: Add ISPC. * gnu/packages/c.scm (ispc): New variable. gnu: Add oneDNN. * gnu/packages/machine-learning.scm (oneapi-dnnl): New variable. gnu: Add Lc0. * gnu/packages/games.scm (lc0): New variable. gnu/packages/c.scm | 63 +++++++++++++++++++++++++++++++ gnu/packages/games.scm | 60 ++++++++++++++++++++++++++++- gnu/packages/machine-learning.scm | 21 +++++++++++ 3 files changed, 143 insertions(+), 1 deletion(-) base-commit: 380faf265b0c3b231ab8b69597d161be5e704e18 -- 2.39.2
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 26 Apr 2023 13:19:01 GMT) Full text and rfc822 format available.Message #8 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe> Subject: [PATCH 1/3] gnu: Add ISPC. * gnu/packages/c.scm (ispc): New variable. Date: Wed, 26 Apr 2023 10:17:37 -0300
--- gnu/packages/c.scm | 63 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) diff --git a/gnu/packages/c.scm b/gnu/packages/c.scm index b2f16613dd..28438f56c8 100644 --- a/gnu/packages/c.scm +++ b/gnu/packages/c.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2022 Artyom V. Poptsov <poptsov.artyom <at> gmail.com> ;;; Copyright © 2022 Ekaitz Zarraga <ekaitz <at> elenq.tech> ;;; Copyright © 2022 ( <paren <at> disroot.org> +;;; Copyright © 2023 zamfofex <zamfofex <at> twdb.moe> ;;; ;;; This file is part of GNU Guix. ;;; @@ -57,7 +58,9 @@ (define-module (gnu packages c) #:use-module (gnu packages guile) #:use-module (gnu packages llvm) #:use-module (gnu packages lua) + #:use-module (gnu packages m4) #:use-module (gnu packages multiprecision) + #:use-module (gnu packages ncurses) #:use-module (gnu packages pcre) #:use-module (gnu packages python) #:use-module (gnu packages python-xyz) @@ -1375,3 +1378,63 @@ (define-public utest-h (description "This package provides a header-only unit testing library for C/C++.") (license license:unlicense)))) + +(define-public ispc + (package + (name "ispc") + (version "1.19.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/ispc/ispc") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0yhcgyzjlrgs920lm0l6kygj2skanfb6qkxbdgm69r8c2xkzkaa3")))) + (inputs (list ncurses)) + (native-inputs (list bison clang flex m4 python)) + (build-system cmake-build-system) + (supported-systems '("x86_64-linux" "i686-linux" "aarch64-linux" "armhf-linux")) + (arguments `(#:tests? #f + #:configure-flags + `(,,(string-append "-DCMAKE_C_COMPILER=" (cc-for-target)) + ,,(string-append "-DCMAKE_CXX_COMPILER=" (cxx-for-target)) + ,(string-append "-DCLANG_EXECUTABLE=" + (assoc-ref %build-inputs "clang") + "/bin/clang") + ,(string-append "-DCLANGPP_EXECUTABLE=" + (assoc-ref %build-inputs "clang") + "/bin/clang++")) + #:phases + (modify-phases %standard-phases + (add-before 'configure 'patch-curses-requirement + (lambda _ + (substitute* "CMakeLists.txt" + (("\\bCURSES_CURSES_LIBRARY\\b") + "CURSES_LIBRARY")))) + ; Note: This works around the following issue: + ; <https://github.com/ispc/ispc/issues/1865> + ; Because GCC in Guix does not have multilib support. + (add-before 'configure 'patch-target-archs + (lambda _ + (substitute* "cmake/GenerateBuiltins.cmake" + (("\\bforeach \\(bit 32 64\\)") + ,(if (target-64bit?) + "foreach (bit 64)" + "foreach (bit 32)")) + (("\\bforeach \\(arch .*?\\)") + ,(if (target-x86?) + "foreach (arch \"x86\")" + "foreach (arch \"arm\")")) + (("\\bforeach \\(os_name \"windows\" .*?\\)") + "foreach (os_name \"linux\")"))))))) + (synopsis "Implicit SPMD Program Compiler") + (description + "ISPC is a compiler for a variant of the C programming language, with +extensions for single program, multiple data programming. Under the SPMD +model, the programmer writes a program that generally appears to be a regular +serial program, though the execution model is actually that a number of program +instances execute in parallel on the hardware.") + (home-page "https://github.com/ispc/ispc") + (license license:bsd-3))) -- 2.39.2
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 26 Apr 2023 13:19:02 GMT) Full text and rfc822 format available.Message #11 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe> Subject: [PATCH 2/3] gnu: Add oneDNN. * gnu/packages/machine-learning.scm (oneapi-dnnl): New variable. Date: Wed, 26 Apr 2023 10:17:38 -0300
--- gnu/packages/machine-learning.scm | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/gnu/packages/machine-learning.scm b/gnu/packages/machine-learning.scm index 37d4ef78ad..a29bb312e6 100644 --- a/gnu/packages/machine-learning.scm +++ b/gnu/packages/machine-learning.scm @@ -17,6 +17,7 @@ ;;; Copyright © 2020 Edouard Klein <edk <at> beaver-labs.com> ;;; Copyright © 2020, 2021, 2022, 2023 Vinicius Monego <monego <at> posteo.net> ;;; Copyright © 2020, 2021, 2022, 2023 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> +;;; Copyright © 2023 zamfofex <zamfofex <at> twdb.moe> ;;; ;;; This file is part of GNU Guix. ;;; @@ -3868,3 +3869,23 @@ (define-public python-brian2tools Brian 2 simulator.") (license license:cecill))) +(define-public oneapi-dnnl + (package + (name "oneapi-dnnl") + (version "3.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/oneapi-src/oneDNN") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1jgmb5kl0bf4a2zfn94zlb117672r9lvvkkmwl86ihlyr1mpr3d0")))) + (build-system cmake-build-system) + (home-page "https://github.com/oneapi-src/oneDNN") + (synopsis "Deep Neural Network Library") + (description + "OneAPI Deep Neural Network Library (oneDNN) is a cross-platform +performance library of basic building blocks for deep learning applications.") + (license license:asl2.0))) -- 2.39.2
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 26 Apr 2023 13:19:02 GMT) Full text and rfc822 format available.Message #14 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe> Subject: [PATCH 3/3] gnu: Add Lc0. * gnu/packages/games.scm (lc0): New variable. Date: Wed, 26 Apr 2023 10:17:39 -0300
--- gnu/packages/games.scm | 60 +++++++++++++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 23b6c39c46..9350c9224c 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -70,7 +70,7 @@ ;;; Copyright © 2021 Foo Chuan Wei <chuanwei.foo <at> hotmail.com> ;;; Copyright © 2022, 2023 Yovan Naumovski <yovan <at> gorski.stream> ;;; Copyright © 2022 Roman Riabenko <roman <at> riabenko.com> -;;; Copyright © 2022 zamfofex <zamfofex <at> twdb.moe> +;;; Copyright © 2022, 2023 zamfofex <zamfofex <at> twdb.moe> ;;; Copyright © 2022 Gabriel Arazas <foo.dogsquared <at> gmail.com> ;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer <at> gmail.com> ;;; Copyright © 2022 Hendursaga <hendursaga <at> aol.com> @@ -114,6 +114,7 @@ (define-module (gnu packages games) #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages boost) + #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) @@ -166,6 +167,7 @@ (define-module (gnu packages games) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages lua) + #:use-module (gnu packages machine-learning) #:use-module (gnu packages man) #:use-module (gnu packages maths) #:use-module (gnu packages messaging) @@ -10395,6 +10397,62 @@ (define-public stockfish (home-page "https://stockfishchess.org/") (license license:gpl3+)))) +(define lc0-neural-network + (let ((hash + "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34")) + (origin + (method url-fetch) + (uri (string-append "https://storage.lczero.org/files/networks/" + hash)) + (sha256 + (base32 + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi")) + (file-name "lc0-neural-network")))) + +(define-public lc0 + (package + (name "lc0") + (version "0.29.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LeelaChessZero/lc0") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1yn91738wd8zlbvrcw0dszy7hqjpkml0wi5xhh36j4zgid6x8i2m")))) + (build-system meson-build-system) + (native-search-paths + (list (search-path-specification + (variable "XDG_DATA_DIRS") + (files (list "share"))))) + (inputs + `(("neural-network" ,lc0-neural-network) + ("eigen" ,eigen) + ("oneapi-dnnl" ,oneapi-dnnl) + ("zlib" ,zlib))) + (native-inputs + (list googletest ispc pkg-config python)) + (arguments + '(#:phases (modify-phases %standard-phases + (add-after 'install 'copy-net + (lambda* (#:key outputs inputs #:allow-other-keys) + (mkdir-p (string-append (assoc-ref outputs "out") + "/share/lc0")) + (copy-file (assoc-ref inputs "neural-network") + (string-append (assoc-ref outputs "out") + "/share/lc0/neural-network"))))) + #:configure-flags (list "-Ddnnl=true" + (string-append + "-Ddnnl_dir=" + (assoc-ref %build-inputs "oneapi-dnnl"))))) + (synopsis "Neural network based chess engine") + (description "Lc0 is a chess engine based on neural networks") + (home-page "https://lczero.org") + (license license:gpl3+))) + (define-public barrage (package (name "barrage") -- 2.39.2
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Thu, 11 May 2023 14:30:01 GMT) Full text and rfc822 format available.Message #17 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: 宋文武 <iyzsong <at> envs.net> To: zamfofex <zamfofex <at> twdb.moe> Cc: 63088 <at> debbugs.gnu.org Subject: Re: bug#63088: [PATCH 0/3] Add Lc0 Date: Thu, 11 May 2023 22:29:06 +0800
Hello, I have pushed ispc and oneapi-dnnl, thank you! zamfofex <zamfofex <at> twdb.moe> writes: > +(define lc0-neural-network > + (let ((hash > + "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34")) > + (origin > + (method url-fetch) > + (uri (string-append "https://storage.lczero.org/files/networks/" > + hash)) > + (sha256 > + (base32 > + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi")) > + (file-name "lc0-neural-network")))) Will we able to train a model from source? And how much will it cost? As far as I know, guix haven't decided to accept pre-trained models: https://yhetil.org/guix/xanfHBZT3lYlyrr_OqHHMWkunLeZZlcxzY37_T3TeZo7mfJClD5-OTbkXDH2f3lMTkn94YIFVUj-Z31BP2Wj0W2rISNP6glC2PzXcPdb560=@protonmail.com/
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Thu, 11 May 2023 21:26:01 GMT) Full text and rfc822 format available.Message #20 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 宋文武 <iyzsong <at> envs.net> Cc: 63088 <at> debbugs.gnu.org Subject: Re: bug#63088: [PATCH 0/3] Add Lc0 Date: Thu, 11 May 2023 18:25:33 -0300 (BRT)
> Will we able to train a model from source? And how much will it cost? > > As far as I know, guix haven't decided to accept pre-trained models: > > https://yhetil.org/guix/xanfHBZT3lYlyrr_OqHHMWkunLeZZlcxzY37_T3TeZo7mfJClD5-OTbkXDH2f3lMTkn94YIFVUj-Z31BP2Wj0W2rISNP6glC2PzXcPdb560=@protonmail.com/ I don’t think it is feasible. Lc0’s approach is based on self‐play reinforcement‐learning, which in effect means that training starts with no knowledge about chess except for its rules (playing seemingly random moves), and going from there to learn increasingly more about it. So, in practice, this means it would take multiple months or at least several weeks to attain a neural network model that is anywhere close to as effective as the ones provided and pre‐trained. Besides, I believe training requires a (reasonably decent) GPU. But the network isn’t prohibitively large and its license is not proprietary. I’ll also note that Stockfish (packaged immediately above my Lc0 package) *does* itself include a provided pre‐trained network and no‐one has really complained about it, so I think it should be fine here too.
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Tue, 16 May 2023 15:07:04 GMT) Full text and rfc822 format available.Message #23 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: Simon Tournier <zimon.toutoune <at> gmail.com> To: zamfofex <zamfofex <at> twdb.moe>, 宋文武 <iyzsong <at> envs.net> Cc: 63088 <at> debbugs.gnu.org Subject: Re: [bug#63088] [PATCH 0/3] Add Lc0 Date: Tue, 16 May 2023 14:16:25 +0200
Hi, On Thu, 11 May 2023 at 18:25, zamfofex <zamfofex <at> twdb.moe> wrote: >> Will we able to train a model from source? And how much will it cost? >> >> As far as I know, guix haven't decided to accept pre-trained models: >> >> https://yhetil.org/guix/xanfHBZT3lYlyrr_OqHHMWkunLeZZlcxzY37_T3TeZo7mfJClD5-OTbkXDH2f3lMTkn94YIFVUj-Z31BP2Wj0W2rISNP6glC2PzXcPdb560=@protonmail.com/ > > I don’t think it is feasible. Lc0’s approach is based on self‐play > reinforcement‐learning, which in effect means that training starts > with no knowledge about chess except for its rules (playing seemingly > random moves), and going from there to learn increasingly more about > it. So, in practice, this means it would take multiple months or at > least several weeks to attain a neural network model that is anywhere > close to as effective as the ones provided and pre‐trained. Besides, I > believe training requires a (reasonably decent) GPU. I concur. > But the network isn’t prohibitively large and its license is not > proprietary. I’ll also note that Stockfish (packaged immediately above > my Lc0 package) *does* itself include a provided pre‐trained network > and no‐one has really complained about it, so I think it should be > fine here too. I will try to dedicate some time for reviewing this patch set. Cheers, simon
liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Thu, 27 Jul 2023 23:35:02 GMT) Full text and rfc822 format available.Message #26 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, zimon.toutoune <at> gmail.com Subject: [PATCH] Add Lc0. Date: Thu, 27 Jul 2023 20:34:05 -0300
Lc0 recently released version 0.30.0, so here is a patch with the updates version (in case the issue regarding the network’s inclusion is ever resolved). Also, I wanted to say: Is it reasonable to include Lc0 without the networks in? People can still download and use them, they just wouldn’t be included in Guix itself. Note that, unlike Stockfish, Lc0 does run without the neural networks, so it would be necessary for the user to download or otherwise acquire one by themself in order to use Lc0. The user can choose an appropriate network in their chess GUI program when configuring Lc0 in it. If this is more desireable, I can submit a patch without the trained neural network, which would allow the user to choose whichever one they might want. Thanks in advance! * gnu/packages/games.scm (lc0): New variable. --- gnu/packages/games.scm | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index cc6bef1114..21aa370701 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -118,6 +118,7 @@ (define-module (gnu packages games) #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages boost) + #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) @@ -171,6 +172,7 @@ (define-module (gnu packages games) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages lua) + #:use-module (gnu packages machine-learning) #:use-module (gnu packages man) #:use-module (gnu packages maths) #:use-module (gnu packages messaging) @@ -10285,6 +10287,62 @@ (define-public stockfish (home-page "https://stockfishchess.org/") (license license:gpl3+)))) +(define lc0-neural-network + (let ((hash + "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34")) + (origin + (method url-fetch) + (uri (string-append "https://storage.lczero.org/files/networks/" + hash)) + (sha256 + (base32 + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi")) + (file-name "lc0-neural-network")))) + +(define-public lc0 + (package + (name "lc0") + (version "0.30.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LeelaChessZero/lc0") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3")))) + (build-system meson-build-system) + (native-search-paths + (list (search-path-specification + (variable "XDG_DATA_DIRS") + (files (list "share"))))) + (inputs + `(("neural-network" ,lc0-neural-network) + ("eigen" ,eigen) + ("oneapi-dnnl" ,oneapi-dnnl) + ("zlib" ,zlib))) + (native-inputs + (list googletest ispc pkg-config python)) + (arguments + '(#:phases (modify-phases %standard-phases + (add-after 'install 'copy-net + (lambda* (#:key outputs inputs #:allow-other-keys) + (mkdir-p (string-append (assoc-ref outputs "out") + "/share/lc0")) + (copy-file (assoc-ref inputs "neural-network") + (string-append (assoc-ref outputs "out") + "/share/lc0/neural-network"))))) + #:configure-flags (list "-Ddnnl=true" + (string-append + "-Ddnnl_dir=" + (assoc-ref %build-inputs "oneapi-dnnl"))))) + (synopsis "Neural network based chess engine") + (description "Lc0 is a chess engine based on neural networks") + (home-page "https://lczero.org") + (license license:gpl3+))) + (define-public barrage (package (name "barrage") base-commit: c7e45139faa27b60f2c7d0a4bc140f9793d97d47 -- 2.40.1
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Fri, 28 Jul 2023 00:25:02 GMT) Full text and rfc822 format available.Message #29 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zimon.toutoune <at> gmail.com Subject: Re: [PATCH] Add Lc0. Date: Thu, 27 Jul 2023 21:24:04 -0300 (BRT)
> Note that, unlike Stockfish, Lc0 does run without the neural networks Sorry, I meant to say “Lc0 does *not* run without the neural networks”. (“Not” is a fairly important word to have forgotten!)
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Fri, 28 Jul 2023 04:25:01 GMT) Full text and rfc822 format available.Message #32 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: Liliana Marie Prikler <liliana.prikler <at> gmail.com> To: zamfofex <zamfofex <at> twdb.moe>, 63088 <at> debbugs.gnu.org Cc: 宋文武 <iyzsong <at> envs.net>, zimon.toutoune <at> gmail.com Subject: Re: [bug#63088] [PATCH] Add Lc0. Date: Fri, 28 Jul 2023 06:23:53 +0200
Am Donnerstag, dem 27.07.2023 um 20:34 -0300 schrieb zamfofex: > Note that, unlike Stockfish, Lc0 does run without the neural > networks, so it would be necessary for the user to download or > otherwise acquire one by themself in order to use Lc0. This sentence looks semantically incorrect. > The user can choose an appropriate network in their chess GUI program > when configuring Lc0 in it. > > If this is more desireable, I can submit a patch without the trained > neural network, which would allow the user to choose whichever one > they might want. Providing a default, if it can be bootstrapped, but allowing the user to choose would be the best option. > Thanks in advance! > > * gnu/packages/games.scm (lc0): New variable. > --- > gnu/packages/games.scm | 58 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 58 insertions(+) > > diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm > index cc6bef1114..21aa370701 100644 > --- a/gnu/packages/games.scm > +++ b/gnu/packages/games.scm > @@ -118,6 +118,7 @@ (define-module (gnu packages games) > #:use-module (gnu packages bash) > #:use-module (gnu packages bison) > #:use-module (gnu packages boost) > + #:use-module (gnu packages c) > #:use-module (gnu packages check) > #:use-module (gnu packages cmake) > #:use-module (gnu packages compression) > @@ -171,6 +172,7 @@ (define-module (gnu packages games) > #:use-module (gnu packages linux) > #:use-module (gnu packages llvm) > #:use-module (gnu packages lua) > + #:use-module (gnu packages machine-learning) > #:use-module (gnu packages man) > #:use-module (gnu packages maths) > #:use-module (gnu packages messaging) > @@ -10285,6 +10287,62 @@ (define-public stockfish > (home-page "https://stockfishchess.org/") > (license license:gpl3+)))) > > +(define lc0-neural-network > + (let ((hash > + > "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34")) > + (origin > + (method url-fetch) > + (uri (string-append > "https://storage.lczero.org/files/networks/" > + hash)) > + (sha256 > + (base32 > + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi")) > + (file-name "lc0-neural-network")))) > + > +(define-public lc0 > + (package > + (name "lc0") > + (version "0.30.0") > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/LeelaChessZero/lc0") > + (commit (string-append "v" version)) > + (recursive? #t))) > + (file-name (git-file-name name version)) > + (sha256 > + (base32 > "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3")))) > + (build-system meson-build-system) > + (native-search-paths > + (list (search-path-specification > + (variable "XDG_DATA_DIRS") > + (files (list "share"))))) > + (inputs > + `(("neural-network" ,lc0-neural-network) > + ("eigen" ,eigen) > + ("oneapi-dnnl" ,oneapi-dnnl) > + ("zlib" ,zlib))) > + (native-inputs > + (list googletest ispc pkg-config python)) > + (arguments > + '(#:phases (modify-phases %standard-phases > + (add-after 'install 'copy-net > + (lambda* (#:key outputs inputs #:allow-other- > keys) > + (mkdir-p (string-append (assoc-ref outputs > "out") > + "/share/lc0")) > + (copy-file (assoc-ref inputs "neural-network") > + (string-append (assoc-ref outputs > "out") > + "/share/lc0/neural- > network"))))) > + #:configure-flags (list "-Ddnnl=true" > + (string-append > + "-Ddnnl_dir=" > + (assoc-ref %build-inputs "oneapi- > dnnl"))))) > + (synopsis "Neural network based chess engine") I think the postfix "based", which typically requires a dash is not easily applied here. Simply write "Chess engine using neural networks" or something like that. > + (description "Lc0 is a chess engine based on neural networks") Not a full sentence without period > + (home-page "https://lczero.org") > + (license license:gpl3+))) > + > (define-public barrage > (package > (name "barrage") > > base-commit: c7e45139faa27b60f2c7d0a4bc140f9793d97d47 Cheers
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Fri, 28 Jul 2023 18:15:01 GMT) Full text and rfc822 format available.Message #35 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, 63088 <at> debbugs.gnu.org Cc: 宋文武 <iyzsong <at> envs.net>, zimon.toutoune <at> gmail.com Subject: Re: [bug#63088] [PATCH] Add Lc0. Date: Fri, 28 Jul 2023 15:14:24 -0300 (BRT)
> This sentence looks semantically incorrect. Yes, sorry! I guess you didn’t receive my correction email. (I’m still bad at sending emails properly, it seems.) See: <https://issues.guix.gnu.org/63088#8> I had meant “Lc0 does *not* run without the neural networks”. > Providing a default, if it can be bootstrapped, but allowing the user to choose would be the best option. I don’t think a default can be easily bootstrapped. When I first submitted the patch, I talked with some of the Lc0 developers, and they said it might be possible to bootstrap one by using Stockfish in several minutes, but there is no code that does that currrently (it would have to be written and is nontrivial). And it wouldn’t be as effective as the existing networks, because Stockfish’s evaluation provides less information than Lc0’s is able to use. In any case, that feels entirely redundant, because Stockfish’s NNUE networks were trained on Lc0’s anyway, so it seems to be only adding a layer of complexity for no seemingly good reason. If this concern can be addressed somehow, I can submit a followup patch. (Either just fixing the wording, or also removing the networks.)
liliana.prikler <at> gmail.com, iyzsong <at> envs.net, guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Thu, 07 Sep 2023 10:24:02 GMT) Full text and rfc822 format available.Message #38 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: iyzsong <at> envs.net To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, 宋文武 <iyzsong <at> member.fsf.org> Subject: [PATCH v2] gnu: Add Lc0. Date: Thu, 7 Sep 2023 18:23:11 +0800
From: zamfofex <zamfofex <at> twdb.moe> * gnu/packages/games.scm (lc0): New variable. Signed-off-by: 宋文武 <iyzsong <at> member.fsf.org> --- gnu/packages/games.scm | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm index 760234b031..f82f1dcc52 100644 --- a/gnu/packages/games.scm +++ b/gnu/packages/games.scm @@ -118,6 +118,7 @@ (define-module (gnu packages games) #:use-module (gnu packages bash) #:use-module (gnu packages bison) #:use-module (gnu packages boost) + #:use-module (gnu packages c) #:use-module (gnu packages check) #:use-module (gnu packages cmake) #:use-module (gnu packages compression) @@ -171,6 +172,7 @@ (define-module (gnu packages games) #:use-module (gnu packages linux) #:use-module (gnu packages llvm) #:use-module (gnu packages lua) + #:use-module (gnu packages machine-learning) #:use-module (gnu packages man) #:use-module (gnu packages maths) #:use-module (gnu packages messaging) @@ -10409,6 +10411,63 @@ (define-public stockfish (home-page "https://stockfishchess.org/") (license license:gpl3+)))) +(define lc0-neural-network + (let ((hash + "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34")) + (origin + (method url-fetch) + (uri (string-append "https://storage.lczero.org/files/networks/" + hash)) + (sha256 + (base32 + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi")) + (file-name "lc0-neural-network")))) + +(define-public lc0 + (package + (name "lc0") + (version "0.30.0") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LeelaChessZero/lc0") + (commit (string-append "v" version)) + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3")))) + (build-system meson-build-system) + (native-search-paths + (list (search-path-specification + (variable "XDG_DATA_DIRS") + (files '("share"))))) + (inputs + `(("neural-network" ,lc0-neural-network) + ("eigen" ,eigen) + ("oneapi-dnnl" ,oneapi-dnnl) + ("zlib" ,zlib))) + (native-inputs + (list googletest ispc pkg-config python)) + (arguments + '(#:phases (modify-phases %standard-phases + (add-after 'install 'copy-net + (lambda* (#:key outputs inputs #:allow-other-keys) + (mkdir-p (string-append (assoc-ref outputs "out") + "/share/lc0")) + (copy-file (assoc-ref inputs "neural-network") + (string-append (assoc-ref outputs "out") + "/share/lc0/neural-network"))))) + #:configure-flags (list "-Ddnnl=true" + (string-append + "-Ddnnl_dir=" + (assoc-ref %build-inputs "oneapi-dnnl"))))) + (synopsis "Chess engine using neural networks") + (description "Lc0 is a UCI-compliant chess engine designed to play chess +via neural network, specifically those of the LeelaChessZero project.") + (home-page "https://lczero.org") + (license license:gpl3+))) + (define-public barrage (package (name "barrage") base-commit: 5ef28595e9dff8b88ec3fcb4d887fbc380c9a8b8 prerequisite-patch-id: 8cee4be3d25dba0dde5c2d0e317f31741c010f50 -- 2.41.0
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Thu, 07 Sep 2023 17:05:02 GMT) Full text and rfc822 format available.Message #41 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: Liliana Marie Prikler <liliana.prikler <at> gmail.com> To: iyzsong <at> envs.net, 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, 宋文武 <iyzsong <at> member.fsf.org> Subject: Re: [bug#63088] [PATCH v2] gnu: Add Lc0. Date: Thu, 07 Sep 2023 19:03:57 +0200
Am Donnerstag, dem 07.09.2023 um 18:23 +0800 schrieb iyzsong <at> envs.net: > From: zamfofex <zamfofex <at> twdb.moe> > > * gnu/packages/games.scm (lc0): New variable. Missing the entry for lc0-neural-network. > > Signed-off-by: 宋文武 <iyzsong <at> member.fsf.org> > --- > gnu/packages/games.scm | 59 > ++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 59 insertions(+) > > diff --git a/gnu/packages/games.scm b/gnu/packages/games.scm > index 760234b031..f82f1dcc52 100644 > --- a/gnu/packages/games.scm > +++ b/gnu/packages/games.scm > @@ -118,6 +118,7 @@ (define-module (gnu packages games) > #:use-module (gnu packages bash) > #:use-module (gnu packages bison) > #:use-module (gnu packages boost) > + #:use-module (gnu packages c) > #:use-module (gnu packages check) > #:use-module (gnu packages cmake) > #:use-module (gnu packages compression) > @@ -171,6 +172,7 @@ (define-module (gnu packages games) > #:use-module (gnu packages linux) > #:use-module (gnu packages llvm) > #:use-module (gnu packages lua) > + #:use-module (gnu packages machine-learning) > #:use-module (gnu packages man) > #:use-module (gnu packages maths) > #:use-module (gnu packages messaging) > @@ -10409,6 +10411,63 @@ (define-public stockfish > (home-page "https://stockfishchess.org/") > (license license:gpl3+)))) > > +(define lc0-neural-network > + (let ((hash > + > "f404e156ceb2882470fd8c032b8754af0fa0b71168328912eaef14671a256e34")) > + (origin > + (method url-fetch) > + (uri (string-append > "https://storage.lczero.org/files/networks/" > + hash)) > + (sha256 > + (base32 > + "03b9xl9vkiihdilz5dzcpg6g4inb6n4k5gs911i3gbd8h9sh9ixi")) > + (file-name "lc0-neural-network")))) > + > +(define-public lc0 > + (package > + (name "lc0") > + (version "0.30.0") > + (source > + (origin > + (method git-fetch) > + (uri (git-reference > + (url "https://github.com/LeelaChessZero/lc0") > + (commit (string-append "v" version)) > + (recursive? #t))) recursive? #t is meh ._. Can we work around that? > + (file-name (git-file-name name version)) > + (sha256 > + (base32 > "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3")))) > + (build-system meson-build-system) > + (native-search-paths > + (list (search-path-specification > + (variable "XDG_DATA_DIRS") > + (files '("share"))))) > + (inputs > + `(("neural-network" ,lc0-neural-network) > + ("eigen" ,eigen) > + ("oneapi-dnnl" ,oneapi-dnnl) > + ("zlib" ,zlib))) Use new-style inputs. > + (native-inputs > + (list googletest ispc pkg-config python)) > + (arguments > + '(#:phases (modify-phases %standard-phases > + (add-after 'install 'copy-net > + (lambda* (#:key outputs inputs #:allow-other- > keys) > + (mkdir-p (string-append (assoc-ref outputs > "out") > + "/share/lc0")) > + (copy-file (assoc-ref inputs "neural-network") > + (string-append (assoc-ref outputs > "out") > + "/share/lc0/neural- > network"))))) Can we use search-input-file or the like here? > + #:configure-flags (list "-Ddnnl=true" > + (string-append > + "-Ddnnl_dir=" > + (assoc-ref %build-inputs "oneapi- > dnnl"))))) > + (synopsis "Chess engine using neural networks") > + (description "Lc0 is a UCI-compliant chess engine designed to > play chess > +via neural network, specifically those of the LeelaChessZero > project.") Is Lc0 = Leela Chess Zero? What's the connection? > + (home-page "https://lczero.org") > + (license license:gpl3+))) Cheers
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Mon, 11 Sep 2023 10:23:01 GMT) Full text and rfc822 format available.Message #44 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, iyzsong <at> envs.net, 63088 <at> debbugs.gnu.org Cc: 宋文武 <iyzsong <at> member.fsf.org> Subject: Re: [bug#63088] [PATCH v2] gnu: Add Lc0. Date: Mon, 11 Sep 2023 07:22:35 -0300 (BRT)
> recursive? #t is meh ._. > Can we work around that? Yes, presumably easily, but I don’t think it would be a good idea in this case, because it isn’t used to build bundled software, but rather just for a small project‐specific pair of source files (that are in a separate repo just because they are used by other repos of the project too). > Can we use search-input-file or the like here? Probably. Though would it be reasonable to package the network separately instead? Note that Lc0 is able to load various networks, and there is no canonical network, so maybe it would be useful to have it in a different package so that more can be potentially added in the future. Then people could use them with something like ‘guix shell lc0 lc0-NETWORK_NAME’. > Is Lc0 = Leela Chess Zero? What's the connection? “Lc0”, “Leela Chess Zero”, “LCZero”, and sometimes just “Leela Chess” can be used roughly interchangeably to refer to the project as a whole. Though, occasionally, people will use the term “Lc0” (sometimes capitalised as “lc0”) to refer specifically to the ‘lc0’ executable, which can use the networks from the Leela Chess Zero project, but networks created by other people too, including those of e.g. the Maia project, see <https://github.com/CSSLab/maia-chess> and <https://maiachess.com> At some point (very early on), the code for the executable was rewritten or otherwise largely refactored, and at the same time renamed from ‘lczero’ to the current ‘lc0’, so sometimes (very rarely nowadays), people will use the term “lc0” (or “Lc0”) to refer specifically to this new executable and code base, contrasting with the former ‘lczero’ executable and its code base. Honestly, this all feels convoluted to me, so I usually like to use the terms interchangeably, and I don’t think using them differently in the package description is a good choice. - - - - - Hopefully this helps clarify things well enough! If there is interest, I can submit another patch with the requested changes and the appropriate path taken regarding the packaging for the networks.
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Mon, 11 Sep 2023 18:01:02 GMT) Full text and rfc822 format available.Message #47 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: Liliana Marie Prikler <liliana.prikler <at> gmail.com> To: zamfofex <zamfofex <at> twdb.moe>, iyzsong <at> envs.net, 63088 <at> debbugs.gnu.org Cc: 宋文武 <iyzsong <at> member.fsf.org> Subject: Re: [bug#63088] [PATCH v2] gnu: Add Lc0. Date: Mon, 11 Sep 2023 20:00:10 +0200
Am Montag, dem 11.09.2023 um 07:22 -0300 schrieb zamfofex: > > recursive? #t is meh ._. > > Can we work around that? > > Yes, presumably easily, but I don’t think it would be a good idea in > this case, because it isn’t used to build bundled software, but > rather just for a small project‐specific pair of source files (that > are in a separate repo just because they are used by other repos of > the project too). In that case, a comment explaining this in 1-2 lines would probably be fine. > > Can we use search-input-file or the like here? > > Probably. Though would it be reasonable to package the network > separately instead? Note that Lc0 is able to load various networks, > and there is no canonical network, so maybe it would be useful to > have it in a different package so that more can be potentially added > in the future. > > Then people could use them with something like ‘guix shell lc0 lc0- > NETWORK_NAME’. Sounds reasonable to me. Do add a phrase or two about this to the lc0 description though if it doesn't even ship a basic network. > > > Is Lc0 = Leela Chess Zero? What's the connection? > > “Lc0”, “Leela Chess Zero”, “LCZero”, and sometimes just “Leela Chess” > can be used roughly interchangeably to refer to the project as a > whole. Though, occasionally, people will use the term “Lc0” > (sometimes capitalised as “lc0”) to refer specifically to the ‘lc0’ > executable, which can use the networks from the Leela Chess Zero > project, but networks created by other people too, including those of > e.g. the Maia project, see <https://github.com/CSSLab/maia-chess> and > <https://maiachess.com> > > At some point (very early on), the code for the executable was > rewritten or otherwise largely refactored, and at the same time > renamed from ‘lczero’ to the current ‘lc0’, so sometimes (very rarely > nowadays), people will use the term “lc0” (or “Lc0”) to refer > specifically to this new executable and code base, contrasting with > the former ‘lczero’ executable and its code base. > > Honestly, this all feels convoluted to me, so I usually like to use > the terms interchangeably, and I don’t think using them differently > in the package description is a good choice. In that case, for the description we should probably go with "Leela Chess Zero" or "@acronym{lc0, Leela Chess Zero}" Cheers
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Tue, 12 Sep 2023 11:59:01 GMT) Full text and rfc822 format available.Message #50 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, iyzsong <at> member.fsf.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net Subject: [PATCH 1/3] gnu: Add lc0. Date: Tue, 12 Sep 2023 08:58:11 -0300
* gnu/packages/lc0.scm: New file. * gnu/packages/local.mk: Register file. --- gnu/local.mk | 2 ++ gnu/packages/lc0.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 gnu/packages/lc0.scm diff --git a/gnu/local.mk b/gnu/local.mk index 4f8637418a..f46a2973ae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -59,6 +59,7 @@ # Copyright © 2023 Zheng Junjie <873216071 <at> qq.com> # Copyright © 2023 Ivana Drazovic <iv.dra <at> hotmail.com> # Copyright © 2023 Andy Tai <atai <at> atai.org> +# Copyright © 2023 zamfofex <zamfofex <at> twdb.moe> # # This file is part of GNU Guix. # @@ -375,6 +376,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/kerberos.scm \ %D%/packages/kodi.scm \ %D%/packages/language.scm \ + %D%/packages/lc0.scm \ %D%/packages/lean.scm \ %D%/packages/lego.scm \ %D%/packages/less.scm \ diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm new file mode 100644 index 0000000000..e19436c381 --- /dev/null +++ b/gnu/packages/lc0.scm @@ -0,0 +1,71 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 zamfofex <zamfofex <at> twdb.moe> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu packages lc0) + #:use-module (guix build-system meson) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module ((guix licenses) + #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages algebra) + #:use-module (gnu packages c) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages machine-learning) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python)) + +(define-public lc0 + (package + (name "lc0") + (version "0.30.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LeelaChessZero/lc0") + (commit (string-append "v" version)) + ;; Only a few source files are in one Git submodules (rather than + ;; there being bundled projects). These files are in a different + ;; repository just because they are used across multiple + ;; repositories of the Leela Chess Zero project. + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3")))) + (build-system meson-build-system) + (native-search-paths + (list (search-path-specification + (variable "XDG_DATA_DIRS") + (files '("share"))))) + (inputs (list eigen oneapi-dnnl zlib)) + (native-inputs (list googletest ispc pkg-config python)) + (arguments + '(#:configure-flags (list "-Ddnnl=true" + (string-append "-Ddnnl_dir=" + (assoc-ref %build-inputs + "oneapi-dnnl"))))) + (synopsis "Chess engine based on neural networks") + (description + "Leela Chess Zero is a UCI-compliant chess engine designed to play chess +using neural networks. This package does not provide a neural network, which +is necessary to use Leela Chess Zero and should be installed separately.") + (home-page "https://lczero.org") + (license license:gpl3+))) base-commit: daeeaa221605726d8853b00261619ba039bd6db7 -- 2.41.0
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Tue, 12 Sep 2023 11:59:02 GMT) Full text and rfc822 format available.Message #53 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, iyzsong <at> member.fsf.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net Subject: [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero. Date: Tue, 12 Sep 2023 08:58:12 -0300
* gnu/packages/lc0.scm (make-lc0-nn): New procedure. * 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 | 76 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm index e19436c381..1cda2efd1c 100644 --- a/gnu/packages/lc0.scm +++ b/gnu/packages/lc0.scm @@ -17,7 +17,10 @@ ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. (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,76 @@ (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-nn 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 lc0-t2 + (make-lc0-nn "t2" "t2-768.pb.gz" + "https://storage.lczero.org/files/networks-contrib/t2-768x15x24h-swa-5230000.pb.gz" + "126305hby24k5agxiixadp1lcgmv8drm1dkpb4jf5jzq7k4m855w" + "T2 is currently one of the best neural network for Leela Chess Zero, superceeding the neural network T1.")) + +(define-public lc0-t1 + (make-lc0-nn "t1" "t1-768.pb.gz" + "https://storage.lczero.org/files/networks-contrib/t1-768x15x24h-swa-4000000.pb.gz" + "0zm9v91gfnm69n4x2fckair24fypjrwiip3j86ylsqncsi1sh5nq" + "T1 is currently one of the best neural network for Leela Chess Zero, however it was superceeded by the neural network T2.")) + +(define-public lc0-t1-512 + (make-lc0-nn "t1-512" "t1-512.pb.gz" + "https://storage.lczero.org/files/networks-contrib/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 network for Leela Chess Zero.")) + +(define-public lc0-t1-256 + (make-lc0-nn "t1-256" "t1-256.pb.gz" + "https://storage.lczero.org/files/networks-contrib/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 network for Leela Chess Zero.")) + +(define-public lc0-611246 + (make-lc0-nn "611246" "611246.pb.gz" + "https://storage.lczero.org/files/networks/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-nn "791556" "791556.pb.gz" + "https://storage.lczero.org/files/networks/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-nn "815383" "815383.pb.gz" + "https://storage.lczero.org/files/networks/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.")) -- 2.41.0
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Tue, 12 Sep 2023 11:59:02 GMT) Full text and rfc822 format available.Message #56 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, iyzsong <at> member.fsf.org, liliana.prikler <at> gmail.com, iyzsong <at> envs.net Subject: [PATCH 3/3] gnu: Add neural networks from the Maia Chess project. Date: Tue, 12 Sep 2023 08:58:13 -0300
* gnu/packages/lc0.scm (make-lc0-maia): New procedure. * gnu/packages/lc0.scm (lc0-maia-1100, lc0-maia-1200, lc0-maia-1300) (lc0-maia-1400, lc0-maia-1500, lc0-maia-1600, lc0-maia-1700) (lc0-maia-1800, lc0-maia-1900): New variables. --- gnu/packages/lc0.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm index 1cda2efd1c..495d93b110 100644 --- a/gnu/packages/lc0.scm +++ b/gnu/packages/lc0.scm @@ -18,6 +18,7 @@ (define-module (gnu packages lc0) #:use-module (guix build utils) + #:use-module (guix build-system copy) #:use-module (guix build-system meson) #:use-module (guix build-system trivial) #:use-module (guix download) @@ -145,3 +146,57 @@ (define-public lc0-815383 "https://storage.lczero.org/files/networks/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.")) + +(define (make-lc0-maia rating) + (package + (name (string-append "lc0-maia-" rating)) + (version "1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/CSSLab/maia-chess") + (commit (string-append "v" version)))) + (file-name (git-file-name "maia" version)) + (sha256 + (base32 + "0qjkp56pb5vvkr3j1vdsdzligvy7faza917z7vdfmf168pkvrxsr")))) + (build-system copy-build-system) + (arguments + `(#:install-plan '((,(string-append "model_files/" rating "/final_" + rating "-40.pb.gz") ,(string-append + "share/lc0/maia-" + rating ".pb.gz"))))) + (synopsis "Human-like neural network for Leela Chess Zero") + (description + "Maia’s goal is to play the human move — not necessarily the best move. +As a result, Maia has a more human-like style than previous engines, matching +moves played by human players in online games over 50% of the time.") + (home-page "https://maiachess.com") + (license license:gpl3))) + +(define-public lc0-maia-1100 + (make-lc0-maia "1100")) + +(define-public lc0-maia-1200 + (make-lc0-maia "1200")) + +(define-public lc0-maia-1300 + (make-lc0-maia "1300")) + +(define-public lc0-maia-1400 + (make-lc0-maia "1400")) + +(define-public lc0-maia-1500 + (make-lc0-maia "1500")) + +(define-public lc0-maia-1600 + (make-lc0-maia "1600")) + +(define-public lc0-maia-1700 + (make-lc0-maia "1700")) + +(define-public lc0-maia-1800 + (make-lc0-maia "1800")) + +(define-public lc0-maia-1900 + (make-lc0-maia "1900")) -- 2.41.0
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Tue, 12 Sep 2023 17:08:01 GMT) Full text and rfc822 format available.Message #59 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: Liliana Marie Prikler <liliana.prikler <at> gmail.com> To: zamfofex <zamfofex <at> twdb.moe>, 63088 <at> debbugs.gnu.org Cc: iyzsong <at> member.fsf.org, iyzsong <at> envs.net Subject: Re: [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero. Date: Tue, 12 Sep 2023 19:07:34 +0200
Am Dienstag, dem 12.09.2023 um 08:58 -0300 schrieb zamfofex: > * gnu/packages/lc0.scm (make-lc0-nn): New procedure. > * 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 | 76 > ++++++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 76 insertions(+) > > diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm > index e19436c381..1cda2efd1c 100644 > --- a/gnu/packages/lc0.scm > +++ b/gnu/packages/lc0.scm > @@ -17,7 +17,10 @@ > ;;; along with GNU Guix. If not, see > <http://www.gnu.org/licenses/>. > > (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,76 @@ (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-nn 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 lc0-t2 > + (make-lc0-nn "t2" "t2-768.pb.gz" > + > "https://storage.lczero.org/files/networks-contrib/t2-768x15x24h-swa- > 5230000.pb.gz" You might want to search for ways to shorten these urls. E.g. Define a procedure (lc0-network "short-name") > + "126305hby24k5agxiixadp1lcgmv8drm1dkpb4jf5jzq7k4m855w" > + "T2 is currently one of the best neural network for Leela Chess > Zero, superceeding the neural network T1.")) > + > +(define-public lc0-t1 > + (make-lc0-nn "t1" "t1-768.pb.gz" > + > "https://storage.lczero.org/files/networks-contrib/t1-768x15x24h-swa- > 4000000.pb.gz" > + "0zm9v91gfnm69n4x2fckair24fypjrwiip3j86ylsqncsi1sh5nq" > + "T1 is currently one of the best neural network for Leela Chess > Zero, however it was superceeded by the neural network T2.")) > + > +(define-public lc0-t1-512 > + (make-lc0-nn "t1-512" "t1-512.pb.gz" > + > "https://storage.lczero.org/files/networks-contrib/t1-512x15x8h-disti > lled-swa-3395000.pb.gz" > + "1s4pq06qkdpaq0a4z6j5qqnf6h7njpmwh7i0v7qh6bmhwlcibnqz" > + "This is a smaller version of the T1 neural network, which is > currently one of the best neural network for Leela Chess Zero.")) > + > +(define-public lc0-t1-256 > + (make-lc0-nn "t1-256" "t1-256.pb.gz" > + > "https://storage.lczero.org/files/networks-contrib/t1-256x10-distille > d-swa-2432500.pb.gz" > + "01ilar7y2nf3kfkq3x77n4jxlvqdpgddjsham2wz4dmdx35ac9xw" > + "This is a smaller version of the T1 neural network, which is > currently one of the best neural network for Leela Chess Zero.")) > + > +(define-public lc0-611246 > + (make-lc0-nn "611246" "611246.pb.gz" > + > "https://storage.lczero.org/files/networks/7ca2381cfeac5c280f304e7027 > ffbea1b7d87474672e5d6fb16d5cd881640e04" > + "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-nn "791556" "791556.pb.gz" > + > "https://storage.lczero.org/files/networks/f404e156ceb2882470fd8c032b > 8754af0fa0b71168328912eaef14671a256e34" > + "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-nn "815383" "815383.pb.gz" > + > "https://storage.lczero.org/files/networks/8af6098d6fb76e2bef6ef9ee87 > e61fadcb99f0b789013a72953a95ad10a9e933" > + "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.")) Cheers
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 13 Sep 2023 01:51:01 GMT) Full text and rfc822 format available.Message #62 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, liliana.prikler <at> gmail.com Subject: [PATCH 1/3] gnu: Add lc0. Date: Tue, 12 Sep 2023 22:49:39 -0300
* gnu/packages/lc0.scm: New file. * gnu/packages/local.mk: Register file. --- gnu/local.mk | 2 ++ gnu/packages/lc0.scm | 71 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 gnu/packages/lc0.scm diff --git a/gnu/local.mk b/gnu/local.mk index 4f8637418a..f46a2973ae 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -59,6 +59,7 @@ # Copyright © 2023 Zheng Junjie <873216071 <at> qq.com> # Copyright © 2023 Ivana Drazovic <iv.dra <at> hotmail.com> # Copyright © 2023 Andy Tai <atai <at> atai.org> +# Copyright © 2023 zamfofex <zamfofex <at> twdb.moe> # # This file is part of GNU Guix. # @@ -375,6 +376,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/kerberos.scm \ %D%/packages/kodi.scm \ %D%/packages/language.scm \ + %D%/packages/lc0.scm \ %D%/packages/lean.scm \ %D%/packages/lego.scm \ %D%/packages/less.scm \ diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm new file mode 100644 index 0000000000..e19436c381 --- /dev/null +++ b/gnu/packages/lc0.scm @@ -0,0 +1,71 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2023 zamfofex <zamfofex <at> twdb.moe> +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>. + +(define-module (gnu packages lc0) + #:use-module (guix build-system meson) + #:use-module (guix gexp) + #:use-module (guix git-download) + #:use-module (guix packages) + #:use-module ((guix licenses) + #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages algebra) + #:use-module (gnu packages c) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages machine-learning) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python)) + +(define-public lc0 + (package + (name "lc0") + (version "0.30.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/LeelaChessZero/lc0") + (commit (string-append "v" version)) + ;; Only a few source files are in one Git submodules (rather than + ;; there being bundled projects). These files are in a different + ;; repository just because they are used across multiple + ;; repositories of the Leela Chess Zero project. + (recursive? #t))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1m7k8m8iz4pxv3h9g2j1dkgryi4k9c1bcg3fx5j7ii4ysif63kj3")))) + (build-system meson-build-system) + (native-search-paths + (list (search-path-specification + (variable "XDG_DATA_DIRS") + (files '("share"))))) + (inputs (list eigen oneapi-dnnl zlib)) + (native-inputs (list googletest ispc pkg-config python)) + (arguments + '(#:configure-flags (list "-Ddnnl=true" + (string-append "-Ddnnl_dir=" + (assoc-ref %build-inputs + "oneapi-dnnl"))))) + (synopsis "Chess engine based on neural networks") + (description + "Leela Chess Zero is a UCI-compliant chess engine designed to play chess +using neural networks. This package does not provide a neural network, which +is necessary to use Leela Chess Zero and should be installed separately.") + (home-page "https://lczero.org") + (license license:gpl3+))) base-commit: daeeaa221605726d8853b00261619ba039bd6db7 -- 2.41.0
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 13 Sep 2023 01:51:02 GMT) Full text and rfc822 format available.Message #65 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, liliana.prikler <at> gmail.com Subject: [PATCH 2/3] gnu: Add neural networks for Leela Chess Zero. Date: Tue, 12 Sep 2023 22:49:40 -0300
* 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 <http://www.gnu.org/licenses/>. (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.")) -- 2.41.0
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 13 Sep 2023 01:51:02 GMT) Full text and rfc822 format available.Message #68 received at 63088 <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: 63088 <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, liliana.prikler <at> gmail.com Subject: [PATCH 3/3] gnu: Add neural networks from the Maia Chess project. Date: Tue, 12 Sep 2023 22:49:41 -0300
* gnu/packages/lc0.scm (make-lc0-maia): New procedure. * gnu/packages/lc0.scm (lc0-maia-1100, lc0-maia-1200, lc0-maia-1300) (lc0-maia-1400, lc0-maia-1500, lc0-maia-1600, lc0-maia-1700) (lc0-maia-1800, lc0-maia-1900): New variables. --- gnu/packages/lc0.scm | 55 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm index f49d71538e..abbac73ce7 100644 --- a/gnu/packages/lc0.scm +++ b/gnu/packages/lc0.scm @@ -18,6 +18,7 @@ (define-module (gnu packages lc0) #:use-module (guix build utils) + #:use-module (guix build-system copy) #:use-module (guix build-system meson) #:use-module (guix build-system trivial) #:use-module (guix download) @@ -153,3 +154,57 @@ (define-public lc0-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.")) + +(define (make-lc0-maia rating) + (package + (name (string-append "lc0-maia-" rating)) + (version "1.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/CSSLab/maia-chess") + (commit (string-append "v" version)))) + (file-name (git-file-name "maia" version)) + (sha256 + (base32 + "0qjkp56pb5vvkr3j1vdsdzligvy7faza917z7vdfmf168pkvrxsr")))) + (build-system copy-build-system) + (arguments + `(#:install-plan '((,(string-append "model_files/" rating "/final_" + rating "-40.pb.gz") ,(string-append + "share/lc0/maia-" + rating ".pb.gz"))))) + (synopsis "Human-like neural network for Leela Chess Zero") + (description + "Maia’s goal is to play the human move — not necessarily the best move. +As a result, Maia has a more human-like style than previous engines, matching +moves played by human players in online games over 50% of the time.") + (home-page "https://maiachess.com") + (license license:gpl3))) + +(define-public lc0-maia-1100 + (make-lc0-maia "1100")) + +(define-public lc0-maia-1200 + (make-lc0-maia "1200")) + +(define-public lc0-maia-1300 + (make-lc0-maia "1300")) + +(define-public lc0-maia-1400 + (make-lc0-maia "1400")) + +(define-public lc0-maia-1500 + (make-lc0-maia "1500")) + +(define-public lc0-maia-1600 + (make-lc0-maia "1600")) + +(define-public lc0-maia-1700 + (make-lc0-maia "1700")) + +(define-public lc0-maia-1800 + (make-lc0-maia "1800")) + +(define-public lc0-maia-1900 + (make-lc0-maia "1900")) -- 2.41.0
Nicolas Goaziou <mail <at> nicolasgoaziou.fr>
:zamfofex <zamfofex <at> twdb.moe>
:Message #73 received at 63088-done <at> debbugs.gnu.org (full text, mbox):
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr> To: 63088-done <at> debbugs.gnu.org Cc: zamfofex <zamfofex <at> twdb.moe>, Liliana Marie Prikler <liliana.prikler <at> gmail.com>, iyzsong <at> envs.net, Simon Tournier <zimon.toutoune <at> gmail.com> Subject: Re: [PATCH 0/3] Add Lc0 Date: Sun, 23 Feb 2025 10:59:27 +0100
Hello, I applied the patch set and updated lc0 to its latest release. Regards, -- Nicolas Goaziou
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Wed, 26 Feb 2025 20:21:02 GMT) Full text and rfc822 format available.Message #76 received at 63088-done <at> debbugs.gnu.org (full text, mbox):
From: zamfofex <zamfofex <at> twdb.moe> To: Nicolas Goaziou <mail <at> nicolasgoaziou.fr>, 63088-done <at> debbugs.gnu.org Cc: Liliana Marie Prikler <liliana.prikler <at> gmail.com>, å®ææ¦ <iyzsong <at> envs.net>, Simon Tournier <zimon.toutoune <at> gmail.com> Subject: Re: [PATCH 0/3] Add Lc0 Date: Wed, 26 Feb 2025 17:20:41 -0300 (BRT)
Hello. I am really happy to see this finally being accepted! I want to note, though: The latest versions of Lc0 introduced a reproducibility regression by compiling with ‘-march=native’ on release builds. I don’t have Guix installed at this moment, but I wanted to mention it in case a fix is warranted. It should be enough to patch the Meson build script to remove the inclusion of ‘-march=native’.
guix-patches <at> gnu.org
:bug#63088
; Package guix-patches
.
(Sat, 01 Mar 2025 19:47:02 GMT) Full text and rfc822 format available.Message #79 received at 63088-done <at> debbugs.gnu.org (full text, mbox):
From: Nicolas Goaziou <mail <at> nicolasgoaziou.fr> To: zamfofex <zamfofex <at> twdb.moe> Cc: 63088-done <at> debbugs.gnu.org, Liliana Marie Prikler <liliana.prikler <at> gmail.com>, å®ææ¦ <iyzsong <at> envs.net>, Simon Tournier <zimon.toutoune <at> gmail.com> Subject: Re: [bug#63088] [PATCH 0/3] Add Lc0 Date: Sat, 01 Mar 2025 20:46:07 +0100
Hello, zamfofex <zamfofex <at> twdb.moe> writes: > Hello. I am really happy to see this finally being accepted! > > I want to note, though: The latest versions of Lc0 introduced a reproducibility regression by compiling with ‘-march=native’ on release builds. > > I don’t have Guix installed at this moment, but I wanted to mention it > in case a fix is warranted. It should be enough to patch the Meson > build script to remove the inclusion of ‘-march=native’. Fixed. Thanks for the heads up! Regards, -- Nicolas Goaziou
Debbugs Internal Request <help-debbugs <at> gnu.org>
to internal_control <at> debbugs.gnu.org
.
(Sun, 30 Mar 2025 11:24:38 GMT) Full text and rfc822 format available.
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.