Lc0: Kiudee setting is very strong

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

Moderators: hgm, Rebel, chrisw

Kiudee
Posts: 29
Joined: Tue Feb 02, 2010 10:12 pm
Location: Germany
Full name: Karlson Pfannschmidt

Re: Lc0: Kiudee setting is very strong

Post by Kiudee »

corres wrote: Tue Jan 28, 2020 10:35 am
Kiudee wrote: Wed Jan 22, 2020 6:02 pm ...
I am currently in the process of writing a distributed tuning framework for lc0, which we then could utilize to tune slower time controls than before. These parameters will then likely be better candidates as new defaults, than the currently circulating ones.
I wait curiously the result of your works but I am afraid there are no universally "best" parameters because the effectiveness of parameters depend not only from Leela and the used net and hardware but the behavior of the opponent also.
You can determine "best" parameters for CCC final where the GPUs, the used net and the opponent (Stockfish, mainly) are given but we, common Leela and net user have different GPUs, different nets and we use Leela against different opponents. So I think we should be satisfied if you can find in some measure "better" but universal parameters instead of the "best" parameters.
Basing on my experience the most of the default parameters of Leela are rather good for general using.
I agree that for many parameters you can find specific values optimal for a very specific time control. That being said, for default parameters it still makes sense to provide a configuration, which works well for a wide range of time controls (we can’t expect a typical user to be an engine tuning expert, who (1) knows with which parameters to fiddle and (2) knows that thousands of games are necessary to find a better configuration).
In general, we try to design parameters which naturally adapt to the given time control. The cpuct scaling curve (as defined by cpuct, cpuctbase and cpuctfactor) tries to accomplish exactly that: increasing cpuct when more and more visits are coming in. And many people forget that a lower cpuct is not only an improvement in the root node, but does improve the quality of the evaluations in the complete tree (thus it even improves the search for LTC). Still, I think that the scaling curve is not yet optimal for time controls with 100k+ nodes per move.
User avatar
cc2150dx
Posts: 325
Joined: Sat Nov 30, 2013 9:51 am
Location: Canada
Full name: Jason Coombs

Re: Lc0: Kiudee setting is very strong

Post by cc2150dx »

Off topic:

Is "Fpu" the same as "FpuValue" ? because I don't see "Fpu" in the uci options. Thanks
User avatar
Laskos
Posts: 10948
Joined: Wed Jul 26, 2006 10:21 pm
Full name: Kai Laskos

Re: Lc0: Kiudee setting is very strong

Post by Laskos »

cc2150dx wrote: Tue Jan 28, 2020 3:35 pm Off topic:

Is "Fpu" the same as "FpuValue" ? because I don't see "Fpu" in the uci options. Thanks
Yes, the same.
mig2004
Posts: 256
Joined: Wed Oct 02, 2013 12:36 am

Re: Lc0: Kiudee setting is very strong

Post by mig2004 »

I had a run in my LTC chess engine ladder, (90 min 45 sec/per move) using latest Lc0 version as of jan 28, with blass backserver (no gpu).

Lco works very well up to middle game, approx up to move 35, then it loses eggregiously afterwards. I suspect configuration using blass must be quite different. Any suggestions for blass-based configuration?
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Lc0: Kiudee setting is very strong

Post by mwyoung »

mig2004 wrote: Tue Jan 28, 2020 3:47 pm I had a run in my LTC chess engine ladder, (90 min 45 sec/per move) using latest Lc0 version as of jan 28, with blass backserver (no gpu).

Lco works very well up to middle game, approx up to move 35, then it loses eggregiously afterwards. I suspect configuration using blass must be quite different. Any suggestions for blass-based configuration?
Start by lowering your temp policy. You are missing tactics in the endgame. You need a deeper search.

I will give you 2 methods to improve play.

For a slow Lc0. Try dropping your Cpuct and Temp policy. You can even use the divide by method. Like default Cpuct /2 and Temp policy default and /2 or 1.5 and 1.1. or less depending on your speed of Lc0. This will give you a deep search.

For a fast Lc0 . Try multiplying Cpuct by 2, and divide Temp policy by 2. Or 6, and 1.1. Deep search but more exploration at the start of the search. And tune from there.

And I give you these examples to show how these two values play with each other.

But don't be shy about moving these two values. This is the fastest and easiest way to tune Lc0.
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
Scacchista1977
Posts: 49
Joined: Thu Nov 10, 2016 11:40 am
Location: Italy
Full name: Aleandro Rossi

