NNUE

Discussion about development of draughts in the time of computer and Internet.
Post Reply
Sidiki
Posts: 321
Joined: Thu Jan 15, 2015 16:28
Real name: Coulibaly Sidiki

Re: NNUE

Post by Sidiki » Sun Apr 04, 2021 10:32

Hi Bert,

This it's already a great progresse.

Thanks

Ed Gilbert
Posts: 859
Joined: Sat Apr 28, 2007 14:53
Real name: Ed Gilbert
Location: Morristown, NJ USA
Contact:

Re: NNUE

Post by Ed Gilbert » Sun Apr 04, 2021 14:00

Nice result Bert!
I expect we will see a new version of Damage soon.

-- Ed

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Sun Apr 04, 2021 14:25

Sidiki/Ed thanks.

Yes i want to participate in the next tournament with Damage 16.0 which will be a HUB version and based upon NNUE.

Some expectations/remarks:
* Im optimistic that with further SW progress and better HW, NNUE and the current pattern based eval will be on par.
* Both Intel and AMD will further improve NN HW, and like bitboards (which required 64bit processors), and previous instruction-set improvements (popcnt, pext), the new wave of processor will focus on NN HW acceleration.
* This will improve one of the major drawbacks of NNUE (compared with patterns) the computation efforts, and the reduced search speed and search depth.
* NNUE is very elegant as it uses zero domain knowledge for the network. In my case the input is based upon 191 binary board positions (2 * 45 white/black man, 2 * 50 white/black king, and color to move), and 4 NN layers (input 256, hidden, 32 and 32, output 1).
* As NN and NNUE is very generic, one will see an explosion of development tools for training weights, inference libraries, reinforced learning, .....
* I expect that with the recent introduction of the intel processor i9-11900K one could be on par with 1 min games (against both Scan and KR).
* I will order such a machine, however due to component shortage this might take some time.
* Unfortunately most current processors have not implemented avx-512, VNNI, and DL Boost, so i cant share the most recent versions (for example these instruction sets will only be implemented in the ZEN 4, which will be released late 2022).
* As we might be close to the draw black-hole, i don't expect a huge potential increase of ELO. If in the most recent match (3792 games), Scan nnue would have lost nothing, and the win remains at 27 (so 3765 draws), then the resulting Elo difference would be a minor 2 points

Bert

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Sun Apr 04, 2021 20:21

Most recent match Kingsrow 1.62 - Scan_31nnue.
Conditions Scan_31nnue vs Scan_31, played on an Intel Core i7 8700K, 2-move start positions, TC 65 moves in 1 minute, books off, 6-piece dbs, 6 search thread.

Code: Select all

Kingsrow 1.62 vs Scan_nnue 3.1:  1 wins, 0 losses, 157 draws, 0 unknowns
Bert
Attachments
dxpgames.pdn
(144.81 KiB) Downloaded 302 times

Rein Halbersma
Posts: 1722
Joined: Wed Apr 14, 2004 16:04
Contact:

Re: NNUE

Post by Rein Halbersma » Sun Apr 04, 2021 21:28

BertTuyt wrote:
Sun Apr 04, 2021 10:09
Most recent match with tmgr (the tool developed by Ed).
Conditions Scan_31nnue vs Scan_31, played on an Intel Core i7 8700K, 2-move start positions, TC 75 moves in 2 minute, books off, 6-piece dbs, 1 search thread.

Code: Select all

[ 1]: 0.502 score,   632 games,    6 wins,    3 losses,   623 draws,   0 unk
[ 2]: 0.502 score,   632 games,    5 wins,    3 losses,   624 draws,   0 unk
[ 3]: 0.501 score,   632 games,    6 wins,    5 losses,   621 draws,   0 unk
[ 4]: 0.498 score,   632 games,    4 wins,    6 losses,   620 draws,   2 unk
[ 5]: 0.497 score,   632 games,    4 wins,    8 losses,   620 draws,   0 unk
[ 6]: 0.498 score,   632 games,    2 wins,    5 losses,   625 draws,   0 unk
total 0.500 score,  3792 games,   27 wins,   30 losses,  3733 draws,   2 unk
elo diff -0.3
Bert
Congrats Bert! That is an impressive result. Will you release the source code for Scan-NNUE?

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Sun Apr 04, 2021 22:29

Rein, I will do tomorrow.

I first wanted to clean up some messy parts, and re-write some sections so that it contains no older traces of the Jonathan code.
But I will not wait for that, so all can have a look.

I will also add source code to translate the python weight.txt file (from the python trainnnet script) into a network file which will be read by the program.

Bert

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Mon Apr 05, 2021 09:42

Herewith a link to scan nnue sources.

https://www.dropbox.com/sh/5sw3zd3jq9z8 ... XGrRa?dl=0

The new/modified files are:
* eval.cpp, eval.hpp
* nnue.cpp, nnue.hpp
* simd.hpp

Bert

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Mon Apr 05, 2021 10:02

And herewith the link to cttgnn, which converts a weights.txt (output python script trainnet) into a .gnn file

https://www.dropbox.com/sh/ahsrgi5j4776 ... ew8va?dl=0

If you have questions , just post them.

Bert

Yves
Posts: 41
Joined: Sat Feb 20, 2016 14:00

Re: NNUE

Post by Yves » Tue Apr 06, 2021 13:49

Hello Bert
Please compile the gnn file.
Cordially :)

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Tue Apr 06, 2021 14:08

Yves, I don't have access now to my computer, apparently I did not include the weights file in the sources, sorry for that.
Will provide a separate link later today.

Bert

Krzysztof Grzelak
Posts: 1368
Joined: Thu Jun 20, 2013 17:16
Real name: Krzysztof Grzelak

Re: NNUE

Post by Krzysztof Grzelak » Tue Apr 06, 2021 16:11

And if using the DXP can play and whether it works.

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Tue Apr 06, 2021 16:49

Krzysztof,

the test result against Kingsrow was with DXP.
So it seems to work.

Bert

Krzysztof Grzelak
Posts: 1368
Joined: Thu Jun 20, 2013 17:16
Real name: Krzysztof Grzelak

Re: NNUE

Post by Krzysztof Grzelak » Tue Apr 06, 2021 16:55

I understand and thank you for your answer Bert. I will wait until everything you need to share and then I will play for 1 minute.

BertTuyt
Posts: 1592
Joined: Wed Sep 01, 2004 19:42

Re: NNUE

Post by BertTuyt » Tue Apr 06, 2021 17:36

Herewith the link with the network file, and .ini file, also including the scan nnue version.

https://www.dropbox.com/sh/2seqmqhn7cuj ... oihla?dl=0

On my computer im able to do test with a stable 4.3 GHz, so i expect that on slower (and older) systems the Elo difference between scan and scan nnue will be around 10 ELO (Scan still stronger).
A boundary condition for the program is that the processor supports avx2.

Bert

Krzysztof Grzelak
Posts: 1368
Joined: Thu Jun 20, 2013 17:16
Real name: Krzysztof Grzelak

Re: NNUE

Post by Krzysztof Grzelak » Tue Apr 06, 2021 18:26

What libraries (.dlls) do Scan 3.1_nnue.

Post Reply