Leela vs Stockfish nnue style

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

Moderator: Ras

Magnum
Posts: 195
Joined: Thu Feb 04, 2021 10:24 pm
Full name: Arnold Magnum

Re: Leela vs Stockfish nnue style

Post by Magnum »

h1a8 wrote: Sat Dec 02, 2023 1:56 am
Sopel wrote: Fri Dec 01, 2023 10:32 pm
h1a8 wrote: Fri Dec 01, 2023 1:14 pm
Werewolf wrote: Thu Nov 30, 2023 4:08 pm Children, children.

I've benched the M2 Ultra (should be at least as fast as the M3 Max) and it got 17Mn/s

Not great performance.

Excellent performance to power ratio though, but I do think this argument is overplayed.
Did you use 512mb hash instead of 1024mb?
Did you use stockfish 14.1 nnue?
Did you do the command
"bench 512 24 26 default depth nnue"?

Someone reported that nps increased tremendously (more than double) after decreasing hash from 1gb to 512mb. I'll try to find the thread.
I would be kinda funny if a machine with 8GB of RAM couldn't do 1GB of hash. If so then it's pretty lucky that ipman's test accounts for this.
Someone posted their results from another site. It shows the nps increasing significantly when lowering the hash to 512. I have no skin in the game and asking someone to verify this claim.
http://www.talkchess.com/forum3/viewtop ... 50#p955550
Werewolf
Posts: 2033
Joined: Thu Sep 18, 2008 10:24 pm

Re: Leela vs Stockfish nnue style

Post by Werewolf »

h1a8 wrote: Fri Dec 01, 2023 1:14 pm
Werewolf wrote: Thu Nov 30, 2023 4:08 pm Children, children.

I've benched the M2 Ultra (should be at least as fast as the M3 Max) and it got 17Mn/s

Not great performance.

Excellent performance to power ratio though, but I do think this argument is overplayed.
Did you use 512mb hash instead of 1024mb?
Did you use stockfish 14.1 nnue?
Did you do the command
"bench 512 24 26 default depth nnue"?

Someone reported that nps increased tremendously (more than double) after decreasing hash from 1gb to 512mb. I'll try to find the thread.
I think I used 16 GB hash. Total system memory was 128 GB.
Latest SF dev from about 2 months ago.
User avatar
M ANSARI
Posts: 3726
Joined: Thu Mar 16, 2006 7:10 pm

Re: Leela vs Stockfish nnue style

Post by M ANSARI »

h1a8 wrote: Fri Nov 24, 2023 6:49 am Is there a significant difference in playing style between the two?
It's black Friday and I was going to either get a laptop with high end processor and low-mid gaming chip
Or one with medium-high processors with mid-high gaming chip. All the same price.
Or a desktop with max specs lol.

I know stockfish is stronger but Leela revolutionized chess with some radical new ideas in the opening and with strategy.

I know the nnue allows stockfish to operate similar to Leela. But how close? Do we need to invest in a high end graphics card to be able to get some good ideas for chess (through Leela)
Or can I just have a strong processor and use cfish (or a version that allows nnue only evaluation) to get similar results in ideas?

I have looked at a lot of games with Lc0 ... it really is amazing how human like it plays. Like a super strong GM with amazing "intuition". Some moves make no sense but seem very human like in a sense that they don't hurt anything and they don't fall in any tactical traps ... but they improve the position. These small incremental improvements can really gather up steam and overwhelm the opponent. The thing is that you have to be incredibly strong to know that a certain move doesn't hurt anything or doesn't hurt an advantage or is not too passive ... and also doesn't fall into any deep tactical tricks ... that is the weakness of humans ... but Lc0 doesn't seem to have that ... and so it just feels so human like, and its moves are seem a lot easier to understand as a human. On the other hand, SF is just a brutal tactical engine ... it just is so so so strong tactically. Any little tiny inaccuracy is immediately punished. Any small move that is passive and does not improve the position can quickly be exploited ... and most importantly ... any tiny tactical oversight is just brutally punished. That is the best way I can describe both engines and I have to admit I much more prefer using Lc0 as an engine to analyze with. I will say however, that with NNUE, SF has become much more leela like in play and thus has a much more attractive play (for a human) ... however it still goes for these absolutely obscure tactical lines that drive humans nuts ... and only something like Lc0 can see through. Here are 3 interesting wins by Lc0 against SF and really does a good job at showing the different styles of these 2 engines.

https://www.youtube.com/watch?v=cax7AENa0YA
User avatar
RubiChess
Posts: 643
Joined: Fri Mar 30, 2018 7:20 am
Full name: Andreas Matthies

Re: Leela vs Stockfish nnue style

Post by RubiChess »

M ANSARI wrote: Tue Dec 05, 2023 12:28 pm ...it really is amazing how human like it plays. Like a super strong GM with amazing "intuition".
Inferior chess entity aka "human".
Modern Times
Posts: 3748
Joined: Thu Jun 07, 2012 11:02 pm

Re: Leela vs Stockfish nnue style

Post by Modern Times »

h1a8 wrote: Fri Dec 01, 2023 1:14 pm Someone reported that nps increased tremendously (more than double) after decreasing hash from 1gb to 512mb. I'll try to find the thread.
I remember a few years ago where there was a discussion on bigger hash sizes slowing down an engine. Something to do with PC hardware architecture limitations as to how it access memory. But that may well be irrelevant now with advances over the years, and with multiple memory channels on workstation boards. What I think was not proven in those discussions was if that slow-down hurt the engine Elo. i.e. how the engine may have been benefitting from that extra hash vs the slow-down.
chessica
Posts: 961
Joined: Thu Aug 11, 2022 11:30 pm
Full name: Esmeralda Pinto

