Trying out the Leela Hybrid engine (NN with AB)

Discussion of anything and everything relating to chess playing software and machines.

Moderators: hgm, Rebel, chrisw

User avatar
pohl4711
Posts: 2433
Joined: Sat Sep 03, 2011 7:25 am
Location: Berlin, Germany
Full name: Stefan Pohl

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by pohl4711 »

Very cool project. Works in Fritz16, but crashes with ponder on in Enginematches after first move of the opponent.
duncan
Posts: 12038
Joined: Mon Jul 07, 2008 10:50 pm

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by duncan »

Milos wrote: Tue Feb 19, 2019 7:44 pm
Laskos wrote: Tue Feb 19, 2019 6:40 pm
AdminX wrote: Tue Feb 19, 2019 2:52 pm
LeelaFish is a modified version of the Lc0 engine that gets help from an outside (auxiliary) engine. Leela uses the AuxEngine's PV to boost the Policy of those moves.
https://github.com/killerducky/lc0/wiki/LeelaFish
With default settings and SF10 auxiliary on 1 thread, +40 Elo points to pure Lc0 with t30 and t40 nets at bullet TC. Much better tactically. With late t30 nets, strongest engine on my PC.
Pity aux engine threads are done in a clumsy way, instead of launching a separate instance of SF for each node on a different thread coz each instance of SF will use very little memory due to low hash requirements of SF search, it launches low-depth SMP SF search that is highly inefficient.
Anything positive to say ? nothing ?
Damir
Posts: 2801
Joined: Mon Feb 11, 2008 3:53 pm
Location: Denmark
Full name: Damir Desevac

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by Damir »

He already did..... :) :)
KillerDucky
Posts: 12
Joined: Fri Mar 23, 2018 2:31 am

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by KillerDucky »

Hello, I'm KillerDucky the author of https://github.com/killerducky/lc0/wiki/LeelaFish thanks for testing it! Those using the engine know but to emphasize for others, the AuxEngine can be any UCI engine. It's only natural that Stockfish is the first choice, and implied by the name Leelafish. :wink:

I'm not a C++ programmer or an expert on chess engines, so I tried to keep it simple. Please let me know any suggestions! Especially regarding Stockfish internals that I could take advantage of. A couple questions I have:

Currently it runs SF using "go depth N" where N is a parameter. Would it be better to maybe use "go movetime N"? Where SF could decide to spend more or less time depending on the position?

I was wondering about contempt, it will be calling SF to analyze positions for both white and black, and if contempt is on does that mean it will have to redo a bunch of work? Or does it have to redo that work regardless when you change positions? Maybe I should disable contempt, or set it to white only or black only depending on what color leela is.
yanquis1972
Posts: 1766
Joined: Wed Jun 03, 2009 12:14 am

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by yanquis1972 »

Damir wrote: Tue Feb 19, 2019 4:41 pm
Jouni wrote: Tue Feb 19, 2019 3:01 pm Which engine is this Eman? It's topping same rating lists in PlayChess! SF clone?
http://eman.zohosites.com/
is there a direct link to the download? i'm not seeing it on the webpage.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by MikeB »

Eduard wrote: Tue Feb 19, 2019 5:34 pm It seems that this Hybrid works only with GPU (CUDA). Right?
It is direct derivative from lc0 and can be complied for openCL or blas as well. It works with McCain as the aux engine as well.
Image
Eduard
Posts: 1439
Joined: Sat Oct 27, 2018 12:58 am
Location: Germany
Full name: N.N.

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by Eduard »

MikeB wrote: Tue Feb 19, 2019 11:30 pm
Eduard wrote: Tue Feb 19, 2019 5:34 pm It seems that this Hybrid works only with GPU (CUDA). Right?
It is direct derivative from lc0 and can be complied for openCL or blas as well. It works with McCain as the aux engine as well.
Thank you!

Unfortunately I can not compile it.

Can someone create this Leelafish for CPU (blas)?
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by MikeB »

MikeB wrote: Tue Feb 19, 2019 11:30 pm
Eduard wrote: Tue Feb 19, 2019 5:34 pm It seems that this Hybrid works only with GPU (CUDA). Right?
It is direct derivative from lc0 and can be complied for openCL or blas as well. It works with McCain as the aux engine as well.
For MacOS users to compile - if you were successful compiling lc), you should not have any significant problems to compile this for.k. It requires boost, I tried MacPorts and that was not a success. But you install it directly from the source.

Links to read:
http://www.boost.org/more/getting_start ... iants.html
http://www.boost.org/build/doc/html/index.html

then run:

Code: Select all

sudo bootstrap.sh
Mac-Pro:boost_1_69_0 xxxx ./b2 install
then grab a coffee, it will take a while

for macOS, you will get the following errors:

Code: Select all

/usr/local/include/boost/process/detail/posix/wait_for_exit.hpp:60:7: error: expected id-expression before '(' token
     ::sigemptyset(&sigset);
/usr/local/include/boost/process/detail/posix/wait_for_exit.hpp:61:7: error: expected id-expression before '(' token
     ::sigaddset(&sigset, SIGCHLD);
/usr/local/include/boost/process/detail/posix/wait_for_exit.hpp:87:26: error: '::sigtimedwait' has not been declared
         auto ret_sig = ::sigtimedwait(&sigset, nullptr, &ts);
/usr/local/include/boost/process/detail/posix/wait_group.hpp:64:7: error: expected id-expression before '(' token
     ::sigemptyset(&sigset);
/usr/local/include/boost/process/detail/posix/wait_group.hpp:65:7: error: expected id-expression before '(' token
     ::sigaddset(&sigset, SIGCHLD);
/usr/local/include/boost/process/detail/posix/wait_group.hpp:90:17: error: '::sigtimedwait' has not been declared
         ret = ::sigtimedwait(&sigset, nullptr, &ts);
a quick fix is to simply to remove "::" , e.g., for the first one "::sigemptyset(&sigset);" change to "sigemptyset(&sigset);" . likewise from the others.
( source of solution https://github.com/boostorg/process/issues/55 )
That's it, it should compile for macOS.
Image
User avatar
M ANSARI
Posts: 3707
Joined: Thu Mar 16, 2006 7:10 pm

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by M ANSARI »

DOUBLE POST
Last edited by M ANSARI on Wed Feb 20, 2019 8:29 am, edited 1 time in total.
User avatar
M ANSARI
Posts: 3707
Joined: Thu Mar 16, 2006 7:10 pm

Re: Trying out the Leela Hybrid engine (NN with AB)

Post by M ANSARI »

Pity aux engine threads are done in a clumsy way, instead of launching a separate instance of SF for each node on a different thread coz each instance of SF will use very little memory due to low hash requirements of SF search, it launches low-depth SMP SF search that is highly inefficient.

What would be a better way to do things? I guess a first step would be to simply play all the moves that Lc0 wants to play and have SF only over rule if the move that Lc0 wants to play fails low with a pre-determined cut off evaluation requirement. This would eliminate those annoying one move tactical blunders and play in the endgame that everyone is calling "trolling". But really this could be really interesting if this could also be implemented in what Lc0 is searching rather than the immediate move. This way even deep variations can be probed for accuracy and thus it would give the positional play of Lc0 much more accuracy.