Speculative Parallelism in Cilk++

Size: px
Start display at page:

Download "Speculative Parallelism in Cilk++"

Transcription

1 Speculative Parallelism in Cilk++ Ruben Perez & Gregory Malecha MIT May 11, 2010 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

2 Parallelizing Embarrassingly Parallel Problems Lots of search algorithms are embarrassingly parallel. Search down all the paths of a tree. Search multiple disjoint branches in parallel. No communcation overhead. Very little memory contention. Since we often only need a single answer, we can stop once we ve found any solution. Cannonical algorithms are in game-search, minimax and α-β pruning. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

3 2 Player Game Trees Nodes represent game states. Edges represent transitions between states. Leaf states are scored by a heuristic. Goal is to maximize the heuristic against an adversary. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

4 Parallelizing MiniMax max min max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

5 Parallelizing MiniMax max 3 min max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

6 Parallelizing MiniMax max 3 0 min max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

7 Parallelizing MiniMax max 3 0 min 2 max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

8 Parallelizing MiniMax max 3 0 min 2-1 max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

9 Parallelizing MiniMax max min 2-1 max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

10 Parallelizing MiniMax 3 max min 2-1 max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

11 Improving MiniMax MiniMax exhaustively searches the game tree to a certain depth (iterative deepening). Not efficient for most games due to large branching factor. Can t search deep enough for the computer to be smart. Intuition Keep track of the range of feasible scores and prune branches that fall outside the range. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

12 α-β Pruning Keep additional information with each game node: α and β. α is the lower bound on the player s score. β is the upper bound on the player s score. This pruning allows us to search twice as deep on average. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

13 α-β Pruning Keep additional information with each game node: α and β. α is the lower bound on the player s score. β is the upper bound on the player s score. This pruning allows us to search twice as deep on average. Let s see an example... Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

14 Pruning Example [, ] max min max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

15 Pruning Example [3, ] max 3 min max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

16 Pruning Example [3, ] max 3 0 min max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

17 Pruning Example [3, ] max 3 0 [3, ] min max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

18 Pruning Example [3, ] max 3 0 [3, ] min 2 max Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

19 Pruning Example [3, ] max 3 0 [3, 2] min 2 max Prune! Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

20 Outline A Recipe for Speculation 1 A Recipe for Speculation Porting the Example Implementing abort 2 Evaluation Performance Complexity Porting Old Code 3 Conclusions Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

21 A Recipe for Speculation A Recipe for Speculation When we speculate, we don t want to have to commit to something finishing. Need a way to abort currently running computations that we don t need anymore. For consistency, we d like to be able to abort computations that are speculating. We also need a way to combine the results. Reducers would work for this, but they will need to be able to call abort. Older versions of cilk had another mechanism for this. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

22 Speculation in Cilk5 A Recipe for Speculation Speculation is just based on spawn. Combining results done through inlets. inlets are functions that merge results together (similar to reducers). inlets can also make the choice to abort computations. Let s look at a simple example. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

23 A Recipe for Speculation Simple Example: Native abort & Inlets Imagine you have two computations that should yield the same result, but one could take significantly longer to compute. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

24 A Recipe for Speculation Simple Example: Native abort & Inlets Imagine you have two computations that should yield the same result, but one could take significantly longer to compute. Speculatively execute both and abort when the first finishes. i n t l o n g c o m p u t a t i o n 1 ( void a r g s ) ; i n t l o n g c o m p u t a t i o n 2 ( void a r g s ) ; i n t f i r s t ( void args1, void a r g s 2 ) { i n t x ; inlet void reduce(int r) { x = r; abort; } reduce( c i l k s p a w n l o n g c o m p u t a t i o n 1 ( a r g s 1 )) ; reduce( c i l k s p a w n l o n g c o m p u t a t i o n 2 ( a r g s 2 )) ; c i l k s y n c ; r e t u r n x ; } Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

25 A Recipe for Speculation Simple Example: Native abort & Inlets Imagine you have two computations that should yield the same result, but one could take significantly longer to compute. Speculatively execute both and abort when the first finishes. i n t l o n g c o m p u t a t i o n 1 ( void a r g s ) ; i n t l o n g c o m p u t a t i o n 2 ( void a r g s ) ; i n t f i r s t ( void args1, void a r g s 2 ) { i n t x ; inlet void reduce(int r) { x = r; abort; } reduce( c i l k s p a w n l o n g c o m p u t a t i o n 1 ( a r g s 1 )) ; reduce( c i l k s p a w n l o n g c o m p u t a t i o n 2 ( a r g s 2 )) ; c i l k s y n c ; r e t u r n x ; } No support for abort or inlet in cilk++. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

26 Outline A Recipe for Speculation Porting the Example 1 A Recipe for Speculation Porting the Example Implementing abort 2 Evaluation Performance Complexity Porting Old Code 3 Conclusions Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

27 Handling inlets A Recipe for Speculation Porting the Example Inlets are local functions that merge the result of spawned computations. Serve a similar purpose to reducers, but a little more general. Get access to the parent function s stack frame. Semantics inlets are locally serial, i.e. all of the inlets for a particular stack frame will run serially. The order of executing them is non-deterministic, implementation based on the amount of time that the computations take. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

28 Handling inlets A Recipe for Speculation Porting the Example i n t l o n g c o m p u t a t i o n 1 ( void a r g s ) ; i n t l o n g c o m p u t a t i o n 2 ( void a r g s ) ; i n t f i r s t ( void args1, void a r g s 2 ) { i n t x ; i n l e t void r e d u c e ( i n t r ) { x = r ; abort ; } r e d u c e ( c i l k s p a w n l o n g c o m p u t a t i o n 1 ( a r g s 1 ) ) ; r e d u c e ( c i l k s p a w n l o n g c o m p u t a t i o n 2 ( a r g s 2 ) ) ; c i l k s y n c ; r e t u r n x ; } Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

29 A Recipe for Speculation Handling inlets via Translation Porting the Example Translate inlets into continuations. Not a particularly painful translation. It can be annoying to work with continuations in C code. Ideally this would be a compilation step. Mostly mechanical translation preserves semantics Depending on how they are used, it might be more efficient to use reducers. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

