Stockfish NN release (NNUE)

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

Moderators: hgm, Rebel, chrisw

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

Re: Stockfish NN release (NNUE)

Post by zullil »

amchess wrote: Sat Jul 18, 2020 12:18 am I created a fork from Joergoster repository and updated to the latest stockfish patch:

https://github.com/amchess/Stockfish-NNUE/

Let me know if it's all good.
Andrea
No, it's not.

Code: Select all

eval/nnue/evaluate_nnue.h:22:8: error: ‘AlignedPtr’ does not name a type; did you mean ‘aligned’?
   22 | extern AlignedPtr<FeatureTransformer> feature_transformer;
      |        ^~~~~~~~~~
      |        aligned
eval/nnue/evaluate_nnue.h:25:8: error: ‘AlignedPtr’ does not name a type; did you mean ‘aligned’?
   25 | extern AlignedPtr<Network> network;
      |        ^~~~~~~~~~
      |        aligned
Your header file seems different from Joerg's version.
amchess
Posts: 323
Joined: Tue Dec 05, 2017 2:42 pm

Re: Stockfish NN release (NNUE)

Post by amchess »

thanks
I corrected them.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Stockfish NN release (NNUE)

Post by MikeB »

For those who can find some humor in chess ...

[pgn][Event "My Tournament"]
[Site "C:/cluster.mfb/pgn"]
[Date "2020.07.19"]
[Round "9"]
[White "stockfish-nn"]
[Black "cfish"]
[Result "1-0"]
[FEN "r1bqkb1r/1ppppppp/p1n2n2/1B6/4P3/3P4/PPP2PPP/RNBQK1NR w KQkq - 0 1"]
[GameStartTime "2020-07-19T03:11:54.132 Eastern Daylight Time"]
[SetUp "1"]
[TimeControl "300+3"]

1. Bxc6 {-0.07/23 10s} bxc6 {+0.29/26 11s} 2. Nd2 {0.00/20 3.4s}
d6 {+0.40/26 9.7s} 3. f4 {+0.34/24 9.4s} g6 {+0.24/26 17s} 4. b3 {+0.42/21 3.4s}
Bg7 {+0.05/24 7.1s} 5. Bb2 {+0.44/21 3.7s} O-O {+0.16/23 2.9s}
6. h3 {+0.60/22 4.5s} Bb7 {+0.48/24 5.4s} 7. Qe2 {+0.53/25 9.5s}
e6 {0.00/28 21s} 8. O-O-O {+0.80/25 5.0s} Nh5 {+0.33/27 6.9s}
9. Bxg7 {+0.39/27 9.4s} Kxg7 {+0.29/27 4.3s} 10. Qe3 {+0.46/25 5.6s}
Qf6 {+0.17/29 7.0s} 11. Ne2 {+0.42/25 6.4s} Qa1+ {0.00/29 14s}
12. Nb1 {+0.42/9 0.001s} Nf6 {0.00/28 4.8s} 13. g4 {+0.48/23 3.8s}
c5 {0.00/27 8.9s} 14. Nc3 {+0.59/24 15s} h6 {+0.16/25 5.2s}
15. Rhf1 {+0.92/23 11s} Nd7 {0.00/30 26s} 16. d4 {+1.17/21 5.0s}
cxd4 {0.00/25 4.3s} 17. Qxd4+ {+1.90/21 5.1s} e5 {-1.13/27 14s}
18. Qc4 {+2.34/26 9.0s} Rac8 {-0.17/26 5.0s} 19. f5 {+2.76/26 8.5s}
g5 {-2.20/32 43s} 20. h4 {+3.06/26 5.1s} f6 {-2.19/29 22s}
21. Rh1 {+3.77/28 6.0s} Nb6 {-3.59/32 9.1s} 22. Qe2 {+4.24/28 6.5s}
Rf7 {-2.74/32 4.0s} 23. hxg5 {+4.02/33 7.5s} hxg5 {-2.26/34 4.5s}
24. Qh2 {+4.62/31 7.2s} Kf8 {-4.48/33 14s} 25. Rd3 {+5.03/30 5.9s}
Ke7 {-5.51/31 14s} 26. Rh3 {+5.62/29 6.2s} Rcf8 {-6.52/32 28s}
27. Rh8 {+6.53/30 8.0s} Nd7 {-6.23/30 7.6s} 28. Qe2 {+6.76/28 5.8s}
Rxh8 {-5.59/29 3.4s} 29. Rxh8 {+7.04/31 11s} Nb6 {-6.51/32 9.8s}
30. Qh2 {+7.58/29 8.2s} Nd7 {-6.30/33 7.9s} 31. Qf2 {+7.82/28 8.5s}
Nc5 {-6.97/33 9.8s} 32. b4 {+8.01/28 7.2s} Na4 {-6.12/32 7.3s}
33. Nxa4 {+7.64/30 13s} Qd4 {-5.68/31 2.2s} 34. Qxd4 {+7.83/30 11s}
exd4 {-5.45/32 4.5s} 35. Nd2 {+8.29/27 6.5s} Kd7 {-5.84/34 7.3s}
36. Rh6 {+8.22/27 9.3s} Re7 {-6.07/33 8.0s} 37. Rxf6 {+8.45/26 7.7s}
Bxe4 {-6.35/31 5.5s} 38. Nb3 {+8.44/26 6.0s} Bf3 {-5.82/24 4.6s}
39. Rg6 {+8.60/25 5.0s} 1-0
[/pgn]


