2018-11-13

Where to play Leela online?

The play.lczero.org web site where everyone could quickly play Lc0 online is down pretty often recently.

But even while it doesn't work, there are some options to play Leela online.

The easiest way is to play on lichess.
There is for example a bot called LeelaChess, it is the very first lichess bot.
Also there are other bots of different configurations and strength. Check the all-the-leelas lichess team and pick the one which is online. You are also welcome to host your own Leela and join that team.

If you know other ways to play Leela online (FICS, etc), please reply in comments, I'll add it to this post.

And of course you can always download Leela and set it up to play locally. This blog post describes how to do that.

2018-11-03

Lc0 v0.19.0-rc1 (UPD: rc2) has been released.

The release candidate of a new Leela version has been released:

(v0.19.0-rc1)
Upd: we are releasing v0.19.0-rc2 immediately as due to mistake in the release procedure rc1 reported its version as v0.19.0-dev rather than v0.19.0-rc1

We expect testing phase to last around 7-10 days, after which proper v0.19.0 will be released.

Download here. Please test it thoroughly and report any bugs that you find.
Note: CudNN builds for Windows are now compiled with CUDA 10. You may need to update you GPU driver to run it.

Please don't use release candidates to generate training games. We only use stable versions for that.

What's new:

Search algorithm changes

When visiting terminal nodes and collisions, instead of counting that as one visit, estimate how many subsequent visits will also go to the same node, and do a batch update.
That should slightly improve nps near terminal nodes and in multithread configurations. Command line parameters that control that:
  • --max-collision-events – number of collision events allowed per batch. Default is 32. This parameter is roughly equivalent to --allowed-node-collisions in v0.18.
  • --max-collision-visits – total number of estimated collisions per NN batch. Default is 9999.

Time management

  • Multiple changes have been done to make Leela track used time more precisely (particularly, the moment when to start timer is now much closer to the moment GUIs start timer).
  • For smart pruning, Leela's timer only starts when the first batch comes from NN eval. That should help against instamoves, especially on non-even GPUs.
  • Also Leela stops the search quicker now when it sees that time is up (it could continue the search for hundreds of milliseconds after that, which caused time trouble if opponent moves very fast).
Those changes should help a lot in ultra-bullet configurations.

Better logging

Much more information is outputted now to the log file. That will allow us to easier diagnose problems if they occur. To have debug file written, add a command line option:
--logfile=/path/to/logfile
(or short option "-l /path/to/logfile", or corresponding UCI option "LogFile")
It's recommended to always have logging on, to make it easier to report bugs when it happens.

Configuration parameters change

Large part of parameter handling has been reworked. As the result:
  • All UCI parameters have been changed to have more "classical" look.
    E.g. was "Network weights file path", became "WeightsFile".
  • Much more detailed help is shown than before when you run
    ./lc0 --help
  • Some flags have been renamed, e.g.
    --futile-move-aversion
    is renamed back to
    --smart-pruning-factor.
  • After setting a parameter (using command line parameter or uci setoption command), uci command "uci" shows updated result. That way you can check the current option values.
  • Some command-line and UCI options are hidden now. Use --show-hidden command line parameter to unhide them. E.g.
    ./lc0 --show-hidden --help

Also, in selfplay mode the per player configuration format has been changed (although probably noone knew that anyway):
Was: ./lc0 selfplay player1: --movetime=14
Became: ./lc0 selfplay --player1.movetime=14

Other

  • "go depth X" uci command now causes search to stop when depth information in uci info line reaches X. Not that it makes much sense for it to work this way, but at least it's better than noting.
  • Network file size can now be larger than 64MB.
  • There is now an experimental flag --ramlimit-mb. The engine tries to estimate how much memory it uses and stops search when tree size (plus cache size) reaches RAM limit. The estimation is very rough. We'll see how it performs and improve estimation later.
    In situations when search cannot be stopped (`go infinite` or ponder), `bestmove` is not automatically outputted. Instead, search stops progress and outputs warning.
  • Benchmark mode has been implemented. Run run, use the following command line:
    ./lc0 benchmark
    This feature is pretty basic in the current version, but will be expanded later.
  • As Leela plays much weaker in positions without history, it now is able to synthesize it and do not blunder in custom FEN positions. There is a --history-fill flag for it. Setting it to "no" disables the feature, setting to "fen_only" (default) enables it for all positions except chess start position, and setting it to "always" enables it even for startpos.
  • Instead of output current win estimation as centipawn score approximation, Leela can how show it's raw score. A flag that controls that is --score-type. Possible values:
    • centipawn (default) – approximate the win rate in centipawns, like Leela always did.
    • win_percentage – value from 0 to 100.0 which represents expected score in percents.
    • Q – the same, but scales from -100.0 to 100.0 rather than from 0 to 100.0

2018-10-28

Lc0 training.




 If you are new to Leela (Lc0) Chess and have begun contributing games either using Google Cloud or some other online service or your own home computer, you may be wondering where all those games go and how training of Leela happens.

2018-10-19

Leela beats Fire promoting to Semi-Final of TCEC Cup!




 Leela in a classic drama style, promoted in TCEC Cup Semi-Finals and it will face Stockfish today!
While in CCCC blitz tournament she is still at 3rd place ahead of Komodo, Ethereal and Fire and behind Stockfish and Houdini.

2018-10-12

