Komodo 12 and MCTS

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

Moderators: bob, hgm, Harvey Williamson

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Joerg Oster
Posts: 691
Joined: Fri Mar 10, 2006 3:29 pm
Location: Germany

Re: Komodo 12 and MCTS

Post by Joerg Oster » Mon May 14, 2018 11:03 am

shrapnel wrote:
Mon May 14, 2018 10:50 am
Joerg Oster wrote:
Mon May 14, 2018 10:08 am
Why would the MCTS benefit from using the GPU?
The "Why" I wouldn't know, not being a Programmer.
What I DO know is that AlphaZero used TPUs while thrashing Stockfish and that the GPU version of LCZero is much stronger than the CPU version.
Then why do you say it's pointless to not utilizing the GPU?
Especially if you don't know what you're talking about?

Hint: It's not the Monte Carlo Tree like search in LCZero that is utilizing the GPU ...
Jörg Oster

mjlef
Posts: 1427
Joined: Thu Mar 30, 2006 12:08 pm
Contact:

Re: Komodo 12 and MCTS

Post by mjlef » Mon May 14, 2018 11:28 am

peter wrote:
Mon May 14, 2018 7:12 am
Thanks a lot, Larry!
Seems a great idea to me, already downloaded.
lkaufman wrote:
Mon May 14, 2018 6:11 am
but for this release you just select it by UCI option.
Finding just a check- box for MCTS, numer of threads used for it has to be defined in total threads- number of the engine.

If I install a second one k12-Engine in GUI with MCTS off, I can let run both simultaneously to see the different outputs, of course, but is it planned to get shared hash for the two different kinds of search too sometimes?
Or doesn't that make sense to you?
Both MCTS and regular mode use whatever the Threads setting is for the engine. When a second UCI engine is running, it is a different process and so they are not sharing any memory. It could be possible to share hash table memory, but it is possible the two searching methods would disagree in the information stored which would "corrupt" the other search. MCTS uses win probabilities and grows its search tree in a vary different way from traditional alpha-beta search. It is an interesting idea. I will have to think about it.
Last edited by mjlef on Mon May 14, 2018 1:49 pm, edited 2 times in total.

mjlef
Posts: 1427
Joined: Thu Mar 30, 2006 12:08 pm
Contact:

Re: Komodo 12 and MCTS

Post by mjlef » Mon May 14, 2018 11:31 am

Werner wrote:
Mon May 14, 2018 9:42 am
Thanks Larry for the new version. With MCTS testing I have a question about :
"Monte Carlo Tree search requires extra memory"
- I see memory raises e.g. from 256 MB till about 800 MB
- when a new game starts, usually the engine is new started and all begins again
- is there a diffence when making a tournament where the engine is not new started, will the memory raise more and the engine benefits from it?
- are these learning data in the memory?

Werner
The MCTS memory to hold the nodes MCTS uses are all allocated at startup in the present version. MCTS depends on storing a lot more information in a search tree than alpha-beta search. Decisions on which part of the tree to expand are based on total win probabilities (to exploit good lines in the tree) and "widening" the search (exploration to discover more). So it needs this extra information.
Last edited by mjlef on Mon May 14, 2018 1:50 pm, edited 1 time in total.

mjlef
Posts: 1427
Joined: Thu Mar 30, 2006 12:08 pm
Contact:

Re: Komodo 12 and MCTS

Post by mjlef » Mon May 14, 2018 11:46 am

shrapnel wrote:
Mon May 14, 2018 10:50 am
Joerg Oster wrote:
Mon May 14, 2018 10:08 am
Why would the MCTS benefit from using the GPU?
The "Why" I wouldn't know, not being a Programmer.
What I DO know is that AlphaZero used TPUs while thrashing Stockfish and that the GPU version of LCZero is much stronger than the CPU version.
I think some people are confusing a neural network with Monte Carlo Tree Search. The neural network used in programs like AlphaZero Chess are used to estimate winning chances for a move, and for helping select which moves to expand first. MCTS does not depend on having a neural network, and the initial MCTS schemes had no such network at all. Komodo already knows a lot about chess. So we have come up with other ways to estimate initial winning chances and select moves to search/expand. MCTS is simply another way to search a game tree. The formula we use is not the standard UCT, but it shares characteristics, such as being more likely to expand lower scoring moves the higher the number of parent node visits is.

Larry and I have been thinking about MCTS for several years. And the basic scheme was one we had discussed and proposed years ago. We are finding out new things every day.

JohnS
Posts: 134
Joined: Sun Feb 24, 2008 1:08 am

Re: Komodo 12 and MCTS

Post by JohnS » Mon May 14, 2018 11:48 am

Mark

