Minic version 3

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

Moderators: hgm, Dann Corbit, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
connor_mcmonigle
Posts: 125
Joined: Sun Sep 06, 2020 2:40 am
Full name: Connor McMonigle

Re: Minic version 3

Post by connor_mcmonigle » Tue Nov 03, 2020 9:09 pm

Congrats and thanks for consulting with me on this! I'm excited to see what kind of optimizations and architecture improvements you're able achieve. IMHO, the barrier to entry for making improvements/exploring different architectures is significantly lowered with my NN implementation as the C++ inference code totals a mere ~300 LOC :D (Compared to 5000 LOC for the NNUE implementation found in Stockfish). (The Pytorch training scripts are a bit more sizable, but still pretty light). Ultimately, I'm just pleased my networks can produce competitive results. I'll definitely be rooting for Minic at TCEC knowing that I contributed to its development. Rather amusingly, some improvements to the architecture since 1.0 now found both in Minic 3.0 and Seer 1.1 make the play far more aggressive I've found (the change is largely inspired by this paper: https://arxiv.org/abs/1608.06993 and involves concatenating encodings from separate layers to form skip connections to stabilize and improve training of deeper networks).

Terje
Posts: 302
Joined: Tue Nov 19, 2019 3:34 am
Location: https://github.com/TerjeKir/weiss
Full name: Terje Kirstihagen

Re: Minic version 3

Post by Terje » Tue Nov 03, 2020 10:00 pm

Madeleine Birchfield wrote:
Tue Nov 03, 2020 8:15 pm
Terje wrote:
Tue Nov 03, 2020 4:29 pm
You'll get him next time, Weiss :cry:
I remember you said at TCEC that you had plans to implement NNUE into your engine.
I was trying to do that back in July or so, but the goal was to show how strong NNUE is - that has already been done, so for now I have little motivation to do it. I don't know if I want to use NNUE as the evaluation for Weiss yet.

Terje
Posts: 302
Joined: Tue Nov 19, 2019 3:34 am
Location: https://github.com/TerjeKir/weiss
Full name: Terje Kirstihagen

Re: Minic version 3

Post by Terje » Tue Nov 03, 2020 10:02 pm

xr_a_y wrote:
Tue Nov 03, 2020 4:39 pm
Terje wrote:
Tue Nov 03, 2020 4:29 pm
You'll get him next time, Weiss :cry:
Here is clear Weiss victory, and as Black ;), maybe Minic pushed it too hard on this one !

Winning with the king in the front lines is pretty badass 8-)

carldaman
Posts: 2077
Joined: Sat Jun 02, 2012 12:13 am

Re: Minic version 3

Post by carldaman » Tue Nov 03, 2020 11:01 pm

xr_a_y wrote:
Tue Nov 03, 2020 12:49 pm
Second year anniversary for Minic :D ! and a new version number 3.00

Porting Stockfish NNUE implementation inside Minic was fun and instructive. This has clearly raised my interest in NN technologies and in this sense is a success.
As you already know, I was never comfortable with the big copy/paste of SF code involved, nor with the use of SF based nets of course.
This is why I first trained a net with my own data (but using Nodchip learner), namely the "napping nexus" net and then merged the learner directly inside Minic in order to train the pure Minic net named "nascent nutrient". Still, this was not enough to make me feel this technology and code can be inside Minic this way and in no way this can be considered as an "official" version of Minic as soon as a NNUE net is in use. This is why I decided to not use SF implementation anymore. This means that, starting from version 3, Minic is no more compatible with SF nets. Only versions 2.47 to 2.53 can read and use SF nets (and only using NNUE version 0x7AF32F16u nets).

