Trying out the Leela Hybrid engine (NN with AB)

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

Moderators: hgm, Harvey Williamson, bob

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
pohl4711
Posts: 996
Joined: Sat Sep 03, 2011 5:25 am
Location: Berlin, Germany
Contact:

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

Post by pohl4711 » Tue Feb 19, 2019 7:34 pm

Very cool project. Works in Fritz16, but crashes with ponder on in Enginematches after first move of the opponent.

duncan
Posts: 9549
Joined: Mon Jul 07, 2008 8:50 pm

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

Post by duncan » Tue Feb 19, 2019 7:49 pm

Milos wrote:
Tue Feb 19, 2019 6:44 pm
Laskos wrote:
Tue Feb 19, 2019 5:40 pm
AdminX wrote:
Tue Feb 19, 2019 1: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: 2045
Joined: Mon Feb 11, 2008 2:53 pm

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

Post by Damir » Tue Feb 19, 2019 8:25 pm

He already did..... :) :)

KillerDucky
Posts: 12
Joined: Fri Mar 23, 2018 1:31 am

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

Post by KillerDucky » Tue Feb 19, 2019 8:59 pm

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: 1762
Joined: Tue Jun 02, 2009 10:14 pm

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

Post by yanquis1972 » Tue Feb 19, 2019 10:08 pm

Damir wrote:
Tue Feb 19, 2019 3:41 pm
Jouni wrote:
Tue Feb 19, 2019 2: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.

MikeB
Posts: 3169
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

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

Post by MikeB » Tue Feb 19, 2019 10:30 pm

Eduard wrote:
Tue Feb 19, 2019 4: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.

User avatar
Eduard
Posts: 189
Joined: Fri Oct 26, 2018 10:58 pm
Location: Germany
Full name: Eduard Nemeth
Contact:

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

Post by Eduard » Tue Feb 19, 2019 11:39 pm

MikeB wrote:
Tue Feb 19, 2019 10:30 pm
Eduard wrote:
Tue Feb 19, 2019 4: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)?

MikeB
Posts: 3169
Joined: Thu Mar 09, 2006 5:34 am
Location: Pen Argyl, Pennsylvania

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

Post by MikeB » Tue Feb 19, 2019 11:58 pm

MikeB wrote:
Tue Feb 19, 2019 10:30 pm
Eduard wrote:
Tue Feb 19, 2019 4: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.

User avatar
M ANSARI
Posts: 3395
Joined: Thu Mar 16, 2006 6:10 pm

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

Post by M ANSARI » Wed Feb 20, 2019 7:28 am

DOUBLE POST
Last edited by M ANSARI on Wed Feb 20, 2019 7:29 am, edited 1 time in total.

User avatar
M ANSARI
Posts: 3395
Joined: Thu Mar 16, 2006 6:10 pm

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

Post by M ANSARI » Wed Feb 20, 2019 7:28 am

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.

Post Reply