Is it correct to say that Komodo MCTS is not using a weights file like Lczero? If so, can it ever learn? Say I run it on a given position and it finds a deep win after a long time. If I quit the GUI and restart the analysis process again for the same position, will it find the win quicker or in the same time as before?

Thanks.

User avatar
Ozymandias
Posts: 1128
Joined: Sun Oct 25, 2009 12:30 am

Re: Komodo 12 and MCTS

Post by Ozymandias » Mon May 14, 2018 11:59 am

JohnS wrote:
Mon May 14, 2018 11:48 am
can it ever learn? Say I run it on a given position and it finds a deep win after a long time. If I quit the GUI and restart the analysis process again for the same position, will it find the win quicker or in the same time as before?
If you save/load the hash... it should.

shrapnel
Posts: 1213
Joined: Fri Nov 02, 2012 8:43 am
Location: New Delhi, India

Re: Komodo 12 and MCTS

Post by shrapnel » Mon May 14, 2018 1:07 pm

Joerg Oster wrote:
Mon May 14, 2018 11:03 am
Then why do you say it's pointless to not utilizing the GPU?
Especially if you don't know what you're talking about?
LCZero has both CPU versions and GPU versions and it is an established fact that the GPU version is much stronger.
Also, AlphaZero used TPUs and not CPU.
So, I think its safe to say that if Komodo had a version which used the GPU, it would be much stronger than the CPU version of itself.
I may not be a great Programmer like you, but I have certainly more common sense than you.
i7 5960X @ 4.1 Ghz, 64 GB G.Skill RipJaws RAM, Twin Asus ROG Strix OC 11 GB Geforce 2080 Tis

User avatar
CMCanavessi
Posts: 835
Joined: Thu Dec 28, 2017 3:06 pm
Location: Argentina

Re: Komodo 12 and MCTS

Post by CMCanavessi » Mon May 14, 2018 1:13 pm

shrapnel wrote:
Mon May 14, 2018 1:07 pm
Joerg Oster wrote:
Mon May 14, 2018 11:03 am
Then why do you say it's pointless to not utilizing the GPU?
Especially if you don't know what you're talking about?
LCZero has both CPU versions and GPU versions and it is an established fact that the GPU version is much stronger.
Also, AlphaZero used TPUs and not CPU.
So, I think its safe to say that if Komodo had a version which used the GPU, it would be much stronger than the CPU version of itself.
I may not be a great Programmer like you, but I have certainly more common sense than you.
No, you're completely wrong. The only reason why Leela and A0 benefit from GPU (or TPU) is because they use a neural network, which Komodo doesn't. MCTS has nothing to do with it.
Follow my tournament and some Leela gauntlets live at http://twitch.tv/ccls

mjlef
Posts: 1427
Joined: Thu Mar 30, 2006 12:08 pm
Contact:

Re: Komodo 12 and MCTS

Post by mjlef » Mon May 14, 2018 1:17 pm

JohnS wrote:
Mon May 14, 2018 11:48 am
Mark

Is it correct to say that Komodo MCTS is not using a weights file like Lczero? If so, can it ever learn? Say I run it on a given position and it finds a deep win after a long time. If I quit the GUI and restart the analysis process again for the same position, will it find the win quicker or in the same time as before?

Thanks.
Well, Leela and AlphaZero Chess would also not "learn" when using it in game mode. The learning process is done separately. In any case, Komodo also would not "learn" in this way. We do change a bunch of evaluation parameters internally in MCTS mode. For example, we set Contempt to zero (just like when analyzing a game), since Contempt would effectively skew the win probabilities.

Note that Komodo does have a way to save the current hash tables to disk, then reload them later. I would not call that learning, but it is helpful in continuing analysis at a later time. But that was designed more for regular search and not MCTS.
Last edited by mjlef on Mon May 14, 2018 1:54 pm, edited 1 time in total.

mjlef
Posts: 1427
Joined: Thu Mar 30, 2006 12:08 pm
Contact:

Re: Komodo 12 and MCTS

Post by mjlef » Mon May 14, 2018 1:18 pm

JohnS wrote:
Mon May 14, 2018 11:48 am
Mark

Is it correct to say that Komodo MCTS is not using a weights file like Lczero? If so, can it ever learn? Say I run it on a given position and it finds a deep win after a long time. If I quit the GUI and restart the analysis process again for the same position, will it find the win quicker or in the same time as before?

Thanks.
Well, Leela and AlphaZero Chess would also not "learn" when using it in game mode. The learning process is done separately as training session to train the neural network which they use. In any case, Komodo also would not "learn" in this way. Note that Komodo does have a way to save the current hash tables to disk, then reload them later. I would not call that learning, but it is helpful in continuing analysis at a later time.
Last edited by mjlef on Mon May 14, 2018 2:25 pm, edited 1 time in total.

Post Reply