Candidates for the computationally most efficient engine?

Discussion of chess software programming and technical issues.

Moderator: Ras

dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Candidates for the computationally most efficient engine?

Post by dangi12012 »

What engine would play with the least amount of CPU cycles to achieve a rating of 1800 or more?
Intuition: Stockfish with fixed node count

With cpu cylces I mean actually reading the instruction count of the CPU (so not time based)
https://c9x.me/x86/html/file_module_x86_id_278.html

But it might be another engine you know that does not come with overhead to achieve even higher strenght and is very small overall?
I know rating is an overloaded term but which open source engine on the TCEC board needs the least CPU time to reach 1800+?
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Candidates for the computationally most efficient engine?

Post by hgm »

Ratings are measured by comparing engines at equal time usage. So wouldn't this simply be the engine with the highest rating?
User avatar
Bo Persson
Posts: 259
Joined: Sat Mar 11, 2006 8:31 am
Location: Malmö, Sweden
Full name: Bo Persson

Re: Candidates for the computationally most efficient engine?

Post by Bo Persson »

dangi12012 wrote: Fri Jul 15, 2022 10:09 pm What engine would play with the least amount of CPU cycles to achieve a rating of 1800 or more?
Intuition: Stockfish with fixed node count

With cpu cylces I mean actually reading the instruction count of the CPU (so not time based)
https://c9x.me/x86/html/file_module_x86_id_278.html

But it might be another engine you know that does not come with overhead to achieve even higher strenght and is very small overall?
I know rating is an overloaded term but which open source engine on the TCEC board needs the least CPU time to reach 1800+?
Note that RDTSC doesn't count instructions, but clock ticks. And modern processors can (sometimes) do 3-4 simple instructions per clock.

Also, RDTSC may or may not be affected by the turbo mode of the processor.
jdart
Posts: 4402
Joined: Fri Mar 10, 2006 5:23 am
Location: http://www.arasanchess.org

Re: Candidates for the computationally most efficient engine?

Post by jdart »

Stockfish eval is very, very good. So it can beat other engines even with a CPU budget handicap, like fewer cores.

If you look at other measures, like NPS, other engines would score higher.
Alexander Schmidt
Posts: 1235
Joined: Thu May 10, 2007 2:49 pm

Re: Candidates for the computationally most efficient engine?

Post by Alexander Schmidt »

dangi12012 wrote: Fri Jul 15, 2022 10:09 pm What engine would play with the least amount of CPU cycles to achieve a rating of 1800 or more?
The rating of Leela with one node is around 2000.

This is played on tournament level for the emulations and 1 node for Leela, nets became better meanwhile:

Code: Select all

                                      Nat    Score     Ta Me Me Fi No Le Sa CX Co Le CX Me De Le Ch Sc Percnt
-------------------------------------------------------------------------------------------------------------
 1: Tasc R30 v2.5                     NED  27.5 / 30   XX =1 11 11 11 == 11 =1 11 11 =1 11 11 11 11 11  91.6%  (+25 -0 =5)
 2: Mephisto Risc II                  NED  25.0 / 30   =0 XX == 10 11 11 11 10 11 1= 11 11 11 11 11 11  83.3%  (+23 -3 =4)
 3: Mephisto Vancouver 68020          ENG  24.5 / 30   00 == XX == =1 1= 11 11 11 =1 11 11 11 11 11 11  81.6%  (+21 -2 =7)
 4: Fidelity Elite Mach IV            USA  21.5 / 30   00 01 == XX 11 10 10 11 =1 01 10 11 11 11 11 11  71.6%  (+20 -7 =3)
 5: Novag Super Expert C              USA  19.0 / 30   00 00 =0 00 XX 10 11 11 =0 1= 11 1= 11 11 11 11  63.3%  (+17 -9 =4)
 6: Leela Zero 0.24.1 63108 (320x24)  BEL  17.5 / 30   == 00 0= 01 01 XX 01 01 =1 11 11 01 10 1= =1 =1  58.3%  (+14 -9 =7)
 7: Saitek Maestro D+ 5MHz            ARG  17.0 / 30   00 00 00 01 00 10 XX 10 01 11 1= 11 11 11 =1 11  56.6%  (+16 -12 =2)
 8: CXG Sphinx Dominator v2.05        NED  15.5 / 30   =0 01 00 00 00 10 01 XX =1 11 0= 00 11 11 11 11  51.6%  (+14 -13 =3)
 9: Conchess Plymate Victoria         SWE  12.5 / 30   00 00 00 =0 =1 =0 10 =0 XX =0 1= 11 01 00 =1 11  41.6%  (+9 -14 =7)
