lightvector / KataGo

GTP engine and self-play learning in Go
https://katagotraining.org/
Other
3.52k stars 565 forks source link

"ownership true" and memory #133

Open objt-ba opened 4 years ago

objt-ba commented 4 years ago

I usually let KataGo analyze with the following command:

kata-analyze <ponder-time>

But sometimes, users also want an ownership map. Then I usually stop calculations. And I run the following command;

kata-analyze <ponder-time> ownership true

Apparently, when I do that, the calculations start from scratch. It is a bit annoying of course when the number of playouts was already really high. - Is there a way to get around losing the memory ?

Right now, I am considering 2 workarounds:

1) To spawn a second KataGo instance to make this calculation, just to keep the memory as is. 2) Alternatively, I could just always run katago with ownership true. It would then just be a matter of showing/hiding it for the user. But I fear this will impact performance heavily, and it is a waste if users don't use the ownership map at all.

Any ideas ?

lightvector commented 4 years ago

Have you tried benchmarking the cost of always ownership true?

hanysz commented 4 years ago

Just noting that when I run KataGo on my desktop with Lizzie, the "KataEstimate" button toggles the ownership map on and off without interfering with analysis. I guess that means Lizzie is running KataGo with ownership true all the time? I haven't been aware of anyone complaining about performance.

y-ich commented 3 years ago

getAverageTreeOwnership is certainly a heavy calculation though it may be parallelized with others. Reusing childWeightBuf in getAverageTreeOwnershipHelper by object pool pattern will improve performance a little.