randomized parallel proof-number search acg 12, pamplona, may 2009

30
Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

Upload: tabitha-thomas

Post on 04-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

Randomized ParallelProof-Number SearchACG 12, Pamplona, May 2009

Page 2: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

Randomized ParallelProof-Number SearchJahn-T. Saito, Mark Winands, H. Jaap van den Herik

Page 3: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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?

Page 4: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Overview

• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work

Page 5: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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)

Page 6: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 7: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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)

Page 8: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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.

Page 9: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Overview

• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work

Page 10: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Search Overhead

Brockington and Schaeffer, 1997

• Search overhead• Synchronization overhead• Communication overhead

ii. Parallel Search

Page 11: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 12: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Overview

• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work

Page 13: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Multiple threads, one tree

Page 14: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 15: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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.

Page 16: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Randomization

iii. Randomized Parallel PNS

Page 17: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 18: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Overview

• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work

Page 19: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 20: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

LOA

iv. Experiment

Page 21: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 22: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Implementation

iv. Experiment

Page 23: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Results

iv. Experiment

Page 24: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 25: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 26: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 27: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Overview

• Proof-Number Search (PNS)• Parallel Search• Randomized Parallel PNS • Experiment• Conclusion and future work

Page 28: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 29: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

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

Page 30: Randomized Parallel Proof-Number Search ACG 12, Pamplona, May 2009

DKE

Thank you.