all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
blob 495d93b1105248136335c9b5189498dc290aa158 8958 bytes (raw)
name: gnu/packages/lc0.scm 	 # note: path name is non-authoritative(*)

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
 
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2023 zamfofex <zamfofex@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 utils)
  #:use-module (guix build-system copy)
  #: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)
  #: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+)))

(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."))

(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"))

debug log:

solving 495d93b110 ...
found 495d93b110 in https://yhetil.org/guix/b93e960c939063736be886813ef9fe6257eb81fe.1694519893.git.zamfofex@twdb.moe/
found 1cda2efd1c in https://yhetil.org/guix/845cc1e6b38e26aba3c99c4934c4d2f9c6e2b6e2.1694519893.git.zamfofex@twdb.moe/
found e19436c381 in https://yhetil.org/guix/e1d63918a715887aaf29000cc47d5640e8ed4176.1694569781.git.zamfofex@twdb.moe/ ||
	https://yhetil.org/guix/e1d63918a715887aaf29000cc47d5640e8ed4176.1694519893.git.zamfofex@twdb.moe/

applying [1/3] https://yhetil.org/guix/e1d63918a715887aaf29000cc47d5640e8ed4176.1694569781.git.zamfofex@twdb.moe/
diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm
new file mode 100644
index 0000000000..e19436c381

Checking patch gnu/packages/lc0.scm...
Applied patch gnu/packages/lc0.scm cleanly.

skipping https://yhetil.org/guix/e1d63918a715887aaf29000cc47d5640e8ed4176.1694519893.git.zamfofex@twdb.moe/ for e19436c381
index at:
100644 e19436c381425f2d95094a7154148f4ea18af0b6	gnu/packages/lc0.scm

applying [2/3] https://yhetil.org/guix/845cc1e6b38e26aba3c99c4934c4d2f9c6e2b6e2.1694519893.git.zamfofex@twdb.moe/
diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm
index e19436c381..1cda2efd1c 100644


applying [3/3] https://yhetil.org/guix/b93e960c939063736be886813ef9fe6257eb81fe.1694519893.git.zamfofex@twdb.moe/
diff --git a/gnu/packages/lc0.scm b/gnu/packages/lc0.scm
index 1cda2efd1c..495d93b110 100644

Checking patch gnu/packages/lc0.scm...
Applied patch gnu/packages/lc0.scm cleanly.
Checking patch gnu/packages/lc0.scm...
Applied patch gnu/packages/lc0.scm cleanly.

index at:
100644 495d93b1105248136335c9b5189498dc290aa158	gnu/packages/lc0.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.