Re: Leela vs Stockfish nnue style

Post by chessica »

Modern Times wrote: Wed Dec 06, 2023 6:09 pm
h1a8 wrote: Fri Dec 01, 2023 1:14 pm Someone reported that nps increased tremendously (more than double) after decreasing hash from 1gb to 512mb. I'll try to find the thread.
I remember a few years ago where there was a discussion on bigger hash sizes slowing down an engine. Something to do with PC hardware architecture limitations as to how it access memory. But that may well be irrelevant now with advances over the years, and with multiple memory channels on workstation boards. What I think was not proven in those discussions was if that slow-down hurt the engine Elo. i.e. how the engine may have been benefitting from that extra hash vs the slow-down.
I checked it once and found that there is an optimum for a position. A little is bad and too much also.
CornfedForever
Posts: 648
Joined: Mon Jun 20, 2022 4:08 am
Full name: Brian D. Smith

Re: Leela vs Stockfish nnue style

Post by CornfedForever »

chessica wrote: Wed Dec 06, 2023 6:39 pm
I checked it once and found that there is an optimum for a position. A little is bad and too much also.
And thus in a 64gb system with a fast processor....your thought as to 'close' to optimal for analysis of positions would be....<DRUMROLL>....?
User avatar
M ANSARI
Posts: 3726
Joined: Thu Mar 16, 2006 7:10 pm

Re: Leela vs Stockfish nnue style

Post by M ANSARI »

RubiChess wrote: Wed Dec 06, 2023 5:27 pm
M ANSARI wrote: Tue Dec 05, 2023 12:28 pm ...it really is amazing how human like it plays. Like a super strong GM with amazing "intuition".
Inferior chess entity aka "human".
I think you miss the point. While many are just interested in engine vs engine games ... for many others the chess engine is a tool where even the strongest GM's can learn from. A very tactical engine can play moves that cannot be understood by the "inferior" human brain ... sort of like listening to someone speaking in chinese. The inferior human brain is much better at understanding basic concepts such as using a rook to control an open file or placing a Knight in the center of the board where it has a lot of scope. Lc0 seems to play using such basic concepts. Of course such basic concepts can fail if they are tactically unsound and SF is ruthless with that. Humans can learn from this ... a good example is how Magnus Carlsen and other top GM's now readily push a pawn deep ... where before it would have seemed like the pawn would be a target ... humans have learned from Lc0 games that this type of concept is extremely positive long term. When Lc0 would use this tactic against early non NNUE SF versions, it would get many easy wins. Alpha Beta engines never could fix the "horizon effect" but with Lc0 and NNUE, this has been fixed.
Uri Blass
Posts: 10891
Joined: Thu Mar 09, 2006 12:37 am
Location: Tel-Aviv Israel

Re: Leela vs Stockfish nnue style

Post by Uri Blass »

M ANSARI wrote: Mon Dec 11, 2023 7:29 am
RubiChess wrote: Wed Dec 06, 2023 5:27 pm
M ANSARI wrote: Tue Dec 05, 2023 12:28 pm ...it really is amazing how human like it plays. Like a super strong GM with amazing "intuition".
Inferior chess entity aka "human".
I think you miss the point. While many are just interested in engine vs engine games ... for many others the chess engine is a tool where even the strongest GM's can learn from. A very tactical engine can play moves that cannot be understood by the "inferior" human brain ... sort of like listening to someone speaking in chinese. The inferior human brain is much better at understanding basic concepts such as using a rook to control an open file or placing a Knight in the center of the board where it has a lot of scope. Lc0 seems to play using such basic concepts. Of course such basic concepts can fail if they are tactically unsound and SF is ruthless with that. Humans can learn from this ... a good example is how Magnus Carlsen and other top GM's now readily push a pawn deep ... where before it would have seemed like the pawn would be a target ... humans have learned from Lc0 games that this type of concept is extremely positive long term. When Lc0 would use this tactic against early non NNUE SF versions, it would get many easy wins. Alpha Beta engines never could fix the "horizon effect" but with Lc0 and NNUE, this has been fixed.
Basic concepts such as using a rook to control an open file or placing a Knight in the center of the board where it has a lot of scope are something thar engines have even before nnue even 30 years ago.

The evaluation function of chess engines is not only material and the evaluation function of lc0 is something that the inferior human brain cannot understand.

If you analyze a chess game and you want to see some evaluation that you understand then it is better to use some old weak engines
stockfish or lc0 often give evaluations that most humans do not understand(maybe top human chess player also understand but most players are not top human chess players).
h1a8
Posts: 518
Joined: Fri Jun 04, 2010 7:23 am

Re: Leela vs Stockfish nnue style

Post by h1a8 »

Werewolf wrote: Thu Nov 30, 2023 4:08 pm Children, children.

I've benched the M2 Ultra (should be at least as fast as the M3 Max) and it got 17Mn/s

Not great performance.

Excellent performance to power ratio though, but I do think this argument is overplayed.
Yup it's a bug with apple's ram hash function. Using the command
"bench 512 8 2000 default movetime"

M2 Pro, 12‑core CPU, 32GB memory
gets the following result

Total time (ms) : 90548
Nodes searched : 2218332923
Nodes/second : 24498972

This is on par with some i9-13900 machines (from Ipman Chess benchmark listings)
So the M2 Ultra should bench even higher than that result