Not logged inCSS-Forum
Forum CSS-Online Help Search Login
CSS-Shop Impressum Datenschutz
Up Topic Hauptforen / Schachprogrammierung / Lc0
- By Lothar Jung Date 2021-09-22 10:28 Edited 2021-09-22 10:32 Upvotes 1
Hier die Build Datei:

https://github.com/LeelaChessZero/lc0/blob/master/build.cmd

Hier die GitHub Seite von Lc0 mit allen Informationen und Verweisen:

https://github.com/LeelaChessZero/lc0
- By Lothar Jung Date 2021-09-23 14:56 Upvotes 1
Ceres eine unabhängige Weiterentwicklung von Lc0 „Ceres - an MCTS chess engine for research and recreation“:

https://github.com/dje-dev/Ceres
- - By Lothar Jung Date 2021-09-23 17:32 Edited 2021-09-23 17:37 Upvotes 1
Hier sind zwei Derivate von Lc0:

https://github.com/Zeta36/leela-fish

Suche von SF, Eval von Lc0

https://github.com/QueensGambit/CrazyAra

Suche von Lc0, Eval Netz von menschlichen Partien
Parent - By Lothar Jung Date 2021-09-26 13:12 Upvotes 1
Hier die Webseite von CrazyAra:

https://crazyara.org/
- By Lothar Jung Date 2021-09-23 18:43 Upvotes 1
Nibbler, eine AnalyseGPU vor allem für Lc0:

https://github.com/rooklift/nibbler
- By Lothar Jung Date 2021-09-25 09:43 Edited 2021-09-25 09:48 Upvotes 1
Hier ein Diagramm über die Struktur von Lc0:

https://discord.com/channels/425419482568196106/425419999096733706/891096507661561857
- By Lothar Jung Date 2021-10-07 20:42 Upvotes 1
Hier eine Veröffentlichung über Verbesserungen von AlphaZero:

Improvements to Increase the Efficiency of the AlphaZero Algorithm