Re: Lc0: Kiudee setting is very strong

Post by Scacchista1977 »

Hi everyone, are these parameters suitable for my gpu model: gtx 1080 for 5 minute games? and if yes, do you would recommend me a network equally suitable for this type of games? Thank you!
Ferdy
Posts: 4833
Joined: Sun Aug 10, 2008 3:15 pm
Location: Philippines

Re: Lc0: Kiudee setting is very strong

Post by Ferdy »

mig2004 wrote: Tue Jan 28, 2020 3:47 pm I had a run in my LTC chess engine ladder, (90 min 45 sec/per move) using latest Lc0 version as of jan 28, with blass backserver (no gpu).

Lco works very well up to middle game, approx up to move 35, then it loses eggregiously afterwards. I suspect configuration using blass must be quite different. Any suggestions for blass-based configuration?
One way to improve its play is by modifying the default maxprefetch and minibatachsize values.

On my i7 3.4 Ghz pc, I run the benchmark multiple times modifying those options and record the nps. Then find the maximum nps.

MaxPrefetch: 0, MinibatchSize: 1, nps: 207
MaxPrefetch: 0, MinibatchSize: 2, nps: 270
MaxPrefetch: 0, MinibatchSize: 4, nps: 336
MaxPrefetch: 0, MinibatchSize: 8, nps: 370
MaxPrefetch: 0, MinibatchSize: 16, nps: 347
MaxPrefetch: 0, MinibatchSize: 32, nps: 310
MaxPrefetch: 0, MinibatchSize: 64, nps: 298
MaxPrefetch: 0, MinibatchSize: 128, nps: 316
MaxPrefetch: 0, MinibatchSize: 256, nps: 318
MaxPrefetch: 0, MinibatchSize: 512, nps: 318
MaxPrefetch: 0, MinibatchSize: 1024, nps: 319
MaxPrefetch: 2, MinibatchSize: 1, nps: 180
MaxPrefetch: 2, MinibatchSize: 2, nps: 268
MaxPrefetch: 2, MinibatchSize: 4, nps: 333
MaxPrefetch: 2, MinibatchSize: 8, nps: 364
MaxPrefetch: 2, MinibatchSize: 16, nps: 337
MaxPrefetch: 2, MinibatchSize: 32, nps: 317
MaxPrefetch: 2, MinibatchSize: 64, nps: 301
MaxPrefetch: 2, MinibatchSize: 128, nps: 315
MaxPrefetch: 2, MinibatchSize: 256, nps: 318
MaxPrefetch: 2, MinibatchSize: 512, nps: 315
MaxPrefetch: 2, MinibatchSize: 1024, nps: 317
MaxPrefetch: 4, MinibatchSize: 1, nps: 159
MaxPrefetch: 4, MinibatchSize: 2, nps: 204
MaxPrefetch: 4, MinibatchSize: 4, nps: 324
MaxPrefetch: 4, MinibatchSize: 8, nps: 351
MaxPrefetch: 4, MinibatchSize: 16, nps: 341
MaxPrefetch: 4, MinibatchSize: 32, nps: 302
MaxPrefetch: 4, MinibatchSize: 64, nps: 307
MaxPrefetch: 4, MinibatchSize: 128, nps: 306
MaxPrefetch: 4, MinibatchSize: 256, nps: 315
MaxPrefetch: 4, MinibatchSize: 512, nps: 315
MaxPrefetch: 4, MinibatchSize: 1024, nps: 316
MaxPrefetch: 8, MinibatchSize: 1, nps: 143
MaxPrefetch: 8, MinibatchSize: 2, nps: 161
MaxPrefetch: 8, MinibatchSize: 4, nps: 225
MaxPrefetch: 8, MinibatchSize: 8, nps: 362
MaxPrefetch: 8, MinibatchSize: 16, nps: 347
MaxPrefetch: 8, MinibatchSize: 32, nps: 311
MaxPrefetch: 8, MinibatchSize: 64, nps: 308
MaxPrefetch: 8, MinibatchSize: 128, nps: 316
MaxPrefetch: 8, MinibatchSize: 256, nps: 318
MaxPrefetch: 8, MinibatchSize: 512, nps: 312
MaxPrefetch: 8, MinibatchSize: 1024, nps: 314
MaxPrefetch: 16, MinibatchSize: 1, nps: 123
MaxPrefetch: 16, MinibatchSize: 2, nps: 137
MaxPrefetch: 16, MinibatchSize: 4, nps: 157
MaxPrefetch: 16, MinibatchSize: 8, nps: 225
MaxPrefetch: 16, MinibatchSize: 16, nps: 342
MaxPrefetch: 16, MinibatchSize: 32, nps: 311
MaxPrefetch: 16, MinibatchSize: 64, nps: 305
MaxPrefetch: 16, MinibatchSize: 128, nps: 316
MaxPrefetch: 16, MinibatchSize: 256, nps: 313
MaxPrefetch: 16, MinibatchSize: 512, nps: 315
MaxPrefetch: 16, MinibatchSize: 1024, nps: 318
MaxPrefetch: 32, MinibatchSize: 1, nps: 94
MaxPrefetch: 32, MinibatchSize: 2, nps: 109
MaxPrefetch: 32, MinibatchSize: 4, nps: 121
MaxPrefetch: 32, MinibatchSize: 8, nps: 147
MaxPrefetch: 32, MinibatchSize: 16, nps: 204
MaxPrefetch: 32, MinibatchSize: 32, nps: 284
MaxPrefetch: 32, MinibatchSize: 64, nps: 280
MaxPrefetch: 32, MinibatchSize: 128, nps: 282
MaxPrefetch: 32, MinibatchSize: 256, nps: 284
MaxPrefetch: 32, MinibatchSize: 512, nps: 279
MaxPrefetch: 32, MinibatchSize: 1024, nps: 284
MaxPrefetch: 64, MinibatchSize: 1, nps: 70
MaxPrefetch: 64, MinibatchSize: 2, nps: 82
MaxPrefetch: 64, MinibatchSize: 4, nps: 89
MaxPrefetch: 64, MinibatchSize: 8, nps: 116
MaxPrefetch: 64, MinibatchSize: 16, nps: 143
MaxPrefetch: 64, MinibatchSize: 32, nps: 174
MaxPrefetch: 64, MinibatchSize: 64, nps: 208
MaxPrefetch: 64, MinibatchSize: 128, nps: 210
MaxPrefetch: 64, MinibatchSize: 256, nps: 209
MaxPrefetch: 64, MinibatchSize: 512, nps: 212
MaxPrefetch: 64, MinibatchSize: 1024, nps: 211
MaxPrefetch: 128, MinibatchSize: 1, nps: 73
MaxPrefetch: 128, MinibatchSize: 2, nps: 79
MaxPrefetch: 128, MinibatchSize: 4, nps: 77
MaxPrefetch: 128, MinibatchSize: 8, nps: 107
MaxPrefetch: 128, MinibatchSize: 16, nps: 141
MaxPrefetch: 128, MinibatchSize: 32, nps: 158
MaxPrefetch: 128, MinibatchSize: 64, nps: 159
MaxPrefetch: 128, MinibatchSize: 128, nps: 159
MaxPrefetch: 128, MinibatchSize: 256, nps: 153
MaxPrefetch: 128, MinibatchSize: 512, nps: 147
MaxPrefetch: 128, MinibatchSize: 1024, nps: 156
MaxPrefetch: 256, MinibatchSize: 1, nps: 73
MaxPrefetch: 256, MinibatchSize: 2, nps: 79
MaxPrefetch: 256, MinibatchSize: 4, nps: 74
MaxPrefetch: 256, MinibatchSize: 8, nps: 110
MaxPrefetch: 256, MinibatchSize: 16, nps: 140
MaxPrefetch: 256, MinibatchSize: 32, nps: 159
MaxPrefetch: 256, MinibatchSize: 64, nps: 162
MaxPrefetch: 256, MinibatchSize: 128, nps: 164
MaxPrefetch: 256, MinibatchSize: 256, nps: 193
MaxPrefetch: 256, MinibatchSize: 512, nps: 164
MaxPrefetch: 256, MinibatchSize: 1024, nps: 164
MaxPrefetch: 512, MinibatchSize: 1, nps: 79
MaxPrefetch: 512, MinibatchSize: 2, nps: 83
MaxPrefetch: 512, MinibatchSize: 4, nps: 75
MaxPrefetch: 512, MinibatchSize: 8, nps: 110
MaxPrefetch: 512, MinibatchSize: 16, nps: 142
MaxPrefetch: 512, MinibatchSize: 32, nps: 158
MaxPrefetch: 512, MinibatchSize: 64, nps: 162
MaxPrefetch: 512, MinibatchSize: 128, nps: 164
MaxPrefetch: 512, MinibatchSize: 256, nps: 167
MaxPrefetch: 512, MinibatchSize: 512, nps: 178
MaxPrefetch: 512, MinibatchSize: 1024, nps: 166
MaxPrefetch: 1024, MinibatchSize: 1, nps: 74
MaxPrefetch: 1024, MinibatchSize: 2, nps: 86
MaxPrefetch: 1024, MinibatchSize: 4, nps: 74
MaxPrefetch: 1024, MinibatchSize: 8, nps: 109
MaxPrefetch: 1024, MinibatchSize: 16, nps: 141
MaxPrefetch: 1024, MinibatchSize: 32, nps: 158
MaxPrefetch: 1024, MinibatchSize: 64, nps: 162
MaxPrefetch: 1024, MinibatchSize: 128, nps: 181
MaxPrefetch: 1024, MinibatchSize: 256, nps: 164
MaxPrefetch: 1024, MinibatchSize: 512, nps: 193
MaxPrefetch: 1024, MinibatchSize: 1024, nps: 164