30 cilk5 Code A Recipe for Speculation Porting the Example i n t f 1 ( void a r g s ) ; i n t f 2 ( void a r g s ) ; i n t f i r s t ( void args1, void a r g s 2 ) { i n t x ; i n l e t void r e d u c e ( i n t r ) { x = r ; abort ; } r e d u c e ( c i l k s p a w n f 1 ( a r g s 1 ) ) ; r e d u c e ( c i l k s p a w n f 2 ( a r g s 2 ) ) ; c i l k s y n c ; r e t u r n x ; } Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

31 A Recipe for Speculation Translated cilk++ Code Porting the Example s t r u c t I n l e t E n v { c i l k : : mutex m; i n t x ; } ; i n t f 1 ( void a r g s, int(*cont)(int, InletEnv*), InletEnv* env ) ; i n t f 2 ( void a r g s, int(*cont)(int, InletEnv*), InletEnv* env ) ; i n t f i r s t i n l e t ( i n t r e s u l t, I n l e t E n v env ) { env >m. l o c k ( ) ; // S e r i a l e x e c u t i o n env >x = r e s u l t ; abort ; env >m. u n l o c k ( ) ; // S e r i a l e x e c u t i o n } i n t f i r s t ( void args1, void a r g s 2 ) { InletEnv env ; c i l k s p a w n f 1 ( a r g s 1, first inlet, env ) ; c i l k s p a w n f 2 ( a r g s 2, first inlet, env ) ; c i l k s y n c ; r e t u r n env.x ; } Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

32 A Recipe for Speculation Translated cilk++ Code Porting the Example s t r u c t I n l e t E n v { c i l k : : mutex m; i n t x ; } ; i n t f 1 ( void a r g s, int(*cont)(int, InletEnv*), InletEnv* env ) ; i n t f 2 ( void a r g s, int(*cont)(int, InletEnv*), InletEnv* env ) ; i n t f i r s t i n l e t ( i n t r e s u l t, I n l e t E n v env ) { env >m. l o c k ( ) ; // S e r i a l e x e c u t i o n env >x = r e s u l t ; abort ; env >m. u n l o c k ( ) ; // S e r i a l e x e c u t i o n } i n t f i r s t ( void args1, void a r g s 2 ) { InletEnv env ; c i l k s p a w n f 1 ( a r g s 1, first inlet, env ) ; c i l k s p a w n f 2 ( a r g s 2, first inlet, env ) ; c i l k s y n c ; r e t u r n env.x ; } Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

33 A Recipe for Speculation Translated cilk++ Code Porting the Example s t r u c t I n l e t E n v { c i l k : : mutex m; i n t x ; } ; i n t f 1 ( void a r g s, int(*cont)(int, InletEnv*), InletEnv* env ) ; i n t f 2 ( void a r g s, int(*cont)(int, InletEnv*), InletEnv* env ) ; i n t f i r s t i n l e t ( i n t r e s u l t, I n l e t E n v env ) { env >m. l o c k ( ) ; // S e r i a l e x e c u t i o n env >x = r e s u l t ; abort ; Still need to handle abort env >m. u n l o c k ( ) ; // S e r i a l e x e c u t i o n } i n t f i r s t ( void args1, void a r g s 2 ) { InletEnv env ; c i l k s p a w n f 1 ( a r g s 1, first inlet, env ) ; c i l k s p a w n f 2 ( a r g s 2, first inlet, env ) ; c i l k s y n c ; r e t u r n env.x ; } Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

34 Outline A Recipe for Speculation Implementing abort 1 A Recipe for Speculation Porting the Example Implementing abort 2 Evaluation Performance Complexity Porting Old Code 3 Conclusions Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

35 A Recipe for Speculation Implementing abort abort Features We saw a notion of global abort in Lab 5. When you abort, you abort everything, completely done. This is not compositional. Compositionality Compositionality requires the ability to abort speculating computations. Need an abort hierarchy. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

36 Hierarchical abort A Recipe for Speculation Implementing abort Abort any subtree of the computation without affecting the rest of the computations. 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

37 Hierarchical abort A Recipe for Speculation Implementing abort Abort any subtree of the computation without affecting the rest of the computations. 0 X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

38 Hierarchical abort A Recipe for Speculation Implementing abort Abort any subtree of the computation without affecting the rest of the computations. 0 X 0 X X X X Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

39 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... 0 X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

40 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. 0 X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

41 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. 0 X 0 Should I abort? Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

42 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. 0 X 0 Should I abort? Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

43 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. 0 X 0 Should I abort? Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

44 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. 0 X 0 Should I abort? Yes Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

45 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 0 X 0 Should I abort? Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

46 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 0 X 0 Should I abort? Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

47 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 0 X 0 Should I abort? Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

48 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 0 X 0 Should I abort? X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

49 A Recipe for Speculation User-Implemented abort Implementing abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 0 X 0 Should I abort? Yes X 0 X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

50 A Recipe for Speculation Implementing abort User-Implemented abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 2 Abort down, push the abort flag down the tree 0 X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

51 A Recipe for Speculation Implementing abort User-Implemented abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 2 Abort down, push the abort flag down the tree 0 Abort! X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

52 A Recipe for Speculation Implementing abort User-Implemented abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 2 Abort down, push the abort flag down the tree 0 Abort! X 0 X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

53 A Recipe for Speculation Implementing abort User-Implemented abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 2 Abort down, push the abort flag down the tree 0 Abort! X 0 X 0 X 0 Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

54 A Recipe for Speculation Implementing abort User-Implemented abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 2 Abort down, push the abort flag down the tree 0 Abort! X 0 X 0 X X Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

55 A Recipe for Speculation Implementing abort User-Implemented abort Implement using polling... Two possible implementations: 1 Poll up toward the root. Also, lazily copy values downward. 2 Abort down, push the abort flag down the tree 0 Abort! X 0 X X X X Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

56 High-level Performace A Recipe for Speculation Implementing abort Poll-Up Polling is expensive (linear in depth of node) abort is cheap (constant time, single memory access). Abort-Down Polling is cheap (constant time, single memory access). abort is expensive (linear in the size of the subtree). Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

57 High-level Performace A Recipe for Speculation Implementing abort Poll-Up Polling is expensive (linear in depth of node) abort is cheap (constant time, single memory access). Really simple implementation. Abort-Down Polling is cheap (constant time, single memory access). abort is expensive (linear in the size of the subtree). Code is much more complex. Some extra overhead, currently using a locking implementation. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

58 Outline Evaluation 1 A Recipe for Speculation Porting the Example Implementing abort 2 Evaluation Performance Complexity Porting Old Code 3 Conclusions Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

59 Outline Evaluation Performance 1 A Recipe for Speculation Porting the Example Implementing abort 2 Evaluation Performance Complexity Porting Old Code 3 Conclusions Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

60 Evaluation Performance Different Flavors of Abort Compare the different abort techniques. Build a tree of height 14 and branching factor of 4. Poll at each leaf 100 times. Abort the root. Poll at each leaf Distribution of Time Tree Height 14, Branching Factor Processor Ticks (x ) Aborted Poll(x1) Abort Poll (x100) Build Poll Up Poll Up (Caching) Poll Down Abort Method Note that abort is serial. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

61 Evaluation Performance Different Flavors of Abort Compare the different abort techniques. Build a tree of height 20 and branching factor of 2. Poll at each leaf 100 times. Abort the root. Poll at each leaf Distribution of Time Tree Height 20, Branching Factor Processor Clock Ticks (x ) Aborted Poll(x1) Abort Poll (x100) Build 0 Poll Up Poll Up (Caching) Poll Down Abort Method Note that abort is serial. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

62 Evaluation Performance Polling Granularity Effects Nodes Explored We re running our ported pousse code (with some instrumentation). Granularity N doesn t poll at the lowest N levels of the tree. Base only checks abort in the loop that spawns the child computations Total Number of Nodes Explored # of Nodes (x1000) Granularity 3 Granularity 4 Granularity 5 Base Polling Granularity Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

63 Evaluation Performance Polling Granularity Effects # of Polls We re running our ported pousse code (with some instrumentation). Granularity N doesn t poll at the lowest N levels of the tree. Base only checks abort in the loop that spawns the child computations Number of Polls # of Polls (x1000) Granularity 3 Granularity 4 Granularity 5 Base Polling Strategy Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

64 Evaluation Performance Polling Granularity Effects # of Aborts We re running our ported pousse code (with some instrumentation). Granularity N doesn t poll at the lowest N levels of the tree. Base only checks abort in the loop that spawns the child computations Number of Aborts 5000 # of Aborts (x1000) Granularity 3 Granularity 4 Granularity 5 Base Polling Strategy Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

65 Outline Evaluation Complexity Porting Old Code 1 A Recipe for Speculation Porting the Example Implementing abort 2 Evaluation Performance Complexity Porting Old Code 3 Conclusions Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

66 Evaluation Experience Porting Cilk Code Complexity Porting Old Code We ported Cilk Pousse 1 from cilk to cilk++. Lines Cilk Pousse 956 Cilk++ Pousse 1011 Increase 5.07% Pretty simple with the inlet translation. Most annoying part is adding the calls to poll. This can use some tuning. Code is a little more difficult to read, but not too bad. The real problem is that this changes the interface. Need to pass around the abort object. If it is used with an inlet, need to add continuation. Whole-code transformation is bad. 1 people.csail.mit.edu/pousse/ Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

67 Outline Conclusions 1 A Recipe for Speculation Porting the Example Implementing abort 2 Evaluation Performance Complexity Porting Old Code 3 Conclusions Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

68 Conclusions Speculations on Speculative Parallelism Speculative parallelism is definitely implementable as a library. Native runtime support might be more efficient/nicer. Lack of some abstraction features makes using it at the high-level require interface changes....but, using it locally at the leaves does not leak into the rest of the code. Ruben Perez & Gregory Malecha (MIT) Speculative Parallelism in Cilk++ May 11, / 33

IE418 Integer Programming

IE418 Integer Programming IE418: Integer Programming Department of Industrial and Systems Engineering Lehigh University 2nd February 2005 Boring Stuff Extra Linux Class: 8AM 11AM, Wednesday February 9. Room??? Accounts and Passwords

More information

Alpha-Beta Pruning: Algorithm and Analysis

Alpha-Beta Pruning: Algorithm and Analysis Alpha-Beta Pruning: Algorithm and Analysis Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Introduction Alpha-beta pruning is the standard searching procedure used for solving

More information

Alpha-Beta Pruning: Algorithm and Analysis

Alpha-Beta Pruning: Algorithm and Analysis Alpha-Beta Pruning: Algorithm and Analysis Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Introduction Alpha-beta pruning is the standard searching procedure used for 2-person

More information

Alpha-Beta Pruning: Algorithm and Analysis

Alpha-Beta Pruning: Algorithm and Analysis Alpha-Beta Pruning: Algorithm and Analysis Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Introduction Alpha-beta pruning is the standard searching procedure used for 2-person

More information

1 Trees. Listing 1: Node with two child reference. public class ptwochildnode { protected Object data ; protected ptwochildnode l e f t, r i g h t ;

1 Trees. Listing 1: Node with two child reference. public class ptwochildnode { protected Object data ; protected ptwochildnode l e f t, r i g h t ; 1 Trees The next major set of data structures belongs to what s called Trees. They are called that, because if you try to visualize the structure, it kind of looks like a tree (root, branches, and leafs).

More information

Algorithms for Playing and Solving games*

Algorithms for Playing and Solving games* Algorithms for Playing and Solving games* Andrew W. Moore Professor School of Computer Science Carnegie Mellon University www.cs.cmu.edu/~awm awm@cs.cmu.edu 412-268-7599 * Two Player Zero-sum Discrete

More information

Game playing. Chapter 6. Chapter 6 1

Game playing. Chapter 6. Chapter 6 1 Game playing Chapter 6 Chapter 6 1 Outline Minimax α β pruning UCT for games Chapter 6 2 Game tree (2-player, deterministic, turns) Chapter 6 3 Minimax Perfect play for deterministic, perfect-information

More information

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018

Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 CS17 Integrated Introduction to Computer Science Klein Contents Lecture 17: Trees and Merge Sort 10:00 AM, Oct 15, 2018 1 Tree definitions 1 2 Analysis of mergesort using a binary tree 1 3 Analysis of

More information

Scout, NegaScout and Proof-Number Search

Scout, NegaScout and Proof-Number Search Scout, NegaScout and Proof-Number Search Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Introduction It looks like alpha-beta pruning is the best we can do for a generic searching

More information

23. Cutting planes and branch & bound

23. Cutting planes and branch & bound CS/ECE/ISyE 524 Introduction to Optimization Spring 207 8 23. Cutting planes and branch & bound ˆ Algorithms for solving MIPs ˆ Cutting plane methods ˆ Branch and bound methods Laurent Lessard (www.laurentlessard.com)

More information

past balancing schemes require maintenance of balance info at all times, are aggresive use work of searches to pay for work of rebalancing

past balancing schemes require maintenance of balance info at all times, are aggresive use work of searches to pay for work of rebalancing 1 Splay Trees Sleator and Tarjan, Self Adjusting Binary Search Trees JACM 32(3) 1985 The claim planning ahead. But matches previous idea of being lazy, letting potential build up, using it to pay for expensive

More information

Sorting. CMPS 2200 Fall Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk

Sorting. CMPS 2200 Fall Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk CMPS 2200 Fall 2017 Sorting Carola Wenk Slides courtesy of Charles Leiserson with changes and additions by Carola Wenk 11/17/17 CMPS 2200 Intro. to Algorithms 1 How fast can we sort? All the sorting algorithms

More information

Scout and NegaScout. Tsan-sheng Hsu.

Scout and NegaScout. Tsan-sheng Hsu. Scout and NegaScout Tsan-sheng Hsu tshsu@iis.sinica.edu.tw http://www.iis.sinica.edu.tw/~tshsu 1 Abstract It looks like alpha-beta pruning is the best we can do for an exact generic searching procedure.

More information

CS 4100 // artificial intelligence. Recap/midterm review!

CS 4100 // artificial intelligence. Recap/midterm review! CS 4100 // artificial intelligence instructor: byron wallace Recap/midterm review! Attribution: many of these slides are modified versions of those distributed with the UC Berkeley CS188 materials Thanks

More information

Today: Linear Programming (con t.)

Today: Linear Programming (con t.) Today: Linear Programming (con t.) COSC 581, Algorithms April 10, 2014 Many of these slides are adapted from several online sources Reading Assignments Today s class: Chapter 29.4 Reading assignment for

More information

Unit 8: Sequ. ential Circuits

Unit 8: Sequ. ential Circuits CPSC 121: Models of Computation Unit 8: Sequ ential Circuits Based on slides by Patrice Be lleville and Steve Wolfman Pre-Class Learning Goals By the start of class, you s hould be able to Trace the operation

More information

Sorting. CS 3343 Fall Carola Wenk Slides courtesy of Charles Leiserson with small changes by Carola Wenk

Sorting. CS 3343 Fall Carola Wenk Slides courtesy of Charles Leiserson with small changes by Carola Wenk CS 3343 Fall 2010 Sorting Carola Wenk Slides courtesy of Charles Leiserson with small changes by Carola Wenk 10/7/10 CS 3343 Analysis of Algorithms 1 How fast can we sort? All the sorting algorithms we

More information

Problem. Problem Given a dictionary and a word. Which page (if any) contains the given word? 3 / 26

Problem. Problem Given a dictionary and a word. Which page (if any) contains the given word? 3 / 26 Binary Search Introduction Problem Problem Given a dictionary and a word. Which page (if any) contains the given word? 3 / 26 Strategy 1: Random Search Randomly select a page until the page containing

More information

Decision Trees: Overfitting

Decision Trees: Overfitting Decision Trees: Overfitting Emily Fox University of Washington January 30, 2017 Decision tree recap Loan status: Root 22 18 poor 4 14 Credit? Income? excellent 9 0 3 years 0 4 Fair 9 4 Term? 5 years 9

More information

Static Program Analysis

Static Program Analysis Static Program Analysis Xiangyu Zhang The slides are compiled from Alex Aiken s Michael D. Ernst s Sorin Lerner s A Scary Outline Type-based analysis Data-flow analysis Abstract interpretation Theorem

More information

CS6375: Machine Learning Gautam Kunapuli. Decision Trees

CS6375: Machine Learning Gautam Kunapuli. Decision Trees Gautam Kunapuli Example: Restaurant Recommendation Example: Develop a model to recommend restaurants to users depending on their past dining experiences. Here, the features are cost (x ) and the user s

More information

CITS4211 Mid-semester test 2011

CITS4211 Mid-semester test 2011 CITS4211 Mid-semester test 2011 Fifty minutes, answer all four questions, total marks 60 Question 1. (12 marks) Briefly describe the principles, operation, and performance issues of iterative deepening.

More information

Optimisation and Operations Research

Optimisation and Operations Research Optimisation and Operations Research Lecture 15: The Greedy Heuristic Matthew Roughan http://www.maths.adelaide.edu.au/matthew.roughan/ Lecture_notes/OORII/ School of

More information

At the start of the term, we saw the following formula for computing the sum of the first n integers:

At the start of the term, we saw the following formula for computing the sum of the first n integers: Chapter 11 Induction This chapter covers mathematical induction. 11.1 Introduction to induction At the start of the term, we saw the following formula for computing the sum of the first n integers: Claim

More information

Evolving a New Feature for a Working Program

Evolving a New Feature for a Working Program Evolving a New Feature for a Working Program Mike Stimpson arxiv:1104.0283v1 [cs.ne] 2 Apr 2011 January 18, 2013 Abstract A genetic programming system is created. A first fitness function f 1 is used to

More information

Computer Systems on the CERN LHC: How do we measure how well they re doing?

Computer Systems on the CERN LHC: How do we measure how well they re doing? Computer Systems on the CERN LHC: How do we measure how well they re doing? Joshua Dawes PhD Student affiliated with CERN & Manchester My research pages: http://cern.ch/go/ggh8 Purpose of this talk Principally

More information

N-gram Language Modeling Tutorial

N-gram Language Modeling Tutorial N-gram Language Modeling Tutorial Dustin Hillard and Sarah Petersen Lecture notes courtesy of Prof. Mari Ostendorf Outline: Statistical Language Model (LM) Basics n-gram models Class LMs Cache LMs Mixtures

More information

Temporal Difference Learning & Policy Iteration

Temporal Difference Learning & Policy Iteration Temporal Difference Learning & Policy Iteration Advanced Topics in Reinforcement Learning Seminar WS 15/16 ±0 ±0 +1 by Tobias Joppen 03.11.2015 Fachbereich Informatik Knowledge Engineering Group Prof.

More information

Mock Exam Künstliche Intelligenz-1. Different problems test different skills and knowledge, so do not get stuck on one problem.

Mock Exam Künstliche Intelligenz-1. Different problems test different skills and knowledge, so do not get stuck on one problem. Name: Matriculation Number: Mock Exam Künstliche Intelligenz-1 January 9., 2017 You have one hour(sharp) for the test; Write the solutions to the sheet. The estimated time for solving this exam is 53 minutes,

More information

Clock-driven scheduling

Clock-driven scheduling Clock-driven scheduling Also known as static or off-line scheduling Michal Sojka Czech Technical University in Prague, Faculty of Electrical Engineering, Department of Control Engineering November 8, 2017

More information

CS 387/680: GAME AI MOVEMENT

CS 387/680: GAME AI MOVEMENT CS 387/680: GAME AI MOVEMENT 4/11/2017 Instructor: Santiago Ontañón so367@drexel.edu Class website: https://www.cs.drexel.edu/~santi/teaching/2017/cs387/intro.html Outline Movement Basics Aiming Jumping

More information

Minimax strategies, alpha beta pruning. Lirong Xia

Minimax strategies, alpha beta pruning. Lirong Xia Minimax strategies, alpha beta pruning Lirong Xia Reminder ØProject 1 due tonight Makes sure you DO NOT SEE ERROR: Summation of parsed points does not match ØProject 2 due in two weeks 2 How to find good

More information

Andrew/CS ID: Midterm Solutions, Fall 2006

Andrew/CS ID: Midterm Solutions, Fall 2006 Name: Andrew/CS ID: 15-780 Midterm Solutions, Fall 2006 November 15, 2006 Place your name and your andrew/cs email address on the front page. The exam is open-book, open-notes, no electronics other than

More information

CMU Lecture 4: Informed Search. Teacher: Gianni A. Di Caro

CMU Lecture 4: Informed Search. Teacher: Gianni A. Di Caro CMU 15-781 Lecture 4: Informed Search Teacher: Gianni A. Di Caro UNINFORMED VS. INFORMED Uninformed Can only generate successors and distinguish goals from non-goals Informed Strategies that can distinguish

More information

CS 310 Advanced Data Structures and Algorithms

CS 310 Advanced Data Structures and Algorithms CS 310 Advanced Data Structures and Algorithms Runtime Analysis May 31, 2017 Tong Wang UMass Boston CS 310 May 31, 2017 1 / 37 Topics Weiss chapter 5 What is algorithm analysis Big O, big, big notations

More information

The CPLEX Library: Mixed Integer Programming

The CPLEX Library: Mixed Integer Programming The CPLEX Library: Mixed Programming Ed Rothberg, ILOG, Inc. 1 The Diet Problem Revisited Nutritional values Bob considered the following foods: Food Serving Size Energy (kcal) Protein (g) Calcium (mg)

More information

Introduction Models of Attack Trees Computational Semantics. Attack Trees. Models and Computation. Jan Willemson, Aivo Jürgenson, Margus Niitsoo

Introduction Models of Attack Trees Computational Semantics. Attack Trees. Models and Computation. Jan Willemson, Aivo Jürgenson, Margus Niitsoo Attack Trees Models and Computation Jan Willemson, Aivo Jürgenson, Margus Niitsoo Cybernetica, Estonia http://www.cybernetica.eu/ January 19th, 2010 University of Luxembourg We will use the basic multi-parameter

More information

What is SSA? each assignment to a variable is given a unique name all of the uses reached by that assignment are renamed

What is SSA? each assignment to a variable is given a unique name all of the uses reached by that assignment are renamed Another Form of Data-Flow Analysis Propagation of values for a variable reference, where is the value produced? for a variable definition, where is the value consumed? Possible answers reaching definitions,

More information

Math Models of OR: Branch-and-Bound

Math Models of OR: Branch-and-Bound Math Models of OR: Branch-and-Bound John E. Mitchell Department of Mathematical Sciences RPI, Troy, NY 12180 USA November 2018 Mitchell Branch-and-Bound 1 / 15 Branch-and-Bound Outline 1 Branch-and-Bound

More information

AI Programming CS S-06 Heuristic Search

AI Programming CS S-06 Heuristic Search AI Programming CS662-2013S-06 Heuristic Search David Galles Department of Computer Science University of San Francisco 06-0: Overview Heuristic Search - exploiting knowledge about the problem Heuristic

More information

Data Mining Classification Trees (2)

Data Mining Classification Trees (2) Data Mining Classification Trees (2) Ad Feelders Universiteit Utrecht September 14, 2017 Ad Feelders ( Universiteit Utrecht ) Data Mining September 14, 2017 1 / 46 Basic Tree Construction Algorithm Construct

More information

CS 188 Introduction to Fall 2007 Artificial Intelligence Midterm

CS 188 Introduction to Fall 2007 Artificial Intelligence Midterm NAME: SID#: Login: Sec: 1 CS 188 Introduction to Fall 2007 Artificial Intelligence Midterm You have 80 minutes. The exam is closed book, closed notes except a one-page crib sheet, basic calculators only.

More information

Allocate-On-Use Space Complexity of Shared-Memory Algorithms

Allocate-On-Use Space Complexity of Shared-Memory Algorithms Allocate-On-Use Space Complexity of Shared-Memory Algorithms James Aspnes Bernhard Haeupler Alexander Tong Philipp Woelfel DISC 2018 Asynchronous shared memory model Processes: p 1 p 2 p 3 p n Objects:

More information

Lecture 10: Gentzen Systems to Refinement Logic CS 4860 Spring 2009 Thursday, February 19, 2009

Lecture 10: Gentzen Systems to Refinement Logic CS 4860 Spring 2009 Thursday, February 19, 2009 Applied Logic Lecture 10: Gentzen Systems to Refinement Logic CS 4860 Spring 2009 Thursday, February 19, 2009 Last Tuesday we have looked into Gentzen systems as an alternative proof calculus, which focuses

More information

Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies

Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies Model Checking, Theorem Proving, and Abstract Interpretation: The Convergence of Formal Verification Technologies Tom Henzinger EPFL Three Verification Communities Model checking: -automatic, but inefficient

More information

CSE 548: Analysis of Algorithms. Lecture 12 ( Analyzing Parallel Algorithms )

CSE 548: Analysis of Algorithms. Lecture 12 ( Analyzing Parallel Algorithms ) CSE 548: Analysis of Algorithms Lecture 12 ( Analyzing Parallel Algorithms ) Rezaul A. Chowdhury Department of Computer Science SUNY Stony Brook Fall 2017 Why Parallelism? Moore s Law Source: Wikipedia

More information

Data Structures in Java

Data Structures in Java Data Structures in Java Lecture 21: Introduction to NP-Completeness 12/9/2015 Daniel Bauer Algorithms and Problem Solving Purpose of algorithms: find solutions to problems. Data Structures provide ways

More information

Reducing the Run-time of MCMC Programs by Multithreading on SMP Architectures

Reducing the Run-time of MCMC Programs by Multithreading on SMP Architectures Reducing the Run-time of MCMC Programs by Multithreading on SMP Architectures Jonathan M. R. Byrd Stephen A. Jarvis Abhir H. Bhalerao Department of Computer Science University of Warwick MTAAP IPDPS 2008

More information

Data Structures and Algorithms " Search Trees!!

Data Structures and Algorithms  Search Trees!! Data Structures and Algorithms " Search Trees!! Outline" Binary Search Trees! AVL Trees! (2,4) Trees! 2 Binary Search Trees! "! < 6 2 > 1 4 = 8 9 Ordered Dictionaries" Keys are assumed to come from a total

More information

Lecture 1 : Data Compression and Entropy

Lecture 1 : Data Compression and Entropy CPS290: Algorithmic Foundations of Data Science January 8, 207 Lecture : Data Compression and Entropy Lecturer: Kamesh Munagala Scribe: Kamesh Munagala In this lecture, we will study a simple model for

More information

Simple Techniques for Improving SGD. CS6787 Lecture 2 Fall 2017

Simple Techniques for Improving SGD. CS6787 Lecture 2 Fall 2017 Simple Techniques for Improving SGD CS6787 Lecture 2 Fall 2017 Step Sizes and Convergence Where we left off Stochastic gradient descent x t+1 = x t rf(x t ; yĩt ) Much faster per iteration than gradient

More information

Swinburne Research Bank

Swinburne Research Bank Swinburne Research Bank http://researchbank.swinburne.edu.au Chen, T. Y., Loon, P. L., & Tse, T. H. (2000). An integrated classification-tree methodology for test case generation. Electronic version of

More information

Adversarial Search. Christos Papaloukas, Iosif Angelidis. University of Athens November 2017

Adversarial Search. Christos Papaloukas, Iosif Angelidis. University of Athens November 2017 Adversarial Search Christos Papaloukas, Iosif Angelidis University of Athens November 2017 Christos P., Iosif A. Adversarial Search UoA, 2017 1 / 61 Main Aspects Formulation In order to perform an Adversarial

More information

Regular tree language recognition with static information

Regular tree language recognition with static information Regular tree language recognition with static information Alain Frisch Département d Informatique École Normale Supérieure, Paris, France Alain.Frisch@ens.fr Abstract This paper presents our compilation

More information

P(t w) = arg maxp(t, w) (5.1) P(t,w) = P(t)P(w t). (5.2) The first term, P(t), can be described using a language model, for example, a bigram model:

P(t w) = arg maxp(t, w) (5.1) P(t,w) = P(t)P(w t). (5.2) The first term, P(t), can be described using a language model, for example, a bigram model: Chapter 5 Text Input 5.1 Problem In the last two chapters we looked at language models, and in your first homework you are building language models for English and Chinese to enable the computer to guess

More information

Introduction to Computer Science and Programming for Astronomers

Introduction to Computer Science and Programming for Astronomers Introduction to Computer Science and Programming for Astronomers Lecture 8. István Szapudi Institute for Astronomy University of Hawaii March 7, 2018 Outline Reminder 1 Reminder 2 3 4 Reminder We have

More information

Final exam of ECE 457 Applied Artificial Intelligence for the Fall term 2007.

Final exam of ECE 457 Applied Artificial Intelligence for the Fall term 2007. Fall 2007 / Page 1 Final exam of ECE 457 Applied Artificial Intelligence for the Fall term 2007. Don t panic. Be sure to write your name and student ID number on every page of the exam. The only materials

More information

Complexity Theory Part I

Complexity Theory Part I Complexity Theory Part I Outline for Today Recap from Last Time Reviewing Verifiers Nondeterministic Turing Machines What does nondeterminism mean in the context of TMs? And just how powerful are NTMs?

More information

CMPUT 675: Approximation Algorithms Fall 2014

CMPUT 675: Approximation Algorithms Fall 2014 CMPUT 675: Approximation Algorithms Fall 204 Lecture 25 (Nov 3 & 5): Group Steiner Tree Lecturer: Zachary Friggstad Scribe: Zachary Friggstad 25. Group Steiner Tree In this problem, we are given a graph

More information

Decision Support. Dr. Johan Hagelbäck.

Decision Support. Dr. Johan Hagelbäck. Decision Support Dr. Johan Hagelbäck johan.hagelback@lnu.se http://aiguy.org Decision Support One of the earliest AI problems was decision support The first solution to this problem was expert systems

More information

Multivalued Decision Diagrams. Postoptimality Analysis Using. J. N. Hooker. Tarik Hadzic. Cork Constraint Computation Centre

Multivalued Decision Diagrams. Postoptimality Analysis Using. J. N. Hooker. Tarik Hadzic. Cork Constraint Computation Centre Postoptimality Analysis Using Multivalued Decision Diagrams Tarik Hadzic Cork Constraint Computation Centre J. N. Hooker Carnegie Mellon University London School of Economics June 2008 Postoptimality Analysis

More information

Exploring Large Digital Library Collections using a Map-based Visualisation

Exploring Large Digital Library Collections using a Map-based Visualisation Exploring Large Digital Library Collections using a Map-based Visualisation Dr Mark Hall Research Seminar, Department of Computing, Edge Hill University 7.11.2013 http://www.flickr.com/photos/carlcollins/199792939/

More information

Announcements. CS 188: Artificial Intelligence Fall Adversarial Games. Computing Minimax Values. Evaluation Functions. Recap: Resource Limits

Announcements. CS 188: Artificial Intelligence Fall Adversarial Games. Computing Minimax Values. Evaluation Functions. Recap: Resource Limits CS 188: Artificial Intelligence Fall 2009 Lecture 7: Expectimax Search 9/17/2008 Announcements Written 1: Search and CSPs is up Project 2: Multi-agent Search is up Want a partner? Come to the front after

More information

Computational Complexity. This lecture. Notes. Lecture 02 - Basic Complexity Analysis. Tom Kelsey & Susmit Sarkar. Notes

Computational Complexity. This lecture. Notes. Lecture 02 - Basic Complexity Analysis. Tom Kelsey & Susmit Sarkar. Notes Computational Complexity Lecture 02 - Basic Complexity Analysis Tom Kelsey & Susmit Sarkar School of Computer Science University of St Andrews http://www.cs.st-andrews.ac.uk/~tom/ twk@st-andrews.ac.uk

More information

Models of Computation,

Models of Computation, Models of Computation, 2010 1 Induction We use a lot of inductive techniques in this course, both to give definitions and to prove facts about our semantics So, it s worth taking a little while to set

More information

CS 188: Artificial Intelligence

CS 188: Artificial Intelligence CS 188: Artificial Intelligence Adversarial Search II Instructor: Anca Dragan University of California, Berkeley [These slides adapted from Dan Klein and Pieter Abbeel] Minimax Example 3 12 8 2 4 6 14

More information

CS 188: Artificial Intelligence Fall Announcements

CS 188: Artificial Intelligence Fall Announcements CS 188: Artificial Intelligence Fall 2009 Lecture 7: Expectimax Search 9/17/2008 Dan Klein UC Berkeley Many slides over the course adapted from either Stuart Russell or Andrew Moore 1 Announcements Written

More information

A Simplified Approach for Testing Real-Time Systems Based on Action Refinement

A Simplified Approach for Testing Real-Time Systems Based on Action Refinement A Simplified Approach for Testing Real-Time Systems Based on Action Refinement Saddek Bensalem, Moez Krichen, Lotfi Majdoub, Riadh Robbana, Stavros Tripakis Verimag Laboratory, Centre Equation 2, avenue

More information

2.6 Complexity Theory for Map-Reduce. Star Joins 2.6. COMPLEXITY THEORY FOR MAP-REDUCE 51

2.6 Complexity Theory for Map-Reduce. Star Joins 2.6. COMPLEXITY THEORY FOR MAP-REDUCE 51 2.6. COMPLEXITY THEORY FOR MAP-REDUCE 51 Star Joins A common structure for data mining of commercial data is the star join. For example, a chain store like Walmart keeps a fact table whose tuples each

More information

Lecture 16 More Profiling: gperftools, systemwide tools: oprofile, perf, DTrace, etc.

Lecture 16 More Profiling: gperftools, systemwide tools: oprofile, perf, DTrace, etc. Lecture 16 More Profiling: gperftools, systemwide tools: oprofile, perf, DTrace, etc. ECE 459: Programming for Performance March 6, 2014 Part I gperftools 2 / 49 Introduction to gperftools Google Performance

More information

Compiling Techniques

Compiling Techniques Lecture 11: Introduction to 13 November 2015 Table of contents 1 Introduction Overview The Backend The Big Picture 2 Code Shape Overview Introduction Overview The Backend The Big Picture Source code FrontEnd

More information

Latches. October 13, 2003 Latches 1

Latches. October 13, 2003 Latches 1 Latches The second part of CS231 focuses on sequential circuits, where we add memory to the hardware that we ve already seen. Our schedule will be very similar to before: We first show how primitive memory

More information

CIS 4930/6930: Principles of Cyber-Physical Systems

CIS 4930/6930: Principles of Cyber-Physical Systems CIS 4930/6930: Principles of Cyber-Physical Systems Chapter 11 Scheduling Hao Zheng Department of Computer Science and Engineering University of South Florida H. Zheng (CSE USF) CIS 4930/6930: Principles

More information

Measurement & Performance

Measurement & Performance Measurement & Performance Timers Performance measures Time-based metrics Rate-based metrics Benchmarking Amdahl s law Topics 2 Page The Nature of Time real (i.e. wall clock) time = User Time: time spent

More information

Measurement & Performance

Measurement & Performance Measurement & Performance Topics Timers Performance measures Time-based metrics Rate-based metrics Benchmarking Amdahl s law 2 The Nature of Time real (i.e. wall clock) time = User Time: time spent executing

More information

Construction of Static Single-Assignment Form

Construction of Static Single-Assignment Form COMP 506 Rice University Spring 2018 Construction of Static Single-Assignment Form Part II source IR IR target code Front End Optimizer Back End code Copyright 2018, Keith D. Cooper & Linda Torczon, all

More information

Chapter 6: Classification

Chapter 6: Classification Chapter 6: Classification 1) Introduction Classification problem, evaluation of classifiers, prediction 2) Bayesian Classifiers Bayes classifier, naive Bayes classifier, applications 3) Linear discriminant

More information

Unit: Blocking Synchronization Clocks, v0.3 Vijay Saraswat

Unit: Blocking Synchronization Clocks, v0.3 Vijay Saraswat Unit: Blocking Synchronization Clocks, v0.3 Vijay Saraswat This lecture discusses X10 clocks. For reference material please look at the chapter on Clocks in []. 1 Motivation The central idea underlying

More information

N H 2 2 NH 3 and 2 NH 3 N H 2

N H 2 2 NH 3 and 2 NH 3 N H 2 Chemical Equilibrium Notes (Chapter 18) So far, we ve talked about all chemical reactions as if they go only in one direction. However, as with many things in life, chemical reactions can go both in the

More information

Points: The first problem is worth 10 points, the others are worth 15. Maximize z = x y subject to 3x y 19 x + 7y 10 x + y = 100.

Points: The first problem is worth 10 points, the others are worth 15. Maximize z = x y subject to 3x y 19 x + 7y 10 x + y = 100. Math 5 Summer Points: The first problem is worth points, the others are worth 5. Midterm # Solutions Find the dual of the following linear programming problem. Maximize z = x y x y 9 x + y x + y = x, y

More information

CSC321 Lecture 20: Reversible and Autoregressive Models

CSC321 Lecture 20: Reversible and Autoregressive Models CSC321 Lecture 20: Reversible and Autoregressive Models Roger Grosse Roger Grosse CSC321 Lecture 20: Reversible and Autoregressive Models 1 / 23 Overview Four modern approaches to generative modeling:

More information

1 Seidel s LP algorithm

1 Seidel s LP algorithm 15-451/651: Design & Analysis of Algorithms October 21, 2015 Lecture #14 last changed: November 7, 2015 In this lecture we describe a very nice algorithm due to Seidel for Linear Programming in lowdimensional

More information

CS261: A Second Course in Algorithms Lecture #12: Applications of Multiplicative Weights to Games and Linear Programs

CS261: A Second Course in Algorithms Lecture #12: Applications of Multiplicative Weights to Games and Linear Programs CS26: A Second Course in Algorithms Lecture #2: Applications of Multiplicative Weights to Games and Linear Programs Tim Roughgarden February, 206 Extensions of the Multiplicative Weights Guarantee Last

More information

Decision Tree Learning Mitchell, Chapter 3. CptS 570 Machine Learning School of EECS Washington State University

Decision Tree Learning Mitchell, Chapter 3. CptS 570 Machine Learning School of EECS Washington State University Decision Tree Learning Mitchell, Chapter 3 CptS 570 Machine Learning School of EECS Washington State University Outline Decision tree representation ID3 learning algorithm Entropy and information gain

More information

Lecture 13. Real-Time Scheduling. Daniel Kästner AbsInt GmbH 2013

Lecture 13. Real-Time Scheduling. Daniel Kästner AbsInt GmbH 2013 Lecture 3 Real-Time Scheduling Daniel Kästner AbsInt GmbH 203 Model-based Software Development 2 SCADE Suite Application Model in SCADE (data flow + SSM) System Model (tasks, interrupts, buses, ) SymTA/S

More information

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara

UC Santa Barbara. Operating Systems. Christopher Kruegel Department of Computer Science UC Santa Barbara Operating Systems Christopher Kruegel Department of Computer Science http://www.cs.ucsb.edu/~chris/ Many processes to execute, but one CPU OS time-multiplexes the CPU by operating context switching Between

More information

ITI Introduction to Computing II

ITI Introduction to Computing II (with contributions from R. Holte) School of Electrical Engineering and Computer Science University of Ottawa Version of January 11, 2015 Please don t print these lecture notes unless you really need to!

More information

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata CISC 4090: Theory of Computation Chapter Regular Languages Xiaolan Zhang, adapted from slides by Prof. Werschulz Section.: Finite Automata Fordham University Department of Computer and Information Sciences

More information

.Cycle counting: the next generation. Matthew Skala 30 January 2013

.Cycle counting: the next generation. Matthew Skala 30 January 2013 .Cycle counting: the next generation δ ζ µ β ι θ γ η ε λ κ σ ρ α o Matthew Skala 30 January 2013 Outline Cycle counting ECCHI Knight s Tours Equivalent circuits The next generation Cycle counting Let G

More information

Trustworthy, Useful Languages for. Probabilistic Modeling and Inference

Trustworthy, Useful Languages for. Probabilistic Modeling and Inference Trustworthy, Useful Languages for Probabilistic Modeling and Inference Neil Toronto Dissertation Defense Brigham Young University 2014/06/11 Master s Research: Super-Resolution Toronto et al. Super-Resolution

More information

Lecture 9 Synthesis of Reactive Control Protocols

Lecture 9 Synthesis of Reactive Control Protocols Lecture 9 Synthesis of Reactive Control Protocols Nok Wongpiromsarn Singapore-MIT Alliance for Research and Technology Richard M. Murray and Ufuk Topcu California Institute of Technology EECI, 16 May 2012

More information

How to work out really complicated motion. Iteration and Problem Solving Strategies. Let s go. Vertical spring-mass.

How to work out really complicated motion. Iteration and Problem Solving Strategies. Let s go. Vertical spring-mass. Iteration and Problem Solving Strategies How to solve anything! How to work out really complicated motion Break it up into little tiny steps. Use an approximate method for each step. Add them all up. Vertical

More information

CS224W: Social and Information Network Analysis Jure Leskovec, Stanford University

CS224W: Social and Information Network Analysis Jure Leskovec, Stanford University CS224W: Social and Information Network Analysis Jure Leskovec, Stanford University http://cs224w.stanford.edu 10/24/2012 Jure Leskovec, Stanford CS224W: Social and Information Network Analysis, http://cs224w.stanford.edu

More information

algorithms Alpha-Beta Pruning and Althöfer s Pathology-Free Negamax Algorithm Algorithms 2012, 5, ; doi: /a

algorithms Alpha-Beta Pruning and Althöfer s Pathology-Free Negamax Algorithm Algorithms 2012, 5, ; doi: /a Algorithms 01, 5, 51-58; doi:10.3390/a504051 Article OPEN ACCESS algorithms ISSN 1999-4893 www.mdpi.com/journal/algorithms Alpha-Beta Pruning and Althöfer s Pathology-Free Negamax Algorithm Ashraf M. Abdelbar

More information

Page 1. Evolutionary Trees. Why build evolutionary tree? Outline

Page 1. Evolutionary Trees. Why build evolutionary tree? Outline Page Evolutionary Trees Russ. ltman MI S 7 Outline. Why build evolutionary trees?. istance-based vs. character-based methods. istance-based: Ultrametric Trees dditive Trees. haracter-based: Perfect phylogeny

More information

CS 662 Sample Midterm

CS 662 Sample Midterm Name: 1 True/False, plus corrections CS 662 Sample Midterm 35 pts, 5 pts each Each of the following statements is either true or false. If it is true, mark it true. If it is false, correct the statement

More information

Advanced Implementations of Tables: Balanced Search Trees and Hashing

Advanced Implementations of Tables: Balanced Search Trees and Hashing Advanced Implementations of Tables: Balanced Search Trees and Hashing Balanced Search Trees Binary search tree operations such as insert, delete, retrieve, etc. depend on the length of the path to the

More information

Search and Lookahead. Bernhard Nebel, Julien Hué, and Stefan Wölfl. June 4/6, 2012

Search and Lookahead. Bernhard Nebel, Julien Hué, and Stefan Wölfl. June 4/6, 2012 Search and Lookahead Bernhard Nebel, Julien Hué, and Stefan Wölfl Albert-Ludwigs-Universität Freiburg June 4/6, 2012 Search and Lookahead Enforcing consistency is one way of solving constraint networks:

More information

Sequential Logic (3.1 and is a long difficult section you really should read!)

Sequential Logic (3.1 and is a long difficult section you really should read!) EECS 270, Fall 2014, Lecture 6 Page 1 of 8 Sequential Logic (3.1 and 3.2. 3.2 is a long difficult section you really should read!) One thing we have carefully avoided so far is feedback all of our signals

More information

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements

Axiomatic Semantics: Verification Conditions. Review of Soundness and Completeness of Axiomatic Semantics. Announcements Axiomatic Semantics: Verification Conditions Meeting 12, CSCI 5535, Spring 2009 Announcements Homework 4 is due tonight Wed forum: papers on automated testing using symbolic execution 2 Questions? Review

More information