In the meantime, I discovered Seer engine by Connor McMonigle (https://github.com/connormcmonigle/seer-nnue), and was very impressed by its code quality. This engine propose a very clear and simple to understand and use NNUE implementation. This implementation allows to very easily change architecture of the net and implements an engine-independent training code using pytorch. I decided to borrow this code base and adapt it to Minic (was very easy). This is a good compromise for me, a code base I can understand and work with, a very good starting point.

I then trained a first net for it, named "nefarious nucleus" (available here : https://github.com/tryingsomestuff/NNUE-Nets) that performs even with standard Minic2.53 eval at short TC (10s+0.1). Maybe better at longer TC...

My hope is of course to train better nets, probably try other architectures and also speed-up the code that is for now quite slow.

Please note that Minic 3.00 with no net loaded is weaker than version 2.53 because it has less nps. So that there is probably no need for testing for now ...

So for now this is a just a new forum thread for a new story ;-)
Very interesting release :D, but following the link to Minic (on github), I don't see version 3.00, but only 2.53 and older. :?

Frank Quisinsky
Posts: 5494
Joined: Wed Nov 18, 2009 6:16 pm
Location: Trier, Germany
Full name: Frank Quisinsky
Contact:

Re: Minic version 3

Post by Frank Quisinsky » Tue Nov 03, 2020 11:14 pm

Hi Carldaman,

1. https://github.com/tryingsomestuff/Minic-Dist/ ... (directorys for versions 0.x, 1.x, 2.x and now 3.x)
2. https://github.com/tryingsomestuff/Minic/ ... (ended with v2.53, important here the readme)
3. https://github.com/tryingsomestuff/NNUE-Nets ... (the net files)

All isn't easy?!
To many updates and important changes from TOP-engines.
That's excellent but I am sitting to long on my PC ... opinion from my wife.
I have the biggest problems to hold the own link-selection up-to-date.
All the time my own link-selection had to many holes / mistakes and are never good.
I fixed my own desaster in the last days.

(77 of strongest engines, interesting for me for Wasp testing and organization for my text tourney's).
http://www.amateurschach.de/main/_engines.htm

Best
Frank

For Vivien!
Situation around Minic for myself in question of testing is clear.
Good luck with your new ideas and thanks for your new version!
Go Minic go ... for the next tourney!
I like computer chess!

David Carteau
Posts: 100
Joined: Sat May 24, 2014 7:09 am
Location: France
Full name: David Carteau
Contact:

Re: Minic version 3

Post by David Carteau » Wed Nov 04, 2020 5:23 am

xr_a_y wrote:
Tue Nov 03, 2020 12:49 pm
Second year anniversary for Minic :D ! and a new version number 3.00

Porting Stockfish NNUE implementation inside Minic was fun and instructive. This has clearly raised my interest in NN technologies and in this sense is a success.
As you already know, I was never comfortable with the big copy/paste of SF code involved, nor with the use of SF based nets of course.
This is why I first trained a net with my own data (but using Nodchip learner), namely the "napping nexus" net and then merged the learner directly inside Minic in order to train the pure Minic net named "nascent nutrient". Still, this was not enough to make me feel this technology and code can be inside Minic this way and in no way this can be considered as an "official" version of Minic as soon as a NNUE net is in use. This is why I decided to not use SF implementation anymore. This means that, starting from version 3, Minic is no more compatible with SF nets. Only versions 2.47 to 2.53 can read and use SF nets (and only using NNUE version 0x7AF32F16u nets).

In the meantime, I discovered Seer engine by Connor McMonigle (https://github.com/connormcmonigle/seer-nnue), and was very impressed by its code quality. This engine propose a very clear and simple to understand and use NNUE implementation. This implementation allows to very easily change architecture of the net and implements an engine-independent training code using pytorch. I decided to borrow this code base and adapt it to Minic (was very easy). This is a good compromise for me, a code base I can understand and work with, a very good starting point.

I then trained a first net for it, named "nefarious nucleus" (available here : https://github.com/tryingsomestuff/NNUE-Nets) that performs even with standard Minic2.53 eval at short TC (10s+0.1). Maybe better at longer TC...

My hope is of course to train better nets, probably try other architectures and also speed-up the code that is for now quite slow.

Please note that Minic 3.00 with no net loaded is weaker than version 2.53 because it has less nps. So that there is probably no need for testing for now ...

So for now this is a just a new forum thread for a new story ;-)
Well done Vivien !

I'm struggling with my own NNUE trainer implementation for a month now. After reading thousands (!) of sites dealing with NN training, I tried different approaches : genetic algortihms (PBIL), gradient descent (manual implementation), both of them being really tow slow (no vectorization), and then I decided to use "standard" way to train NN, using existing libraries/tools.

I first develop a trainer based on Keras and now I'm using Pytorch (mainly because I was unable to understand how to concatenate layers in Keras...!). Despite more than one month of different runs, I can't manage to obtain good results. I had first built a set of 115 million unique positions, but thinking that my problem may come from a too small dataset, I'm using now 360 million positions (extracted from all CCRL games !). I was wondering if my unsuccessful attempts were due to too small data set, or to my loss function (sum of squared errors).

And then... I saw your post... And discover the existence of Seer engine... For sure, I will read the pytorch training code to try to understand what differs with mine, and why I cannot obtain good results !

n the meanwhile, long life to Minic 3.0 !

User avatar
xr_a_y
Posts: 1465
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Minic version 3

Post by xr_a_y » Wed Nov 04, 2020 6:39 am

carldaman wrote:
Tue Nov 03, 2020 11:01 pm
xr_a_y wrote:
Tue Nov 03, 2020 12:49 pm
Second year anniversary for Minic :D ! and a new version number 3.00

Porting Stockfish NNUE implementation inside Minic was fun and instructive. This has clearly raised my interest in NN technologies and in this sense is a success.
As you already know, I was never comfortable with the big copy/paste of SF code involved, nor with the use of SF based nets of course.
This is why I first trained a net with my own data (but using Nodchip learner), namely the "napping nexus" net and then merged the learner directly inside Minic in order to train the pure Minic net named "nascent nutrient". Still, this was not enough to make me feel this technology and code can be inside Minic this way and in no way this can be considered as an "official" version of Minic as soon as a NNUE net is in use. This is why I decided to not use SF implementation anymore. This means that, starting from version 3, Minic is no more compatible with SF nets. Only versions 2.47 to 2.53 can read and use SF nets (and only using NNUE version 0x7AF32F16u nets).

In the meantime, I discovered Seer engine by Connor McMonigle (https://github.com/connormcmonigle/seer-nnue), and was very impressed by its code quality. This engine propose a very clear and simple to understand and use NNUE implementation. This implementation allows to very easily change architecture of the net and implements an engine-independent training code using pytorch. I decided to borrow this code base and adapt it to Minic (was very easy). This is a good compromise for me, a code base I can understand and work with, a very good starting point.

I then trained a first net for it, named "nefarious nucleus" (available here : https://github.com/tryingsomestuff/NNUE-Nets) that performs even with standard Minic2.53 eval at short TC (10s+0.1). Maybe better at longer TC...

My hope is of course to train better nets, probably try other architectures and also speed-up the code that is for now quite slow.

Please note that Minic 3.00 with no net loaded is weaker than version 2.53 because it has less nps. So that there is probably no need for testing for now ...

So for now this is a just a new forum thread for a new story ;-)
Very interesting release :D, but following the link to Minic (on github), I don't see version 3.00, but only 2.53 and older. :?
Indeed I am looking for some more Elo before releasing official version. Unofficial release are available as always as pointed out by Frank.

carldaman
Posts: 2077
Joined: Sat Jun 02, 2012 12:13 am

Re: Minic version 3

Post by carldaman » Thu Nov 05, 2020 4:28 am

Thanks, Frank + Vivien (+ good luck with Minic!) :)

Charly
Posts: 1091
Joined: Wed Jul 23, 2014 2:30 pm
Location: Bretagne
Contact:

Re: Minic version 3

Post by Charly » Sat Nov 07, 2020 9:51 pm

Salut Vivien,

Félicitations pour Minic 3 !

Je viens de lancer un tournoi de 100 parties en 40/2 contre Arasan 22.1.

Minic 3.0 joue avec Nefarious Nucleus. Joli coup : 41 Td5 !


Event "Test Minic 3.00 Nefarious Nucleus"]
[Site "?"]
[Date "2020.11.07"]
[Round "4"]
[White "Minic 3.00 & Nefarious Nucleus"]
[Black "Arasan 22.1 x64 bmi2"]
[Result "1-0"]
[BlackElo "3288"]
[ECO "B90"]
[Opening "Sicilian"]
[Time "22:36:25"]
[Variation "Najdorf, Adams Attack, 1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.h3"]
[WhiteElo "3200"]
[TimeControl "40/120:40/120:40/120"]
[Termination "adjudication"]
[PlyCount "112"]
[WhiteType "program"]
[BlackType "program"]

1. e4 {+0.62/18 2} c5 2. Nf3 {+0.68/17 2} d6 3. d4 {+0.73/18 1} cxd4 4.
Nxd4 {+0.73/18 3} Nf6 5. Nc3 {+0.69/18 2} a6 6. h3 {+0.87/17 1} e5 7. Nf3
{+0.78/17 2} Be6 8. Ng5 {+0.77/19 1} Nc6 9. a3 {+0.53/16 1} b5 {-0.25/23 3}
10. Nxe6 {+0.61/17 2} fxe6 {-0.32/24 2} 11. g4 {+0.62/18 1} h6 {-0.10/23 3}
12. h4 {+0.69/18 1} Be7 {-0.23/23 3} 13. Bg2 {+0.77/18 2} Nd7 {0.00/25 2}
14. Be3 {+0.84/19 3} Qa5 {-0.11/22 3} 15. Kf1 {+0.76/19 3} b4 {0.00/22 3}
16. Ne2 {+1.30/20 2} Nc5 {-0.35/24 10} 17. Kg1 {+1.26/20 3} bxa3 {-0.44/23
3} 18. Rxa3 {+1.06/20 1} Qb5 {-0.40/23 3} 19. Ra2 {+1.49/18 2} a5 {-0.44/21
3} 20. Ng3 {+1.36/18 3} Qc4 {-0.18/24 3} 21. b3 {+1.54/20 2} Qb4 {-0.32/21
4} 22. Ra1 {+1.60/19 2} Rd8 {-0.37/21 4} 23. Bd2 {+1.67/19 3} Qb6 {-0.14/21
4} 24. g5 {+1.50/20 3} Kd7 {-0.28/23 5} 25. Rb1 {+1.69/18 2} Rb8 {-0.69/22
6} 26. Be3 {+1.76/21 3} Nb4 {-0.67/22 3} 27. Bh3 {+2.08/17 2} hxg5
{-0.79/22 4} 28. hxg5 {+1.73/20 2} g6 {-1.02/25 3} 29. Bg2 {+1.99/20 3}
Rxh1+ {-0.28/24 3} 30. Kxh1 {+1.70/18 2} Qc6 {-0.33/26 3} 31. Kg1 {+1.53/19
3} Nca6 {-0.49/22 2} 32. Rc1 {+2.14/23 3} Nc5 {-0.71/25 5} 33. Bf1
{+2.02/20 4} a4 {-0.61/22 2} 34. bxa4 {+1.83/21 3} Nxa4 {-0.64/24 2} 35.
Qf3 {+1.76/21 2} Na2 {-1.00/27 3} 36. Ra1 {+2.16/23 2} Qxc2 {-1.21/24 2}
37. Bh3 {+2.04/22 4} Qb2 {-1.46/22 2} 38. Rf1 {+2.01/22 3} Rf8 {-1.25/24 3}
39. Qg4 {+1.90/25 4} Qb3 {-1.26/26 1} 40. Rd1 {+2.34/25 8} N2c3 {-1.01/19
1} 41. Rd5 {+3.45/24 2} Rf5 {-3.92/26 7} 42. Ra5 {+3.84/24 2} Rf8 {-4.10/26
4} 43. Ra7+ {+4.76/25 2} Kd8 {-4.50/30 5} 44. Qh4 {+5.15/23 1} Nb5
{-4.50/27 2} 45. Ra8+ {+5.20/26 2} Kd7 {-4.53/29 2} 46. Rxf8 {+5.33/24 1}
Bxf8 {-4.46/28 3} 47. Qh7+ {+5.22/25 2} Be7 {-4.49/26 2} 48. Qxg6 {+5.45/22
1} Bxg5 {-4.51/25 2} 49. Qf7+ {+5.32/23 1} Kc6 {-4.54/28 3} 50. Bxg5
{+5.16/24 2} Nc7 {-4.57/29 2} 51. Bd8 {+5.29/22 1} Qb7 {-4.62/29 2} 52.
Bxc7 {+5.31/26 1} Nc5 {-4.07/28 2} 53. Bxe6 {+5.39/27 1} Nxe6 {-4.29/29 3}
54. Qxe6 {+21.37/26 2} Qxc7 {-6.16/28 3} 55. Qc4+ {+23.34/24 0} Kd7
{-6.43/30 3} 56. Qxc7+ {+25.18/35 2} Kxc7 {-13.85/31 6 Adjugé par Arena}
1-0

Si le pgn du tournoi t'intéresse je pourrai te l'envoyer.

Charly
Brittany from the sky :
https://youtu.be/nR9eU_tVbxE

User avatar
xr_a_y
Posts: 1465
Joined: Sat Nov 25, 2017 1:28 pm
Location: France

Re: Minic version 3

Post by xr_a_y » Sun Nov 08, 2020 7:31 am

Charly wrote:
Sat Nov 07, 2020 9:51 pm
Salut Vivien,

Félicitations pour Minic 3 !

Je viens de lancer un tournoi de 100 parties en 40/2 contre Arasan 22.1.

Minic 3.0 joue avec Nefarious Nucleus. Joli coup : 41 Td5 !


Event "Test Minic 3.00 Nefarious Nucleus"]
[Site "?"]
[Date "2020.11.07"]
[Round "4"]
[White "Minic 3.00 & Nefarious Nucleus"]
[Black "Arasan 22.1 x64 bmi2"]
[Result "1-0"]
[BlackElo "3288"]
[ECO "B90"]
[Opening "Sicilian"]
[Time "22:36:25"]
[Variation "Najdorf, Adams Attack, 1.e4 c5 2.Nf3 d6 3.d4 cxd4 4.Nxd4 Nf6 5.Nc3 a6 6.h3"]
[WhiteElo "3200"]
[TimeControl "40/120:40/120:40/120"]
[Termination "adjudication"]
[PlyCount "112"]
[WhiteType "program"]
[BlackType "program"]

1. e4 {+0.62/18 2} c5 2. Nf3 {+0.68/17 2} d6 3. d4 {+0.73/18 1} cxd4 4.
Nxd4 {+0.73/18 3} Nf6 5. Nc3 {+0.69/18 2} a6 6. h3 {+0.87/17 1} e5 7. Nf3
{+0.78/17 2} Be6 8. Ng5 {+0.77/19 1} Nc6 9. a3 {+0.53/16 1} b5 {-0.25/23 3}
10. Nxe6 {+0.61/17 2} fxe6 {-0.32/24 2} 11. g4 {+0.62/18 1} h6 {-0.10/23 3}
12. h4 {+0.69/18 1} Be7 {-0.23/23 3} 13. Bg2 {+0.77/18 2} Nd7 {0.00/25 2}
14. Be3 {+0.84/19 3} Qa5 {-0.11/22 3} 15. Kf1 {+0.76/19 3} b4 {0.00/22 3}
16. Ne2 {+1.30/20 2} Nc5 {-0.35/24 10} 17. Kg1 {+1.26/20 3} bxa3 {-0.44/23
3} 18. Rxa3 {+1.06/20 1} Qb5 {-0.40/23 3} 19. Ra2 {+1.49/18 2} a5 {-0.44/21
3} 20. Ng3 {+1.36/18 3} Qc4 {-0.18/24 3} 21. b3 {+1.54/20 2} Qb4 {-0.32/21
4} 22. Ra1 {+1.60/19 2} Rd8 {-0.37/21 4} 23. Bd2 {+1.67/19 3} Qb6 {-0.14/21
4} 24. g5 {+1.50/20 3} Kd7 {-0.28/23 5} 25. Rb1 {+1.69/18 2} Rb8 {-0.69/22
6} 26. Be3 {+1.76/21 3} Nb4 {-0.67/22 3} 27. Bh3 {+2.08/17 2} hxg5
{-0.79/22 4} 28. hxg5 {+1.73/20 2} g6 {-1.02/25 3} 29. Bg2 {+1.99/20 3}
Rxh1+ {-0.28/24 3} 30. Kxh1 {+1.70/18 2} Qc6 {-0.33/26 3} 31. Kg1 {+1.53/19
3} Nca6 {-0.49/22 2} 32. Rc1 {+2.14/23 3} Nc5 {-0.71/25 5} 33. Bf1
{+2.02/20 4} a4 {-0.61/22 2} 34. bxa4 {+1.83/21 3} Nxa4 {-0.64/24 2} 35.
Qf3 {+1.76/21 2} Na2 {-1.00/27 3} 36. Ra1 {+2.16/23 2} Qxc2 {-1.21/24 2}
37. Bh3 {+2.04/22 4} Qb2 {-1.46/22 2} 38. Rf1 {+2.01/22 3} Rf8 {-1.25/24 3}
39. Qg4 {+1.90/25 4} Qb3 {-1.26/26 1} 40. Rd1 {+2.34/25 8} N2c3 {-1.01/19
1} 41. Rd5 {+3.45/24 2} Rf5 {-3.92/26 7} 42. Ra5 {+3.84/24 2} Rf8 {-4.10/26
4} 43. Ra7+ {+4.76/25 2} Kd8 {-4.50/30 5} 44. Qh4 {+5.15/23 1} Nb5
{-4.50/27 2} 45. Ra8+ {+5.20/26 2} Kd7 {-4.53/29 2} 46. Rxf8 {+5.33/24 1}
Bxf8 {-4.46/28 3} 47. Qh7+ {+5.22/25 2} Be7 {-4.49/26 2} 48. Qxg6 {+5.45/22
1} Bxg5 {-4.51/25 2} 49. Qf7+ {+5.32/23 1} Kc6 {-4.54/28 3} 50. Bxg5
{+5.16/24 2} Nc7 {-4.57/29 2} 51. Bd8 {+5.29/22 1} Qb7 {-4.62/29 2} 52.
Bxc7 {+5.31/26 1} Nc5 {-4.07/28 2} 53. Bxe6 {+5.39/27 1} Nxe6 {-4.29/29 3}
54. Qxe6 {+21.37/26 2} Qxc7 {-6.16/28 3} 55. Qc4+ {+23.34/24 0} Kd7
{-6.43/30 3} 56. Qxc7+ {+25.18/35 2} Kxc7 {-13.85/31 6 Adjugé par Arena}
1-0

Si le pgn du tournoi t'intéresse je pourrai te l'envoyer.

Charly
Thanks for this tourney. Arasan may be a little strong for Nefarious Nucleus, I m not expecting Minic to survive here ;-). Looking at the given pgn it seems you are not using a book. If that is the case, please not that Minic has no random factor during opening phase so that all the games may look the same. I probably shall do something about that...

Post Reply