This is the one that I use:

Code: Select all

MaxPrefetch: 0, MinibatchSize: 8, nps: 370
Default is:

Code: Select all

MaxPrefetch: 32, MinibatchSize: 256, nps: 284
After a test at TC 1m+1s, I got around +300 more elo.

Code: Select all

Score of Lc0 v0.23.2 wLD2 blas default vs Lc0 v0.23.2 wLD2 blas mp0_mbs8: 2 - 56 - 10  [0.103] 68
Elo difference: -376.1 +/- 116.7, LOS: 0.0 %, DrawRatio: 14.7 %
If you are interested, I will send the program so you can find the max nps on your machine.
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Lc0: Kiudee setting is very strong

Post by mwyoung »

Scacchista1977 wrote: Tue Jan 28, 2020 5:45 pm Hi everyone, are these parameters suitable for my gpu model: gtx 1080 for 5 minute games? and if yes, do you would recommend me a network equally suitable for this type of games? Thank you!
Yes, Kiudee will work well.

Try this network

59853 2 5a0e0471 3891.00 Link: https://lczero.org/networks/?show_all=0
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.
Scacchista1977
Posts: 49
Joined: Thu Nov 10, 2016 11:40 am
Location: Italy
Full name: Aleandro Rossi

Re: Lc0: Kiudee setting is very strong