10: Leela Zero 0.24.1 42850 (256x20)  BEL  12.5 / 30   00 0= =0 10 0= 00 00 00 =1 XX =1 1= 01 11 =1 01  41.6%  (+9 -14 =7)
11: CXG Sphinx 40                     USA  12.5 / 30   =0 00 00 01 00 00 0= 1= 0= =0 XX 11 10 10 11 11  41.6%  (+10 -15 =5)
12: Mephisto III-S Glasgow            GER  11.5 / 30   00 00 00 00 0= 10 00 11 00 0= 00 XX 11 11 1= 11  38.3%  (+10 -17 =3)
13: Debut-M                           RUS   7.0 / 30   00 00 00 00 00 01 00 00 10 10 01 00 XX 10 01 01  23.3%  (+7 -23 =0)
14: Leela Zero 0.24.1 591226 (128x10) BEL   6.5 / 30   00 00 00 00 00 0= 00 00 11 00 01 00 01 XX 10 10  21.6%  (+6 -23 =1)
15: Chafiz Destiny Prodigy            USA   5.5 / 30   00 00 00 00 00 =0 =0 00 =0 =0 00 0= 10 01 XX 01  18.3%  (+3 -22 =5)
16: SciSys Chess Champion Mark V      USA   4.5 / 30   00 00 00 00 00 =0 00 00 00 10 00 00 10 01 10 XX  15.0%  (+4 -25 =1)
smatovic
Posts: 3254
Joined: Wed Mar 10, 2010 10:18 pm
Location: Hamburg, Germany
Full name: Srdja Matovic

Re: Candidates for the computationally most efficient engine?

Post by smatovic »

This would be the engine which uses the CPU vector unit for move generation, move picking, and evaluation I guess. Scalar code + vector code, the more vector the less CPU cycles?

--
Srdja
dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Candidates for the computationally most efficient engine?

Post by dangi12012 »

Alexander Schmidt wrote: Sat Jul 16, 2022 9:19 am The rating of Leela with one node is around 2000.
Oh wow I was not aware of that. That is insane since all the other governing and search networks will not be needed when only looking at a single node - so this should be much faster to evaluate than the usual 50k nps.

Interesting!
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Candidates for the computationally most efficient engine?

Post by hgm »

Is that really comparable to a CCRL rating? In the tourney I only see dedicated machines, which are not on the CCRL list.

I am a bit skeptical that with just a neural network you would be immune to tactical errors that even a stupid alpha-beta searcher like micro-Max would not expose, when you have to play from a normal opening book.

[Edit] Interesting. I don't really know how to use Leela (e.g. where to get networks, how to install those, how to make it use the network I want, and how to force it tu use only 1 node). I had downloaded a Leela version some time ago, and now downlaoded a 320x24 network from GitHub, but I don't know if it was using that net. It seems to always think 4 sec at the TC I set (120 moves/3 min), and the Thinking Output said it was using 4-7 nodes.

Under these conditions it crushes Fairy-Max, but then in the end stalemates it !?



[Edit]
I now made a version of UCI2WB that has an option to specify a nodes limit, and when that is non-zero only uses the command "go nodes" to let the engine think. This way I could limit Leela to 1 node. At this setting it is certainly not invulnarable to Fairy-Max, (although it often is able to explot the totally worthless King Safety of the latter):



dangi12012
Posts: 1062
Joined: Tue Apr 28, 2020 10:03 pm
Full name: Daniel Infuehr

Re: Candidates for the computationally most efficient engine?

Post by dangi12012 »

How good is Fairy max on TCEC?
Also is a node with LC0 the same as one visited position?

Also does somebody have the source code for a single node version?

If it's really 2k it really would be interesting for MCTS as the leaf random rollout engine. Bonus points because a NN lends itself to parallel evaluation and even exotic hardware like a TPU.
Worlds-fastest-Bitboard-Chess-Movegenerator
Daniel Inführ - Software Developer
User avatar
hgm
Posts: 28354
Joined: Fri Mar 10, 2006 10:06 am
Location: Amsterdam
Full name: H G Muller

Re: Candidates for the computationally most efficient engine?

Post by hgm »

Fairy-Max doesn't play on TCEC. It would not be admissible, because it is not multithreaded.