this will be the merge of a lifetime : SF 80 Elo+

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

Moderators: hgm, Rebel, chrisw

Paloma
Posts: 1167
Joined: Thu Dec 25, 2008 9:07 pm
Full name: Herbert L

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by Paloma »

carldaman wrote: Sat Aug 08, 2020 10:57 pm It defeats the purpose if the NNUE cannot always be set to active [as an option], because then you're at the mercy of the engine only using NNUE when it chooses. Hopefully the SF team will wake up to the fact that people also use the engine for analysis.
+1
schack
Posts: 172
Joined: Thu May 27, 2010 3:32 am

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by schack »

Ok. What's the trivial change to the source code?

[quote=Deberger post_id=855397 time=1596931848 user_id=12155]
[quote=carldaman post_id=855385 time=1596920236 user_id=6402]
It defeats the purpose if the NNUE cannot always be set to active [as an option], because then you're at the mercy of the engine only using NNUE when it chooses. Hopefully the SF team will wake up to the fact that people also use the engine for analysis.
[/quote]

With a trivial change to the source code, you can build your own executable which always uses NNUE.

However this change can never yield stronger analysis.

Over time, using "always NNUE" will be gradually weaker and weaker as the nets are optimized for their intended use in balanced positions.
[/quote]
User avatar
phhnguyen
Posts: 1437
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by phhnguyen »

Leo wrote: Sat Aug 08, 2020 3:44 am What does NNUE stand for?
Reversion of Efficiently Updatable Neural Networks

https://www.chessprogramming.org/Stockfish_NNUE
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
Leo
Posts: 1080
Joined: Fri Sep 16, 2016 6:55 pm
Location: USA/Minnesota
Full name: Leo Anger

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by Leo »

phhnguyen wrote: Sun Aug 09, 2020 3:54 am
Leo wrote: Sat Aug 08, 2020 3:44 am What does NNUE stand for?
Reversion of Efficiently Updatable Neural Networks

https://www.chessprogramming.org/Stockfish_NNUE
Thanks.
Advanced Micro Devices fan.
User avatar
phhnguyen
Posts: 1437
Joined: Wed Apr 21, 2010 4:58 am
Location: Australia
Full name: Nguyen Hong Pham

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by phhnguyen »

carldaman wrote: Sat Aug 08, 2020 10:57 pm It defeats the purpose if the NNUE cannot always be set to active [as an option], because then you're at the mercy of the engine only using NNUE when it chooses. Hopefully the SF team will wake up to the fact that people also use the engine for analysis.
Quote from @vondele at https://github.com/official-stockfish/S ... ssues/2938
Of course one can use an old binary as well.
I don't think this warrants a UCI option, like we don't have UCI options to disable null-move pruning, LayzEval classical, etc. I'm rather sure that we will have nets soon that won't work well without the hybrid option, i.e. are specifically constructed to benefit from the fact that classical eval is good enough for many positions. I think hybrid is a real opportunity.
Look like we won't have options to select between classic, NNUE, hybrid modes, at least for comming time.
https://banksiagui.com
The most features chess GUI, based on opensource Banksia - the chess tournament manager
User avatar
Deberger
Posts: 91
Joined: Sat Nov 02, 2019 6:42 pm
Full name: ɹǝƃɹǝqǝᗡ ǝɔnɹꓭ

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by Deberger »

schack wrote: Sun Aug 09, 2020 3:39 am Ok. What's the trivial change to the source code?
Deberger wrote: Sun Aug 09, 2020 2:10 am
carldaman wrote: Sat Aug 08, 2020 10:57 pm It defeats the purpose if the NNUE cannot always be set to active [as an option], because then you're at the mercy of the engine only using NNUE when it chooses. Hopefully the SF team will wake up to the fact that people also use the engine for analysis.
With a trivial change to the source code, you can build your own executable which always uses NNUE.

However this change can never yield stronger analysis.

Over time, using "always NNUE" will be gradually weaker and weaker as the nets are optimized for their intended use in balanced positions.
src/evaluate.cpp:

Code: Select all

-  constexpr Value NNUEThreshold  =   Value(520);
+  constexpr Value NNUEThreshold  =   VALUE_INFINITE;
schack
Posts: 172
Joined: Thu May 27, 2010 3:32 am

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by schack »

Thank you!
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by zullil »

Deberger wrote: Sun Aug 09, 2020 2:10 am
carldaman wrote: Sat Aug 08, 2020 10:57 pm It defeats the purpose if the NNUE cannot always be set to active [as an option], because then you're at the mercy of the engine only using NNUE when it chooses. Hopefully the SF team will wake up to the fact that people also use the engine for analysis.
With a trivial change to the source code, you can build your own executable which always uses NNUE.

However this change can never yield stronger analysis.

Over time, using "always NNUE" will be gradually weaker and weaker as the nets are optimized for their intended use in balanced positions.
At the moment, the source code change is trivial. In any case, there is an nnue_always forked being maintained by Joerg Oster:

https://github.com/joergoster/Stockfish ... nue_always
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by zullil »

Deberger wrote: Sun Aug 09, 2020 2:10 am
However this change can never yield stronger analysis.
Doesn't this statement assume that the classical evaluation is at least as good as the NNUE evaluation in "unbalanced" positions? That is, for positions for which abs(eg_value(pos.psq_score())) is at least 520?

(Note that the criterion for Stockfish's using or not using NNUE evaluation is already rather inscrutable, and now incorporates various bonus/penalties based on placement of material.)

Also, Stockfish is developed to maximize self-play Elo at Fishtest time controls. It seem quite likely (to me) that under other conditions Stockfish would benefit more from greater use of NNUE.
Joerg Oster
Posts: 937
Joined: Fri Mar 10, 2006 4:29 pm
Location: Germany

Re: this will be the merge of a lifetime : SF 80 Elo+

Post by Joerg Oster »

zullil wrote: Sun Aug 09, 2020 1:05 pm
Deberger wrote: Sun Aug 09, 2020 2:10 am
However this change can never yield stronger analysis.
Doesn't this statement assume that the classical evaluation is at least as good as the NNUE evaluation in "unbalanced" positions? That is, for positions for which abs(eg_value(pos.psq_score())) is at least 520?

(Note that the criterion for Stockfish's using or not using NNUE evaluation is already rather inscrutable, and now incorporates various bonus/penalties based on placement of material.)

Also, Stockfish is developed to maximize self-play Elo at Fishtest time controls. It seem quite likely (to me) that under other conditions Stockfish would benefit more from greater use of NNUE.
Agreed.

I'm quite puzzled what people already seem to know about this new technique.
Nobody really knows if the current network architecture is best for chess, nor the optimal training method.
We're still at the very beginning, imho.

It is especially in unbalanced positions where classic eval seems to lack some knowledge,
at least that was my impression from many examples given in the past.
Jörg Oster