Edit on GitHub

Unsorted docs from GitHub wiki

This section contains unsorted documents imported from our GitHub wiki.

_Sidebar

[[Home]] [[Getting-Started]] [[FAQ]] [[Benchmarks]] [[Known Issues]] [[Instructions]] [[Debug and test procedures]] [[Neural Net Training]] [[Project History]] [[Why Zero]] [[lc0 transition]] [[Training runs]] [[TCEC]] [[CLOP tuning]] [[Third Party Nets]]

android

[[Home]] [[Getting-Started]] [[FAQ]] [[Benchmarks]] [[Known Issues]] [[Instructions]] [[Debug and test procedures]] [[Neural Net Training]] [[Project History]] [[Why Zero]] [[lc0 transition]] [[Training runs]] [[TCEC]] [[CLOP tuning]] [[Third Party Nets]] [[What is Lc0?

Batchsize Node Collisions Testing

1024 bs 256 nc (cccc 2 params) vs default so far. Score of lc0 v18 1024 vs lc0 v18: 33 - 45 - 89 [0.464] Elo difference: -25.01 +/- 36.08 Trying medium vs large batchsize.

Beginner Friendly Guide on Training and Testing a Net on Google Colab

Introduction This is intended to be a beginner-friendly guide on how to train and bench (against the CCRL Baseline Net) lczero neural networks. This is probably the place to look if you’re stuck with no GPU / an AMD one (as I am), and if you don’t use linux.

Benchmarks

Run go infinite from start position and abort after depth 26 and report NPS output. I put some sample ones from memory. Please put your own bench scores here in sorted NPS order if you can.

Best Nets for Lc0

In general, for game analysis and long calculation time per move, the largest network compatible with your hardware is recommended. In use cases with very low calculation time per move or slow hardware, a smaller network might be a better choice.

Building lc0 on Android, with Termux

Important: If you just want to run lc0 on your Android device then the steps described here are no longer needed. Now there’s an easier way to run lc0 without having to build it your own.

Building lc0 with Termux

Important: If you just want to run lc0 on your Android device then the steps described here are no longer needed. Now there’s an easier way to run lc0 without having to build it your own.

CCCC

The Chess.com Computer Chess Championship (CCCC) is continuously running computer chess events and is maintained by Chess.com at https://www.chess.com/computer-chess-championship. CCC 17 Blitz: Finals Executable Network Placement Result v0.

CLOP tuning

CLOP Tuning is a tool used for figuring out what differentiable constants, functions, or other things should gain lc0 the most Elo/improve performance. CLOP Tuner: https://github.com/kiudee/bayes-skopt TCEC Season 13 tuning Master (and thus div4) is result of a CLOP tune at 4000 games.

Contributing Training Games

Contribute Use the below resources to contribute to the project through FREE google credits [[Run LC0 client on Google Cloud|Google-Cloud-guide-(lc0)]] [[Run LC0 client on Google Colab|Run-Leela-Chess-Zero-client-on-a-Tesla-K80-GPU-for-free-(Google-Colaboratory)]] Use the link below if you want to contribute with your own hardware

Debug and test procedures

Example tournament command line ./cutechess-cli -rounds 100 -tournament gauntlet -concurrency 2 -pgnout results.pgn \ -engine name=lc_gen13_fpu cmd=lczero_fpu arg="--threads=1" arg="--weights=$WDR/cd1a1e" arg="--playouts=800" arg="--noponder" arg="--noise" tc=inf \ -engine name=lc_gen13 cmd=lczero arg="--threads=1" arg="--weights=$WDR/cd1a1e" arg="--playouts=800" arg="--noponder" arg="--noise" tc=inf \ -each proto=uci Analysis of positions (I think with some upcoming patches we can do this in GUIs together with -l lzcdebug.

Dubslow's analysis of Test 10 problems

So, the major assumption that goes into this is that the Tensorboard data is a reliable sole source of information for the information it provides. That’s quite reasonable (if it wasn’t we may as well give up the project), but it’s also in contrast to the various Elo measurements we have, none of which are a single sole reliable source of playing strenth – instead they all need to be considered collectively.

FAQ

Where do I start? To contribute to the project, see [[Getting Started]] and follow the instructions for running self-play training games. To just run the engine locally, see [[Getting Started]] and follow the instructions for running the engine.

Getting Started

Basics To help the project by donating GPU time, here’s the gist of what you need to do: Download and install the Client and Engine Run the client.

Google Cloud guide (lc0)

This guide will allow you to have Leela Chess Zero clients running in the cloud in 10 minutes or less. These clients will run self-play training games and help make Leela stronger.

Home

FAQ Getting started Best Networks LC0 Options Benchmarking Project History Tournament History: TCEC CCCC Knowledge Base: Technical Explanation of Leela Chess Zero What is LC0? What is LC0?

Instructions

Below a list of Guides / instructions for various task. [[Google Cloud guide (lc0)]] To contribute to the project for free [[Run Leela Chess Zero client on a Tesla K80 GPU for free (Google Colaboratory)]] [[Running lczero with cuda and cudnn under nvidia docker2]] [[Running Leela Chess Zero as a Lichess Bot]] [[Running Leela Chess Zero in a Chess GUI]] [[Running Leela Chess Zero in a Chess GUI (lc0)]] [[Running Leela Chess Zero on Intel CPUs (Haswell or later)]] [[Ubuntu 16.

Known Issues

There are several known issues with Leela Chess Zero play and training runs. Some of them have already been solved and are listed for “historical documentation”, while others are still being investigated.

Large Elo fluctuations starting from ID253

Below is a brief summary of our investigation into the issues that started showing up in the Elo graph from ID253. We have been performing a number of tests that require changing parameters, generating new self-play games, and training on those.

Lc0 for 32 bit windows

32 bit processors and operating systems are supported by lc0. However CUDNN is not available for such platforms, so only the blas and opencl backends can be built. There are no official builds distributed, but the latest version available can be found using the following links:

Lc0 options

Lc0 options Flag UCI option Description –help, -h Show help and exit. –weights, -w WeightsFile Path from which to load network weights.

Leela Chess Zero Wiki

Wiki Overview FAQ Getting started Best Networks LC0 Options Benchmarking Guides: Running LC0 in a Chess GUI Running LC0 on Android with a Chess GUI Building LC0 with Termux Running LC0 on Intel CPUs (Haswell or later) Ubuntu 16.

Leela Self play in Docker

Docker Install docker for your box Create temporary folder mkdir ~/temp && cd ~/temp Create a file named Dockerfile and paste the following From ubuntu:latest RUN apt-get update RUN apt install g++ git libboost-all-dev libopenblas-dev opencl-headers ocl-icd-libopencl1 ocl-icd-opencl-dev zlib1g-dev cmake wget supervisor curl -y RUN apt install clinfo && clinfo RUN mkdir /lczero && \ cd ~ && \ git clone https://github.

Missing Shallow Tactics

Leela Chess is known to miss relatively shallow tactics in relation to the high level of play. The below is a rough draft explaining how the search works and why it misses shallow tactics.

networks

Welcome to the Leela Chess Zero wiki! Lc0 is a UCI-compliant chess engine designed to play chess via neural network [[FAQ]] Find the answers to [[Frequently Asked Question|FAQ]] Play Chess with LC0 [[Getting-Started]] - Download and run lc0.

Neural Net Training

The self-play games your client creates are used by the central server to improve the neural net. This process is called training (many people call the process of running the client to produce self-play games training, but in machine learning these games are only the input data for the actual training process).

Overview

FAQ Getting started Best Networks LC0 Options Benchmarking Guides: Running LC0 in a Chess GUI Running LC0 on Android with a Chess GUI Building LC0 with Termux Running LC0 on Intel CPUs (Haswell or later) Ubuntu 16.

Project History

See also our blog Discord chat #announcements and #dev-log have the most detailed updates. T80 Start date: 2022-04-03 Network size: 15 residual blocks, 512 filters Attention policy head with 0 encoder layers, ReLU activations replaced with mish Training started from an initial net trained by tilps on T79 data for ~2m steps Initial learning rate of 0.

Run Leela Chess Zero client on a Tesla K80 GPU for free (Google Colaboratory)

Google Colaboratory (Colab) is a free tool for machine learning research. It is a Python notebook running in a Virtual Machine using an NVIDIA Tesla K80, T4, V100 and A100 GPU (a graphics processors developed by the NVIDIA Corporation).

Run Leela Chess Zero client on a Tesla T4 GPU for free (Google Colaboratory)

Google Colaboratory (Colab) is a free tool for machine learning research. It is a Python notebook running in a Virtual Machine using an NVIDIA Tesla K80, T4, V100 and A100 GPU (a graphics processors developed by the NVIDIA Corporation).

Running a benchmark

How to run a benchmark on Windows: Open the directory where Lc0 is located. Hold Shift key on your keyboard and right-click on the empty space of the window, so that directory popup menu appears.

Running lc0 on Android with a Chess App

Follow these simple steps and you’ll be running lc0 on your Android device. No root needed. Just the right engine, a weights file and a supported Chess App. Video Tutorial Here’s a small video showing the steps described below, just in case you need to see it in action:

Running lc0 on Android with a chess GUI

Official support Since version 0.24, Leela Chess Zero has official support for Android. Get the APK from here: Installable package for the latest release https://github.com/LeelaChessZero/lc0/releases/latest After installing the APK you will need a chess app that supports the Open Exchange protocol, like the following:

Running lczero with cuda and cudnn under nvidia docker2

If you have nvidia-docker2 installed, it’s possible to run lczero under a docker container while still leveraging all the speed advantages of CUDA and cuDNN. See https://github.com/NVIDIA/nvidia-docker for instructions on setting up nvidia-docker2

Running Leela Chess Zero as a Lichess Bot

Introduction Lichess has developed a BOT API that allows anybody to hook up a chess engine to Lichess. Leela Chess Zero will make use of this API via the official bridge lichess-bot.

Running Leela Chess Zero on Intel CPUs (Haswell or later)

Update: While the MKL version may be useful for analysis, it will be quite slow when generating training games. If you have an newer intel CPU and no dedicated GPU, you can boost your nps by using Intel’s Math Kernel Library.

Script for testing new nets versus old nets on Google Colab

Use this script to run tournaments between different versions of Leela. https://cdn.discordapp.com/attachments/430695662108278784/436501331046563861/TestLeelaNets_v7.ipynb

TCEC S13 Issues

For TCEC Season 13, division 3, LC0 performed much worse than expected. This page summarizes the issues: TCEC server performance TCEC server is getting less NPS than expected. We expect ~26K from startpos, but only get 22K (source: jjosh in Discord).

Technical Explanation of Leela Chess Zero

Lc0 methods and input/output terms A nice pictorial overview Basics Leela searches a tree of moves and game states. Each game state is a node in the tree, with an estimated value for that position, and a prioritized list of moves to consider (called the policy for that position).

Testing guide

So you’d like to do some engine testing with Lc0 (testing different nets, checking if your improvement increases elo, etc.). Here’s how: Setup Install cutechess-cli. Repository here. cutechess-cli is a tool that allows you to play games and tournaments between multiple engines.

Third Party Nets

Outside the official training nets on https://training.lczero.org/networks/, some people are downloading the game data and training their own nets. See also: http://data.lczero.org/files/networks-contrib/ Wiki page for all of jhorthos’s experimental nets: https://github.

Training and Testing a Net on Google Colab: Beginner Friendly Guide

Introduction This is intended to be a beginner-friendly guide on how to train and bench (against the CCRL Baseline Net) lczero neural networks. This is probably the place to look if you’re stuck with no GPU / an AMD one (as I am), and if you don’t use linux.

Training data format versions

The training data generated by lc0 started with version 3 and were progressively updated to the current version 6. Earlier formats were generated by lczero. Version 3 training data format:

Training runs

Overview Run # Reference Summary Currently Active Net Numbers Best nets NA Old Main Original 192x15 “main” run No 1 to 601 ID595 test10 [[Lc0 Transition]] Original 256x20 test run No 10'000 to 11'262 11250 11248 test20 Training run reset Many changes, see blog.

Transposition tests

Data sets: FEN dataset: All positions from http://data.lczero.org/files/training_pgns/pgns-run1-20190419-1854.tar.bz2 (12'582'379 positions). Tree nodes after go nodes 1000000 from startpos with network id42482. Tree nodes after go nodes 1000000 from (middlegame) r2br3/ppq2pkp/2b2np1/4p3/6N1/2PB1Q1P/PP1B1PP1/R3R1K1 w - - 1 2 with network id42482.

Ubuntu 16

Building instructions for using CUDA backend For Ubuntu 17.10 and 18.04 see Troubleshooting section Should now work on 16.04 and 17.10, tested on fresh 16.04 docker and 17.10 docker In docker image remove sudo from start of all commands that have it.

Ubuntu 16

Note: These instructions apply to the lczero.exe client, not lc0.exe. See [[lc0-transition]] Option 1 (Sanity): Use Docker sudo apt install docker.io sudo docker pull rcostheta/leelachesszero-mkl sudo sudo docker exec -it $(sudo docker run -it -d -p 52062:22 rcostheta/leelachesszero-mkl) /file.

What is Lc0?

Lc0 (Leela Chess Zero) is a chess engine that uses a trained neural network to play chess. It was inspired by Google’s Alpha Zero project and Lc0’s current networks have since surpassed Alpha Zero’s strength.

What is Lc0? (for non programmers)

Lc0 is often referred to as a chess engine, however, Lc0 is more like a chess engine shell than an actual chess engine. This is often called “the binary”. Lc0 needs a neural network (also called a “weights file”) in order to play, just as a car requires a driver, or a mech requires a pilot.

Why Zero

“Zero” means that no human knowledge have been added, with the exception of the rules of the game (piece movement and victory condition). Even very simple strategic concepts (e.g. it’s good to have more pieces instead of less) were not taught to Leela Chess Zero.

XLA backend

Lc0 XLA backend uses OpenXLA compiler to produce code that executes a neural network. The backend takes ONNX as an input, and converts it to the HLO format that XLA understands.