Edit on GitHub

Unsorted docs from GitHub wiki

This section contains unsorted documents imported from our GitHub wiki.


[[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]]


[[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.


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

There is no single “best net” for Leela but there a few worth recommending for various purposes. The most important consideration in choosing a net is picking the right size for your hardware and time controls (TC).

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.

CLOP tuning

TCEC Season 13 tuning Master (and thus div4) is result of a CLOP tune at 4000 games. Div3 updated the prune factor and time scale based on results at 8000 games as CLOP continued to run during div4.

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 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.


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 Lc0 has three main parts: NAME FILE Function Needed for Contributing Needed for Playing Engine lc0.exe Does the tree search and calls the NN to get evaluations YES YES Network (NN) Varies e.

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.


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.


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 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.

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

Project History

See also our blog Discord chat #announcements and #dev-log have the most detailed updates. T53 Same as T52, plus: Endgame temperature 0 T52 Same as T51, plus: mask_legal_moves: Don’t require the NN to output zeros for illegal moves.

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 GPU (a graphics processor 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 GUI

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 chess GUI. Video Tutorial Here’s a small video showing the steps described below, just in case you need to see it in action:

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

Third Party Nets

Outside the official training nets on http://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 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.

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.