randomized parallel proof-number search acg 12, pamplona, may 2009
TRANSCRIPT
Randomized ParallelProof-Number SearchACG 12, Pamplona, May 2009
Randomized ParallelProof-Number SearchJahn-T. Saito, Mark Winands, H. Jaap van den Herik
DKE
Motivation
• 10 years ago Kishimoto and Kotani parallelized PDS for distributed memory machines.
• RQHow can standard PNS and PN2 be parallelized for today's common computers?
DKE
Overview
• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work
DKE
Proof-Number Search (PNS)• Binary goal: (dis)prove the root node
– E.g., to be a win for the player to move
• Solving positions or whole games: Shogi, LOA, Othello, Fanorona
• Best-First Search (BFS)• Heuristic selection: most-proving node
i. Proof-Number Search (PNS)
DKE
i. Proof-Number Search (PNS)
Proof number and Disproof Number
• Proof number (pn): the minimum number of leaf nodes which have to be proved in order to prove the node
• Disproof number (dn): the minimum number of leaf nodes which have to be disproved in order to disprove the node
• Proof number and disproof number for each node• Assume one expansion for each unexpanded node
DKE
PNS Example
a
b c
ih lk
ed gf
12
12
11
11
12
11
draw ??
loss ?
j
?
11
win
0∞
0∞ 0
∞
0∞
0∞
i. Proof-Number Search (PNS)
DKE
i. Proof-Number Search – PN2
PN2
2-level PN search
Bounded
The sub trees of the children are deleted when the second-level search stops.
PN1
PN2
Second level stops when a certain limit of nodes in memory is reached or its root is (dis) proved.
Leaf node in the first level. Root node in the second level.
DKE
Overview
• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work
DKE
Search Overhead
Brockington and Schaeffer, 1997
• Search overhead• Synchronization overhead• Communication overhead
ii. Parallel Search
DKE
ii. Parallel Search
Randomized Best-First Search (RBFS)
• Shoham & Toledo, 2002• Parallelize any Best-First Search (BFS)• Multiple threads operate on same tree• Best-first evaluation to set probability for
selecting a suboptimal child
DKE
Overview
• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work
DKE
Multiple threads, one tree
DKE
How do we implement RP for PNS?
• RP-PNS / RP-PN2
• Two kinds of threads:– One PV thread: most-proving heuristic– Alternatives threads: slightly deviate from
most-proving heuristic
iii. Randomized Parallel PNS
DKE
iii. Randomized Parallel PNS
How do the alternative threads deviate from the PV?
• Randomly deviate from PV once to N2 or N3.
• Randomly choose from best n sibbling nodes N1,…,Nn where bsn(Ni) < bsn(N1) + some constant D.
DKE
Randomization
iii. Randomized Parallel PNS
DKE
RP-PNS vs RBFS
iii. Randomized Parallel PNS
Equal chances for n best siblings
Deviate proportional to the BF heuristic
PV and alternative threads
All threads are equal
Proof Number SearchAny Best-First Search
RP-PNSRBFS
DKE
Overview
• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work
DKE
Experimental setup
• LOA test set – 143 positions– Average of 4.28 million nodes with PNS
• Two series of experiments– RP-PNS with 1, 2, 4, and 8 threads– RP-PN2 with 1, 2, 4, and 8 threads
iv. Experiment
DKE
LOA
iv. Experiment
DKE
Implementation
• lock per node• locking policy• PN2: limit PN2 tree to S3/4/T nodes
– T is #threads– S is size of PN1 tree– Compromise between speed and space
• C/C++ (pthreads) on 2.66 GHz Xeon
iv. Experiment
DKE
Implementation
iv. Experiment
DKE
Results
iv. Experiment
DKE
Observations
iv. Experiment
• Speed-up for RP-PNS and RP-PN2
• Best RP-PN2 is faster than PNS and uses less memory• RP-PN2 does hardly increase the maximal memory consumption • RP-PN2 scales better than RP-PNS
DKE
Explanations for (3) and (4)
iv. Experiment
• Best RP-PN2 designed to use less memory than serial PNS by size of PN2 trees • RP-PN2 scales better: partially because the size of PN2 depends on T
DKE
Overhead: 8 vs 1 threads
iv. Experiment
RP-PNS ca. 33% more expansions (i.e., search overhead), rest overhead is synchronization overhead.
RP-PN2
ca. 26% more expansions (i.e., search overhead) rest overhead is search overhead
DKE
Overview
• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work
DKE
Conclusion
v. Conclusion
RP-PNS viable for parallelizing PNS and PN2 on shared memory architectures
Figures seem comparable to ParaPDS (Kishimoto and Kotani 1999) but performance is not:– Different test sets– Different algorithms – Hash tables in ParaPDS
• Offer a new way to balance time and memory consumption of PNS
RP-PNS and RP-PN2 scale reasonably, but can still be improved
DKE
Future Work
• Smart distribution of parallelization between PN1 and PN2 for PN2 on more processors
• Pooling locks for the implementation• Better distribution function• K-best moves• Apply in small Go boards
v. Future Work
DKE
Thank you.