Planning & Search in Rust
Esc

Loading…

↑↓ move ↵ open Esc close
Colour theme
All algorithms

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 mean

In the crates

  • game-tree-search feature parallel

    Several threads grow one tree, selecting and backing up under one lock and evaluating outside it, spread over different lines by virtual loss.

    search_shared

Lineage

Comes from

combines Batched MCTS with virtual loss

Led to

Nothing on this site.

Papers

  1. 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 introduces doi 10.1007/978-3-540-87608-3_6