Parallel Programming in Chess Simulations
58K - views

Parallel Programming in Chess Simulations

Similar presentations


Download Presentation

Parallel Programming in Chess Simulations




Download Presentation - The PPT/PDF document "Parallel Programming in Chess Simulation..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.



Presentation on theme: "Parallel Programming in Chess Simulations"— Presentation transcript:

Slide1

Parallel Programming in Chess Simulations

Tyler Patton

Slide2

Discussion:

Background

Sequential Optimizations

Parallelization of chess

Slide3

Background: What is Chess?

Strategic 2 player game64 tiles16 pieces per playerObjective to capture the opponents king

Slide4

Background: Chess ELO

Created by Arpad

Elo

to improve chess ratings

Players of equal ELO have an equal chance to win

A difference of 400 ELO gives a win 97% of the

time to the higher rated player

Basic formula:

Performance Rating =

Opponents’ Total Ratings + 400*(wins-losses)

Number of games

Average Player rating: 1200

Highest player rating: 2850 (Magnus Carlson)

Slide5

Background: Scope

First estimate of the number of positions:

64! / 32!*(8!)

2

*(2!)

6

=10

43

(Shannon)

Tight upper bound:

=10

50

(Dr. Allis)

Number of possible game variations:

10

120

(Shannon number)

Given ~10

3

starting moves and 40 move pair average

Slide6

Background: History of chess engines

1950: Alan Turing develops Turbochamp.1962: Adam Kotok of MIT develops first “credible” chess program.1997: Deep blue defeats Gary Kasparov in 6 gamesPresent: Stockfish 6 holds a rating of 3309

Slide7

Deep blue vs Kasparov

Slide8

Sequential Optimizations:

StockFish

StockFish implementation:Alpha-Beta pruning BitboardsTransposition tableLate move reductions

Slide9

Sequential Optimizations: Minimax search

Minimax: Evaluate a given move, the opponents responses and your responses to your opponent’s moves… etc.Proceed to the next move and repeat.Choose the tree which yields the best ending evaluationAssume the opponent always chooses the best move

Slide10

Sequential Optimizations:Alpha-Beta Pruning

Alpha is the maximum score the player is guaranteed for a branchBeta is the minimum score the opponent is guaranteed for a branchAllows for eliminations of branches in the search treeEliminates branches if the opponent would never allow the positionOrdered node complexity: O(bd/2)Random order complexity: O(b3d/4)

Slide11

Sequential Optimizations:Alpha-Beta Pruning

Slide12

Sequential Optimizations: Transposition Table

Stores the history of search evaluations

Positions that been searched are likely to be reached again

Before a branch is searched the transpositions table is checked and gives the result if able

Implemented as a hash table

Slide13

Parallelization of Chess:Parallelizing Alpha-Beta pruning

Goal: Use multiple processors to simultaneously search different branches of the game tree

Drawback: Dependency on the alpha

value

Processors are dependent on each other for updated alpha values which cause communication

locks

Parallel algorithms tend to be less efficient since the alpha value is not as strong

Parallel implementation only has equivalent efficiency to the sequential algorithm if the first move if the best one examined

Slide14

Parallelization of Chess:Principal Variation Splitting

Early technique for parallelizing alpha-betaAssumptions: The game tree is well orderedThe leftmost path is the bestUpdates alpha after a branch is searched

Slide15

Parallelization of Chess:Typical Speedup

Principal Variation SplittingImplemented using 4 or fewer Processors with a speedup of ~3.5The Younger Brothers Wait Concept achieved a speedup of 140 on 256 nodesCilkChess parallel engine is shown to be scalable up to 1000 nodes with a similar speedup to The Younger Brothers Wait Concept

Slide16

Parallelization of Chess:Looking to the future

The best algorithm for large numbers of processors and indefinite tree size is

unknown

Explore new algorithms that don’t rely on communication

pitfalls

Optimizations to existing algorithms and techniques are still possible

i.e. making the new alpha available to each processor when its found as opposed to when a processor finishes a

search

Slide17

Questions?