Total noob Leela question

Discussion of chess software programming and technical issues.

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
User avatar
hgm
Posts: 26436
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Total noob Leela question

Post by hgm » Wed Jun 03, 2020 8:57 pm

So far I have payed zero attention to the LeelaChess Zero project, as I have no good GPU. But now I want to do some testing at ultra-low node count, and I suppose a CPU-only version would be good enough for that.

What would I have to do to run a game with LC0-CPU as UCI engine? I downloaded an archive leela-zero-0.17-win64.zip and assumed that the leelaz.exe in there was the engine, but when I try to run it, I get an error for a missing DLL routine. Must I download other stuff, and if so, what? Are there instructions on line somewhere? The README.txt file in the archive contained no useful info at all.

Dann Corbit
Posts: 12232
Joined: Wed Mar 08, 2006 7:57 pm
Location: Redmond, WA USA
Contact:

Re: Total noob Leela question

Post by Dann Corbit » Wed Jun 03, 2020 8:58 pm

What DLL did it way was missing?
Taking ideas is not a vice, it is a virtue. We have another word for this. It is called learning.
But sharing ideas is an even greater virtue. We have another word for this. It is called teaching.

zullil
Posts: 6442
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA
Full name: Louis Zulli

Re: Total noob Leela question

Post by zullil » Wed Jun 03, 2020 9:57 pm

hgm wrote:
Wed Jun 03, 2020 8:57 pm
So far I have payed zero attention to the LeelaChess Zero project, as I have no good GPU. But now I want to do some testing at ultra-low node count, and I suppose a CPU-only version would be good enough for that.

What would I have to do to run a game with LC0-CPU as UCI engine? I downloaded an archive leela-zero-0.17-win64.zip and assumed that the leelaz.exe in there was the engine, but when I try to run it, I get an error for a missing DLL routine. Must I download other stuff, and if so, what? Are there instructions on line somewhere? The README.txt file in the archive contained no useful info at all.
0.17?

https://lczero.org/play/download/

Gian-Carlo Pascutto
Posts: 1238
Joined: Sat Dec 13, 2008 6:00 pm
Contact:

Re: Total noob Leela question

Post by Gian-Carlo Pascutto » Thu Jun 04, 2020 11:29 am

hgm wrote:
Wed Jun 03, 2020 8:57 pm
So far I have payed zero attention to the LeelaChess Zero project, as I have no good GPU. But now I want to do some testing at ultra-low node count, and I suppose a CPU-only version would be good enough for that.

What would I have to do to run a game with LC0-CPU as UCI engine? I downloaded an archive leela-zero-0.17-win64.zip and assumed that the leelaz.exe in there was the engine, but when I try to run it, I get an error for a missing DLL routine. Must I download other stuff, and if so, what? Are there instructions on line somewhere? The README.txt file in the archive contained no useful info at all.
Did you download the Go engine instead of the chess one?

I'm still curious what DLL was supposedly missing.

User avatar
hgm
Posts: 26436
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Total noob Leela question

Post by hgm » Thu Jun 04, 2020 11:39 am

Oh, perhaps I did. I just Googled the name, and clicked a link to Github, paying more attention to whether it said 'CPU' than whether it said 'Chess'. It complains about clReleaseDevice in OpenCL.dll. There is nothing in the archive that suggests whether it is for Go or Chess, but I suppose that it says leelaz.exe instead of leelacz.exe should have been a warning to me. :oops:

Anyway, Louis, thanks for the link; this one worked out of the box. Interesting thing is that, first game I tried with it, it lost against Fairy-Max! At some point it had an enormous lead, and then it bungled it, and even managed to lose. (And it flagged as well, in the first 40-move session, but I did not have autoFlag on, so the game just continued):


User avatar
hgm
Posts: 26436
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Total noob Leela question

Post by hgm » Fri Jun 05, 2020 11:25 am

Second game I played also had an unexpected result: repetition draw!

It seems to know it is going for a draw, as the score of its last move is pretty low. But it is a bit weird that it doesn't know anything better to do in the repeated position, such as gobbling up an unprotectable Pawn to create a passer. Surely the NN evaluation must have learned that it is in general better to have a Pawn than not have it, and that having passers is even better?!?

Is there something I am doing wrong? I am just running it with its default settings, at 40 moves / 30 sec. It cannot be completely broken, as it reaches a huge advantage in the middle-game. Even in the final position it is a clean Rook ahead, but it thinks repeating is better than just going to any unrepeated position with a Rook advantage.

fohristiwhirl
Posts: 30
Joined: Mon May 11, 2020 9:52 am
Full name: Allan Thomas

Re: Total noob Leela question

Post by fohristiwhirl » Fri Jun 05, 2020 12:46 pm

Although the net might have some feelings about triple repetition, I think that's normally detected by the search code. If you have no GPU, and are running at super-fast time control, it's possible Leela isn't getting enough nodes.

This can be made a bit better with some UCI options, the defaults for which are terrible for CPU. Try:

Code: Select all

setoption name MinibatchSize value 4
setoption name MaxPrefetch value 0
Or alternatively, make a file in Leela's folder called lc0.config containing

Code: Select all

--minibatch-size=4
--max-prefetch=0
Still I'd recommend giving it a few seconds per move, at least.

I'd be curious what nps you get running ./lc0.exe benchmark

fohristiwhirl
Posts: 30
Joined: Mon May 11, 2020 9:52 am
Full name: Allan Thomas

Re: Total noob Leela question

Post by fohristiwhirl » Fri Jun 05, 2020 1:05 pm

Also, I suppose you're running with a UCI adaptor - presumably it does pass the full move history and not merely the current FEN?

Testing locally, the only way I was able to actually get Ne4 to be played was deleting the history. Then it becomes the #1 move for a time.

zullil
Posts: 6442
Joined: Mon Jan 08, 2007 11:31 pm
Location: PA USA
Full name: Louis Zulli

Re: Total noob Leela question

Post by zullil » Fri Jun 05, 2020 1:30 pm

fohristiwhirl wrote:
Fri Jun 05, 2020 12:46 pm


I'd be curious what nps you get running ./lc0.exe benchmark
Might want to make that

./lc0.exe benchmark --num-positions=1

Otherwise 34 positions will be searched, which will take a long time. :wink:

User avatar
hgm
Posts: 26436
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Total noob Leela question

Post by hgm » Fri Jun 05, 2020 5:01 pm

Well, the 34 positions did not take that long. I got the following result:

Total time (ms) : 366835
Nodes searched : 84435
Nodes/second : 230

And yes, the adapter (Polyglot) passes the entire game history. Leela new this move would draw, you can see the score in the PGN. On the previous occasions the score was much higher, so there is no doubt it sensed the history. The strange thing is that it didn't see any move that would not draw, while a Pawn is up for grabs.

One can blame the low node count, but it should not need to expand many nodes to hit something that isn't a draw. Only very few positions in the perft tree would be repetitions, and only a small fraction would get rid of the advantage of a full Rook. Even if it just searched 10 nodes, it would be very strange if all those 10 nodes were Rook sacrifices or repetitions.

I took the fast TC because I am really interested in what happens at very low node counts. I heard stories that a one-node Leela is rated over 2000 on some server, (playing against humans, no doubt), and I want to see that before I believe it. Does it support "go nodes"?

Post Reply