Tree-parallel MCTS
Also known as Tree parallelization, Global-mutex tree parallelism
adversarial game-tree-search
Tree-parallel MCTS lets several threads grow one tree. Each thread, under the tree's lock, descends to a new leaf and marks its path as waiting, which other threads' selection counts as a loss (virtual loss), so they spread over different lines; outside the lock it values the leaf with its own evaluator and generator; under the lock again it backs the value up. The result is that of one search with more simulations, not a sum of trees as in root parallelism, and which thread reaches which leaf depends on scheduling, so a seed does not reproduce it. It pays off only when valuing a leaf costs far more than selecting it: with leaves of about a microsecond every added thread made it slower, as the threads queue for the lock, while with evaluations of about 30 microseconds eight threads beat root parallelism. Here it is search_shared, behind the parallel feature; use it with a costly evaluator such as a network, and root parallelism otherwise.
Pseudocode
algorithm Tree-parallel-MCTS(p₀, k, budget)input: root position p₀, threads k, budget of simulationsoutput: as MCTS, from the one shared treefor i in 1, …, k in parallel dorng_i ← new generator seeded from the searcher'swhile true dolock the treeif exhausted(budget), counting running simulations thenunlock the treebreakpath ← select a new leaf, as in MCTS ▷ waiting paths count as lossesadd a virtual loss along pathunlock the treev ← evaluate(leaf of path) with rng_i ▷ outside the lock: the costly partlock the treeremove the virtual loss along path, and back up v along itunlock the treereturn the most visited root move, and every root move's visits and meanIn the crates
game-tree-searchfeatureparallelSeveral threads grow one tree, selecting and backing up under one lock and evaluating outside it, spread over different lines by virtual loss.
Lineage
Comes from
combines Batched MCTS with virtual loss
Led to
Nothing on this site.
Papers
- Parallel Monte-Carlo Tree Search Guillaume M. J.-B. Chaslot, Mark H. M. Winands, H. Jaap van den Herik · 2008· Computers and Games (CG 2008), Lecture Notes in Computer Science