Post by Scacchista1977 »

mwyoung wrote: Tue Jan 28, 2020 6:07 pm
Scacchista1977 wrote: Tue Jan 28, 2020 5:45 pm Hi everyone, are these parameters suitable for my gpu model: gtx 1080 for 5 minute games? and if yes, do you would recommend me a network equally suitable for this type of games? Thank you!
Yes, Kiudee will work well.

Try this network

59853 2 5a0e0471 3891.00 Link: https://lczero.org/networks/?show_all=0
thank you!

is normal that with hash 4096 Mb after a few moves it always remains at 100%.....?

Image
mwyoung
Posts: 2727
Joined: Wed May 12, 2010 10:00 pm

Re: Lc0: Kiudee setting is very strong

Post by mwyoung »

Scacchista1977 wrote: Tue Jan 28, 2020 10:14 pm
mwyoung wrote: Tue Jan 28, 2020 6:07 pm
Scacchista1977 wrote: Tue Jan 28, 2020 5:45 pm Hi everyone, are these parameters suitable for my gpu model: gtx 1080 for 5 minute games? and if yes, do you would recommend me a network equally suitable for this type of games? Thank you!
Yes, Kiudee will work well.

Try this network

59853 2 5a0e0471 3891.00 Link: https://lczero.org/networks/?show_all=0
thank you!

is normal that with hash 4096 Mb after a few moves it always remains at 100%.....?

Image
Yes, but hash still recycles. Look at your Nodes at the start of the new search. Regardless on the 100% usage. 302 Kn in 2 seconds. When you are searching only 32 thousand nodes per second.
"The worst thing that can happen to a forum is a running wild attacking moderator(HGM) who is not corrected by the community." - Ed Schröder
But my words like silent raindrops fell. And echoed in the wells of silence.