https://www.scitepress.org/Papers/2021/102459/102459.pdf
- By Lothar Jung Date 2021-10-11 18:30 Edited 2021-10-11 18:48 Upvotes 1
Wie Lc0 die Züge im Suchbaum evaluiert (übersetzt aus https://lczero.org/dev/wiki/technical-explanation-of-leela-chess-zero/ ):

Leela durchsucht einen Baum von Zügen und Spielzuständen.  Jeder Spielzustand ist ein Knoten im Baum mit einem geschätzten Wert für diese Position und einer priorisierten Liste von zu berücksichtigenden Zügen (die so genannte Richtlinie für diese Position).  Traditionelle Schach-Engines haben ein sehr fein ausgearbeitetes Wert- und Richtliniengenerierungssystem;  Im Gegensatz zu herkömmlichen Engines verwendet Leela sein neuronales Netzwerk, das ohne menschliches Wissen trainiert wurde, sowohl für den Wert als auch für die Generierung von Richtlinien.  Dann erweitert Leela den Baum, um ein besseres Verständnis des Wurzelknotens, der aktuellen Position, zu erhalten.

Leela verwendet PUCT (Predictor + Upper Confidence Bound Tree Search). Es werden neue Knoten evaluiert, indem wir ein Playout durchführen: Beginnend mit dem Wurzelknoten (der aktuellen Position), wird ein zu erkundenden Zug gewählt und wiederholen Sie den Baum, bis eine Spielposition erreichet wird, die noch nicht untersucht wurde (oder eine Position, die die  Spiel, das als Endknoten bezeichnet wird). Der  den Baum mit dieser neuen Position erweitert  (unter der Annahme eines Nicht-Endknotens) und verwenden das neuronale Netz, um eine erste Schätzung des Wertes für die Position sowie die Richtlinie für weitere Bewegungen zu erstellen.  In Leela ist eine Richtlinie für einen Knoten eine Liste von Bewegungen und eine Wahrscheinlichkeit für jede Bewegung.  Die Wahrscheinlichkeit gibt die Wahrscheinlichkeit an, dass ein automatischer Spieler, der die Richtlinie ausführt, diesen Zug macht.  Nachdem dieser Knoten zum Baum hinzugefügt wurde, wird diesen neuen Wert auf allen Knoten gesichert, die während dieses Playouts besucht wurden.  Dies verbessert langsam den Wert verschiedener Pfade durch den Spielbaum.

Wenn tatsächlich ein Zug auf dem Brett gespielt wird, wird der gewählte Zug zur neuen Wurzel des Baumes.  Die alte Wurzel und die anderen Kinder dieses Wurzelknotens werden gelöscht.

Dies ist die gleiche Suche, die vom AGZ-Papier PUCT (Predictor + Upper Confidence Bound Tree Search) spezifiziert wird.  Viele Leute nennen dies MCTS (Monte-Carlo Tree Search), weil es dem Suchalgorithmus sehr ähnlich ist, den die Go-Programme im Jahr 2006 verwendet haben. Aber das in AGZ und Lc0 verwendete PUCT ersetzt Rollouts (Sampling von Playouts zu einem Terminal-Spielzustand) mit  ein neuronales Netz, das abschätzt, was ein Rollout bewirken würde.  Andere Suchalgorithmen werden auf Github von Leela Go in Erwägung gezogen, aber es besteht noch kein wirklicher Konsens darüber, dass etwas anderes nachweislich besser ist als PUCT.  Dies ist ein aktives Forschungsthema in der Überschneidung der Bereiche der KI sowie der Spieltheorie.
- By Lothar Jung Date 2021-10-12 19:41 Edited 2021-10-12 19:45 Upvotes 1
Hier eine gute Wikipedia Zusammenfassung von AlphaZero:

https://de.wikipedia.org/wiki/AlphaZero?wprov=sfti1
- By Lothar Jung Date 2021-10-13 12:18 Upvotes 1
Hier eine mathematische Beschreibung der Lc0-Parameter:

https://lczero.org/blog/2020/04/a-laymans-guide-to-configuring-lc0/
- By Lothar Jung Date 2021-10-16 11:20 Upvotes 1
Hier die Fortsetzung des Buches „Game Changer“ von Matthew Sadler:

„The Silicon Road to Chess Improvement
Chess Engine Training Methods, Opening Strategies & Middlegame Techniques“

https://www.newinchess.com/media/wysiwyg/product_pdf/9125.pdf

Mit vielen Stellungsbeispielen.
- By Lothar Jung Date 2021-11-14 19:43 Upvotes 1
Hier von GitHub:

https://github.com/LeelaChessZero/lc0/wiki/Technical-Explanation-of-Leela-Chess-Zero
- - By Lothar Jung Date 2022-03-30 12:10 Edited 2022-03-30 12:24 Upvotes 1
Hier die grundsätzliche Veröffentlichung über attention nets:

https://arxiv.org/pdf/1706.03762v5.pdf

Hier ein GitHub Projekt über „Attention Policy“:

https://github.com/LeelaChessZero/lc0/pull/1688

Hier ein GitHub Projekt über „Attention Net Training“:

https://github.com/Arcturai/lczero-training/tree/attention-net-body/tf
Parent - By Peter Martan Date 2022-03-30 12:18 Edited 2022-03-30 12:44 Upvotes 1
Danke, Lothar.
Ich würde die attention an Stelle der Entwickler mal darauf legen, dass eine backward analysis auch irgendeinen Einfluss gewänne, wenigstens irgendwie dem vergleichbar, was sie bei A-B-Suche bewirkt.
Und wann kommen endlich bei LC0 (und oder bei NNUE) die Netze, die während des Spielens mit der Engine weiter lernen?
Oder ein halbwegs praktikables Anwender- Script oder eine batch- Datei mit dem oder der man bestehende Netze selbst weiter trainieren könnte?
Sodass man nur noch .pgn oder .epd- Sammlungen vorgeben müsste und das Netz, von dem man ausgeht, übrigens auch ein echtes Hoffnungsgebiet für ein GUI, dessen Aufgabe es ja viel mehr wäre als die der Engine, wünscht sich schon lange:
- By Lothar Jung Date 2022-04-26 23:05 Upvotes 1
Hier die Veröffentlichung über „ Improving AlphaZero Using Monte-Carlo Graph Search“:

https://ml-research.github.io/papers/czech2021icaps_mcgs.pdf
- By Lothar Jung Date 2022-06-20 13:34 Edited 2022-06-20 13:37 Upvotes 1
Lc0 auf iGPU und DX12:

Lothar Jung schrieb:

Hallo Wolfgang,

meine Ryzen 5800h hat eine integrierte Vega 6 iGPU. Sie hat einen TDP von 15 Watt.
Hier ein umfassender Test: <a class='ura' href='https://www.notebookcheck.net/AMD-Radeon-RX-Vega-6-Ryzen-4000-GPU-Benchmarks-and-Specs.453149.0.html'>https://www.notebookcheck.net/AMD-Radeon-RX-Vega-6-Ryzen-4000-GPU-Benchmarks-and-Specs.453149.0.html</a>

Hallo Lothar,

die Vega11 ist in einer etwas älteren APU (Ryzen 5 2400g @ 3,9 GHZ) enthalten.
Aktuell habe ich zwei Ryzen 5 5600g im Einsatz. Diese enthalten eine Vega8, die deutlich höher getaktet ist, 1900 statt 1300 MHZ.
Das Verhältnis von CPU zu GPU bleibt aber in etwa gleich, da auch der CPU-Teil beim 5600g trotz gleicher Taktfrequenz deutlich schneller ist. Von daher habe ich an der Bezeichnung nichts geändert, obwohl sie korrekterweise "Vega8" lauten müsste...

Zitat:
Ich möchte sie gerne testen.
Könntest Du mir Deine backend Einstellungen für die iGPU übermitteln?

Ich habe von Discord folgende Informationen:

„To run on the igpu you can get the binaries and dll from <<a class='ura' href='https://ci.appveyor.com/project/LeelaChessZero/lc0/builds/43650133/job/9t8pjuo2472vgiem/artifacts'>https://ci.appveyor.com/project/LeelaChessZero/lc0/builds/43650133/job/9t8pjuo2472vgiem/artifacts</a>> and will also need the mimalloc dlls from the release. Then you need to add `--backend-opts=gpu=0` (or the equivalent uci option). However this may time out when initializing the backend with cutechess, so you need to add `--preload` to the command (cutechess allows this) and also specify the network file on the command or just have one network file in the directory. Finally a `cl_cache` subdirectory will reduce startup time on subsequent runs.“

Ich kann ehrlich gesagt mit Discord wenig anfangen, bin da nicht angemeldet und werde es auch nicht. Notfalls kenne ich wen, der wen kennt der dort angemeldet ist...

Meine Quelle ist immer https://lczero.org/play/download/
Von dort habe ich mir das DX12 Backend heruntergeladen: "Newer non-NVidia GPUs (only for latest versions of Windows 10)", https://github.com/LeelaChessZero/lc0/releases/download/v0.28.2/lc0-v0.28.2-windows10-gpu-dx12.zip
Das läuft out of the box, notwendige DLLs sind enthalten. Leider laufen aktuellere Netze ab T78... aktuell nicht auf AMD, das wird sich hoffentlich bald ändern.
Es empfiehlt sich auch, nicht die ganz "dicken Dinger" zu nutzen, sind einfach zu langsam. Optimal sind derzeit m.E. die 15x192 Netze, das stärkste ist 771721.

Ich nutze das Ganze ausschließlich unter Arena 3.5.1 und stelle da nichts spezielles ein, sondern nutze die Default-Einstellungen.
Einzige Ausnahme ist der NNCache den ich von 200000 auf 1000000 erhöht habe.
Backend DX12 ist vorbelegt, den Pfad zum Netz musst du nur setzen, wenn mehrere im Verzeichnis sind und das gewünschte nicht das neueste der vorhandenen Netze ist.
- By Lothar Jung Date 2022-07-02 11:09 Upvotes 1
Ein Artikel über Directed-acyclic-graph

https://www.researchgate.net/figure/Directed-acyclic-graph-DAG-of-the-complete-data-under-the-missing-at-random-V-0_fig2_223990821
- By Lothar Jung Date 2022-07-08 16:58 Upvotes 1
Veröffentlichung "Assessing Game Balance with AlphaZero:
Exploring Alternative Rule Sets in Chess"

https://arxiv.org/pdf/2009.04374.pdf
- By Lothar Jung Date 2022-07-13 15:39 Upvotes 1
Hier eine bildhafte Übersicht über die Zusammenhänge zwischen Value und Policy Head:

https://cdn.discordapp.com/attachments/456135840012173313/996460537917476894/unknown.png
- - By Lothar Jung Date 2022-07-29 20:25 Upvotes 1
Hier eine grafische Übersicht:

https://medium.com/applied-data-science/alphago-zero-explained-in-one-diagram-365f5abf67e0
Parent - By Lothar Jung Date 2022-07-30 10:50 Upvotes 1
Und hier eine Einführung „A Simple Alpha(Go) Zero Tutorial“:

https://web.stanford.edu/~surag/posts/alphazero.html
- By Lothar Jung Date 2022-10-03 19:47 Upvotes 1
Hier ist der Anfang einer Serie von bisher 6 Veröffentlichungen zu „Lessons From Implementing AlphaZero“:

https://medium.com/oracledevs/lessons-from-implementing-alphazero-7e36e9054191
- By Lothar Jung Date 2022-10-08 16:08 Edited 2022-10-08 16:19 Upvotes 1
Hier zwei Grafik-Links zu MultiHeadAttention mit einer Erklärung:

https://cdn.discordapp.com/attachments/425419483016855563/1028299392635113502/unknown.png

https://cdn.discordapp.com/attachments/425419483016855563/1028299421101858826/unknown.png

Transformer is completely different arch, no convolutional NN tower there.
We use encoder only and 3 heads at the end (Attention policy, WDL value and Moves Left heads).
12 blocks, 8 heads, DFF (feed forward) 1536.
Kind of like GPT3 "small"
- By Lothar Jung Date 2022-10-28 09:54 Edited 2022-10-28 10:15 Upvotes 1
Sehr gute Lc0 Präsentation:

https://slides.com/crem/lc0#/logo

Eine umfassende technische Erläuterung von Lc0:

https://lczero.org/dev/wiki/technical-explanation-of-leela-chess-zero/
- - By Lothar Jung Date 2022-12-10 10:33 Upvotes 1
Compilierung von Lc0:

Give me the command to download and compile the lc0 repository from github on windows.
To download and compile the lc0 repository on Windows, you will need to have Git and a C++ compiler installed on your system. You can then follow these steps:

Open a command prompt or terminal and navigate to the directory where you want to download the lc0 repository.

Run the following command to clone the lc0 repository from GitHub:

```
git clone https://github.com/LeelaChessZero/lc0.git```
Navigate to the lc0 directory that was just created by the clone command:
```
cd lc0```
Run the following command to compile the lc0 source code:
```
cmake -G "Visual Studio 16 2019" -A x64 -DBLAS=OpenBLAS -DUSE_AVX2=ON -DUSE_AVX512=ON -DUSE_OPENMP=ON```
Once the compilation is complete, you can run lc0 by navigating to the build/release directory and running the lc0.exe executable.
```
cd build/release
lc0.exe
```
I want to run the cuda backend, what do I need to change above ?
To compile the lc0 repository with support for the CUDA backend, you will need to have the CUDA Toolkit installed on your system. You will also need a GPU that supports CUDA.

You can then follow the steps above, but when you run the cmake command, you will need to add the -DUSE_CUDA=ON flag to enable CUDA support:
```
cmake -G "Visual Studio 16 2019" -A x64 -DBLAS=OpenBLAS -DUSE_AVX2=ON -DUSE_AVX512=ON -DUSE_OPENMP=ON -DUSE_CUDA=ON
```
Once the compilation is complete, you can run lc0 with the CUDA backend by specifying the --backend=cudnn flag when running the lc0.exe executable:

```
cd build/release
lc0.exe --backend=cudnn
```
Note that you may need to set the CUDA_PATH environment variable to the path of your CUDA installation in order for the cmake command to find the CUDA libraries. For example, if CUDA is installed in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0, you would set the CUDA_PATH environment variable like this:

```
set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
```
You can then run the cmake command as described above.

chatGPT can troubleshoot lc0 installation and compilation problems.
Parent - By Max Siegfried Date 2022-12-10 12:21
Lothar Jung schrieb:

Compilierung von Lc0:

Give me the command to download and compile the lc0 repository from github on windows.
To download and compile the lc0 repository on Windows, you will need to have Git and a C++ compiler installed on your system. You can then follow these steps:

Open a command prompt or terminal and navigate to the directory where you want to download the lc0 repository.

Run the following command to clone the lc0 repository from GitHub:

```
git clone <a class='ura' href='https://github.com/LeelaChessZero/lc0.git```'>https://github.com/LeelaChessZero/lc0.git```</a>
Navigate to the lc0 directory that was just created by the clone command:
```
cd lc0```
Run the following command to compile the lc0 source code:
```
cmake -G "Visual Studio 16 2019" -A x64 -DBLAS=OpenBLAS -DUSE_AVX2=ON -DUSE_AVX512=ON -DUSE_OPENMP=ON```
Once the compilation is complete, you can run lc0 by navigating to the build/release directory and running the lc0.exe executable.
```
cd build/release
lc0.exe
```
I want to run the cuda backend, what do I need to change above ?
To compile the lc0 repository with support for the CUDA backend, you will need to have the CUDA Toolkit installed on your system. You will also need a GPU that supports CUDA.

You can then follow the steps above, but when you run the cmake command, you will need to add the -DUSE_CUDA=ON flag to enable CUDA support:
```
cmake -G "Visual Studio 16 2019" -A x64 -DBLAS=OpenBLAS -DUSE_AVX2=ON -DUSE_AVX512=ON -DUSE_OPENMP=ON -DUSE_CUDA=ON
```
Once the compilation is complete, you can run lc0 with the CUDA backend by specifying the --backend=cudnn flag when running the lc0.exe executable:

```
cd build/release
lc0.exe --backend=cudnn
```
Note that you may need to set the CUDA_PATH environment variable to the path of your CUDA installation in order for the cmake command to find the CUDA libraries. For example, if CUDA is installed in C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0, you would set the CUDA_PATH environment variable like this:

```
set CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v10.0
```
You can then run the cmake command as described above.

chatGPT can troubleshoot lc0 installation and compilation problems.


Auf meinem MacBook Pro 16-Zoll M1 MAX funktioniert das viel einfacher und schneller:

cd /Users/ich/lc0-master/ 
./build.sh

fertig.
- By Lothar Jung Date 2022-12-19 19:50 Upvotes 1
Hier die Veröffentlichung „Acquisition of Chess Knowledge in AlphaZero“:

https://arxiv.org/pdf/2111.09259.pdf

https://storage.googleapis.com/uncertainty-over-space/alphachess/index.html?factor=5
- By Lothar Jung Date 2023-02-08 16:28
Hier eine neue Implementierung der Q-Funktion:

https://github.com/LeelaChessZero/lc0/pull/1802
- By Lothar Jung Date 2023-03-07 18:01
Hier eine sehr anschauliche und lehrreiche Lc0 Präsentation:

https://slides.com/crem/lc0#/logo

Sehr empfehlenswert!

Hier eine umfassende technische Erläuterung von Lc0:

https://lczero.org/dev/wiki/technical-explanation-of-leela-chess-zero/
- - By Lothar Jung Date 2023-03-19 16:07
https://www.chess-journal.com/evaluatingSharpness1.html
Parent - By Peter Weise Date 2023-03-19 16:50
Die 13te oder sind wir bereits bei 14?!
Da kommt man gar nicht mehr hinterher ...
- By Lothar Jung Date 2023-04-25 12:11
Hier eine interaktive und sehr anschauliche Präsentation über Lc0, MCTS und Training:

https://slides.com/crem/lc0#/18/0/0
- By Lothar Jung Date 2023-04-26 09:47
Weiter Entwicklung von Lc0:

https://github.com/Ergodice/lczero-training/blob/attention-net-body/README.md
Up Topic Hauptforen / Schachprogrammierung / Lc0

Powered by mwForum 2.29.3 © 1999-2014 Markus Wichitill