Specifically, the placement of Black's queen after 14.Nc3
[d]r4r2/1bp2pkp/p2ppnp1/2p5/4PPP1/1PNPQ2P/P1P5/qNKR3R b - - 1 14
Image
User avatar
Thomas Lagershausen
Posts: 328
Joined: Mon Jun 11, 2007 6:59 pm

Re: Stockfish NN release (NNUE)

Post by Thomas Lagershausen »

Thx for sharing. :P

What a cat and mouse play.8-)
TL
User avatar
M ANSARI
Posts: 3707
Joined: Thu Mar 16, 2006 7:10 pm

Re: Stockfish NN release (NNUE)

Post by M ANSARI »

Black side was basically playing without a Queen but didn't realize it while white side did. Interesting game and clearly shows a case where bean counting fails against AI.
amchess
Posts: 323
Joined: Tue Dec 05, 2017 2:42 pm

Re: Stockfish NN release (NNUE)

Post by amchess »

I updated the forked joergoster branch to the latest stockfish patches:
https://github.com/amchess/stockfish-nnue
In my opinion, the todo list is the following:
1. when building with profile-build the behaviour must be the same as stockfish, but the uci options for NN are showns anyway
2. there are a lot of warnings, also different based on the choiced target
3. the default NN path is bad for windows systems. Perhaps, we can simply put "nn.bin" and the net at the same level of the engine
4. there should be a file explaining the sense of all profiles.
Can someone confirm and or update/complete this, so I can contribute?
Many thanks in advance for the suggestions.
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Stockfish NN release (NNUE)

Post by zullil »

amchess wrote: Sun Jul 19, 2020 11:16 am I updated the forked joergoster branch to the latest stockfish patches:
https://github.com/amchess/stockfish-nnue
In my opinion, the todo list is the following:
1. when building with profile-build the behaviour must be the same as stockfish, but the uci options for NN are showns anyway
2. there are a lot of warnings, also different based on the choiced target
3. the default NN path is bad for windows systems. Perhaps, we can simply put "nn.bin" and the net at the same level of the engine
4. there should be a file explaining the sense of all profiles.
Can someone confirm and or update/complete this, so I can contribute?
Many thanks in advance for the suggestions.
Related to 4: In the Makefile, please include information about the new nnue-related targets in the help target. So that, when a user types 'make help', he actually gets some help. :wink:
zullil
Posts: 6442
Joined: Tue Jan 09, 2007 12:31 am
Location: PA USA
Full name: Louis Zulli

Re: Stockfish NN release (NNUE)

Post by zullil »

amchess wrote: Sun Jul 19, 2020 1:44 am thanks
I corrected them.
Thanks. Yes, it builds successfully now.
Aleksei
Posts: 25
Joined: Fri Jul 06, 2018 1:14 am
Full name: Aleksei

Re: Stockfish NN release (NNUE)

Post by Aleksei »

Hello guys!
I have a couple questions regarding android engines. I've made engines armv7 and armv8 (from nodchip's source code), and when i start the engine in the Droidfish, engine's behavior is identical to normal SF (although nps are much lower). Also in Droidfish/uci directory i've created a folder "eval" with "nn.bin" file inside, So here is the questions, how can i be sure that engine is using nn.bin?
Maybe because i use NDK's Clang for Android, engine must to have support for Clang, or i need to make some changes in source code?
Any help is much appreciated!
Here is the engines if you want to try. https://www.mirrored.to/files/1JXPZSMW/

Regards.
Alex.
User avatar
MikeB
Posts: 4889
Joined: Thu Mar 09, 2006 6:34 am
Location: Pen Argyl, Pennsylvania

Re: Stockfish NN release (NNUE)

Post by MikeB »

Aleksei wrote: Thu Jul 23, 2020 9:57 pm Hello guys!
I have a couple questions regarding android engines. I've made engines armv7 and armv8 (from nodchip's source code), and when i start the engine in the Droidfish, engine's behavior is identical to normal SF (although nps are much lower). Also in Droidfish/uci directory i've created a folder "eval" with "nn.bin" file inside, So here is the questions, how can i be sure that engine is using nn.bin?
Maybe because i use NDK's Clang for Android, engine must to have support for Clang, or i need to make some changes in source code?
Any help is much appreciated!
Here is the engines if you want to try. https://www.mirrored.to/files/1JXPZSMW/

Regards.
Alex.
start the engine in terminal and type "ucinewgame" - you should see a message confirming the nnfile was loaded.

If you do not, you may have that missed that the build command was changed for building NN

e.g., make ARCH=armv7 build COMP=gcc
would become
make -ARCH=armv7 nnue COMP=gcc
Image