CCCC Blitz is running.... Leela on top 3!




CCCC blitz tournament is running and till now Leela is having a good performance being steadily on the top 3.


Conditions for the tournament are:
33 engines play a 4x Round Robin tournament with each engine that will play each other 4 times(2 with black and 2 with white) in a total of 128 games per engine, with no opening books or predefined positions used.
This implies a problem though as an engine will play each other twice with white and twice with black so the question becomes: how variety of play will be assured to not have duplicate games? Obviously they will rely on the non determinism of multithreaded search(traditional engines that use more than 1 threads/cores are not deterministic, even Leela that uses more than 1 CPU threads it's not(Leela mainly uses GPU for its search, but uses also CPUs)). This is of course not that wise decision and they should use predefined positions for the second part of the Round Robin.

•Time control of 5 minutes per game plus 2 seconds added time per move.

2018-10-11

Draw in Chess. Some odd cases.




Chess is a game where there are 3 distinct results. White wins or black wins or it is a draw and nobody wins.  Draw can achieved in many ways in Chess. These are:

•Stalemate position. A position where the player to move does not have a legal move to play and his King is not in check. Game immediately ends as a draw.

2018-10-10

Understanding Training against Q as Knowledge Distillation.


Article by Cyanogenoid, member of Leela Chess Zero development team .



Recently, Oracle investigated training the value head against not the game outcome z, but against the accumulated value q for a position that is obtained after exploring some number of nodes with UCT [Lessons From AlphaZero: Improving the Training Target.]. In this post, we describe some of the experiments with Knowledge Distillation (KD) and relate them to training against q.


Background

Knowledge Distillation (KD) [1 , 2] is a technique where there are two neural networks at play: a teacher network and a student network. The teacher network is usually a fixed, fully-trained network, perhaps of bigger size than the student network. Through KD, the goal is usually to produce a smaller student network than the teacher -- which allows for faster inference -- while still encoding the same "knowledge" within the network; the teacher teaches its knowledge to the student. When training the student network, instead of training with the dataset labels as targets (in our case this is the policy distribution and the value output), the student is trained to match the outputs of the teacher.

2018-10-09

Leela promotes to round of 16 in TCEC Cup with 2 nice wins!



 Leela after 6 consecutive draws in the series of games against Laser(division 1 engine) she won last 2 games so she promoted to next round where she will face Ethereal(premier division engine) that beat Rodent(division 4 engine) easily with 5-0 and promoted too. The games against Ethereal will probably take place on this Sunday.

 Leela's performances generally seem very odd, since when she is playing top engines like Stockfish and getting countless draws with performances like around 40 Elo short of Stockfish(like it is on TCEC bonus games) you expect to crush weaker engines. But this doesn't really happen.
 It's a general observation that Leela underperforms against weaker engines and a good analysis of this can be found HERE where it was found that the usual Elo curve does not fit Leela's results well.

2018-10-08

Achilles heel of Chess engines.... Neural net engines and Leela the only hope!





 When first Chess engines were born were very weak. First real Chess program(even though in 1912 there was a King Rook versus King solver and in 1951 Turing wrote only in paper a Chess program) was written in 1951 by Alan Turing's colleague, Dietrich Prinz, but it was not able to play a whole game but could only solve small "mate in 2" problems.
 The interest in computer Chess was growing and more and more researchers in artificial intelligence(AI) used Chess as a platform to showcase their progress on AI. As hardware has started to evolve more and more, many researchers started to be able to use the already known algorithm, that has proved to be the backbone for future Chess engines: the Minimax algorithm, that was invented many years before by the pioneer in so many fields, John Von Neumann.

TCEC CUP running. Leela in danger of elimination from the 1st round against Laser! UPDATE: Leela won!



TCEC Cup continues and we already know 6 engines that have promoted to next round.
Leela right now has a big fight with Laser and after 4 games it is on 2-2 with 4 draws.

It would be a big surprise if Leela will not manage to promote but with just 8 games everything can happen. The peculiar strength adaption to the opponent of Leela is well known anyway, this means it can hold Stockfish to very close result but playing against much weaker engines she doesn't perform accordingly.



UPDATE:     After 6 draws in the first 6 games, Leela won the last 2 games to promote in the next round. In the game with black pieces she slowly outplayed Laser obtaining eventually a won position, while with white pieces, in a reversed opening from previous game, she managed to easily win heavily outplaying Laser in a French defense where Leela knew even sooner than Cfish(a clone of Stockfish that can run with 7 piece tablebases somewhat better than Stockfish) running on 88 cores, what is going on in the position!
Some analysis of the games will follow.....

2018-10-06

TCEC Cup started! CCCC variants tournament continues....




The TCEC Cup has started and 2 match pairs will be played every day.
We remind that 32 engines will compete in a Knockout elimination tournament, and in each pair match, the best out of 8 games will promote to next round.
That means if an engine completes first, in the 8 games, 4.5 points will promote. As per their decision if an engine completes first 4.5 or 5 points, the match is stopped and the engine promotes to next round. So not all 8 games will be played if not necessary.
Also the tournament would not necessarily be continuous like normal TCEC, since only 2 pairs will be played every day even if there is time for more. The games will begin 12:30 UTC every day.

Till now Stockfish crushed Ivanhoe with a 5-0 score and promoted and Gull won 4.5-2.5 against Texel and will play Stockfish in next round.