External Memory Value Iteration Stefan Edelkamp, Shahid Jabbar Chair for Programming Systems, University of Dortmund, Germany Blai Bonet Departamento de.

Slides:



Advertisements
Similar presentations
Heuristics, and what to do if you dont know what to do Carl Hultquist.
Advertisements

Models of Computation Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms Week 1, Lecture 2.
Markov Decision Processes (MDPs) read Ch utility-based agents –goals encoded in utility function U(s), or U:S  effects of actions encoded in.
Sorting Really Big Files Sorting Part 3. Using K Temporary Files Given  N records in file F  M records will fit into internal memory  Use K temp files,
Markov Decision Process
PROBLEM SOLVING AND SEARCH
CSCI 5582 Fall 2006 CSCI 5582 Artificial Intelligence Lecture 4 Jim Martin.
Solving Problem by Searching
Accelerating External Search with Bitstate Hashing Stefan Edelkamp Shahid Jabbar Computer Science Department University of Dortmund, Dortmund, Germany.
Markov Decision Process (MDP)  S : A set of states  A : A set of actions  P r(s’|s,a): transition model (aka M a s,s’ )  C (s,a,s’): cost model  G.
Problem Solving Agents A problem solving agent is one which decides what actions and states to consider in completing a goal Examples: Finding the shortest.
Solving Problems by Searching Currently at Chapter 3 in the book Will finish today/Monday, Chapter 4 next.
Dynamic State-Space Partitioning in External-Memory Graph Search Rong Zhou † and Eric A. Hansen ‡ † Palo Alto Research Center ‡ Mississippi State University.
Uninformed Search Jim Little UBC CS 322 – Search 2 September 12, 2014
External Sorting “There it was, hidden in alphabetical order.” Rita Holt R&G Chapter 13.
CPSC 322, Lecture 4Slide 1 Search: Intro Computer Science cpsc322, Lecture 4 (Textbook Chpt ) January, 12, 2009.
Database Management Systems, R. Ramakrishnan and J. Gehrke1 Query Evaluation Chapter 11 External Sorting.
CS 153 Design of Operating Systems Spring 2015
Artificial Intelligence
CPSC 322, Lecture 12Slide 1 CSPs: Search and Arc Consistency Computer Science cpsc322, Lecture 12 (Textbook Chpt ) January, 29, 2010.
External Sorting R & G Chapter 13 One of the advantages of being
External Sorting R & G Chapter 11 One of the advantages of being disorderly is that one is constantly making exciting discoveries. A. A. Milne.
CPSC 231 Sorting Large Files (D.H.)1 LEARNING OBJECTIVES Sorting of large files –merge sort –performance of merge sort –multi-step merge sort.
Uninformed Search Reading: Chapter 3 by today, Chapter by Wednesday, 9/12 Homework #2 will be given out on Wednesday DID YOU TURN IN YOUR SURVEY?
Computer Organization and Architecture
CS294-6 Reconfigurable Computing Day 16 October 15, 1998 Retiming.
External Sorting 198:541. Why Sort?  A classic problem in computer science!  Data requested in sorted order e.g., find students in increasing gpa order.
CS121 Heuristic Search Planning CSPs Adversarial Search Probabilistic Reasoning Probabilistic Belief Learning.
External Memory Algorithms Kamesh Munagala. External Memory Model Aggrawal and Vitter, 1988.
More Graph Algorithms Weiss ch Exercise: MST idea from yesterday Alternative minimum spanning tree algorithm idea Idea: Look at smallest edge not.
External Sorting Chapter 13.. Why Sort? A classic problem in computer science! Data requested in sorted order  e.g., find students in increasing gpa.
Chapter 3 Memory Management: Virtual Memory
Keyword Search on External Memory Data Graphs Bhavana Bharat Dalvi, Meghana Kshirsagar, S. Sudarshan PVLDB 2008 Reported by: Yiqi Lu.
X-Stream: Edge-Centric Graph Processing using Streaming Partitions
Distributed Verification of Multi-threaded C++ Programs Stefan Edelkamp joint work with Damian Sulewski and Shahid Jabbar.
Probabilistic Roadmaps for Path Planning in High-Dimensional Configuration Spaces (1996) L. Kavraki, P. Švestka, J.-C. Latombe, M. Overmars.
Cost-Optimal Symbolic Pattern Database Planning with State Trajectory and Preference Constraints Stefan Edelkamp University of Dortmund.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 External Sorting Chapter 13.
External Storage Primary Storage : Main Memory (RAM). Secondary Storage: Peripheral Devices –Disk Drives –Tape Drives Secondary storage is CHEAP. Secondary.
Search exploring the consequences of possible actions.
Real-Time Model Checking on Secondary Storage Stefan Edelkamp and Shahid Jabbar Chair for Programming Systems and Compiler Construction Computer Science.
External Program Model Checking Stefan Edelkamp, Shahid Jabar, Dino Midzic, Daniel Rikowski and Damian Sulewski Computer Science Department University.
Lecture 3: Uninformed Search
Cost-Optimal Planning with Constraints and Preferences in Large State Spaces Stefan Edelkamp, Shahid Jabbar, Mohammed Nazih University of Dortmund.
Search CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Parallel External Directed Model Checking with Linear I/O Shahid Jabbar Stefan Edelkamp Computer Science Department University of Dortmund, Dortmund, Germany.
Computer Science CPSC 322 Lecture 6 Iterative Deepening and Search with Costs (Ch: 3.7.3, 3.5.3)
External A* Stefan Edelkamp, Shahid Jabbar (ich) University of Dortmund, Germany and Stefan Schrödl (DaimlerChrysler, CA)
I/O Efficient Directed Model Checking Shahid Jabbar and Stefan Edelkamp, Computer Science Department University of Dortmund, Germany.
CPSC 322, Lecture 6Slide 1 Uniformed Search (cont.) Computer Science cpsc322, Lecture 6 (Textbook finish 3.5) Sept, 17, 2012.
Ch. 3 – Search Supplemental slides for CSE 327 Prof. Jeff Heflin.
Introduction to Database Systems1 External Sorting Query Processing: Topic 0.
Fahiem Bacchus © 2005 University of Toronto 1 CSC384: Intro to Artificial Intelligence Search II ● Announcements.
Database Management Systems 3ed, R. Ramakrishnan and J. Gehrke1 External Sorting Chapters 13: 13.1—13.5.
CPSC 322, Lecture 5Slide 1 Uninformed Search Computer Science cpsc322, Lecture 5 (Textbook Chpt 3.5) Sept, 13, 2013.
Large Scale External Directed Liveness Checking Stefan Edelkamp Shahid Jabbar Computer Science Department University of Dortmund, Dortmund, Germany.
External Sorting. Why Sort? A classic problem in computer science! Data requested in sorted order –e.g., find students in increasing gpa order Sorting.
External Sorting Jianlin Feng School of Software SUN YAT-SEN UNIVERSITY courtesy of Joe Hellerstein for some slides.
William Stallings Computer Organization and Architecture
Hash-Based Indexes Chapter 11
Query Processing in Databases Dr. M. Gavrilova
External Sorting The slides for this text are organized into chapters. This lecture covers Chapter 11. Chapter 1: Introduction to Database Systems Chapter.
Hash-Based Indexes Chapter 10
Selected Topics: External Sorting, Join Algorithms, …
Artificial Intelligence Chapter 10 Planning, Acting, and Learning
Evaluation of Relational Operations: Other Techniques
External Sorting.
Artificial Intelligence Chapter 10 Planning, Acting, and Learning
External Sorting Dina Said
Presentation transcript:

External Memory Value Iteration Stefan Edelkamp, Shahid Jabbar Chair for Programming Systems, University of Dortmund, Germany Blai Bonet Departamento de Computacion Universidad Simon Bolivar, Caracas, Venezuela

External Memory Value Iteration Edelkamp, Jabbar & Bonet 2 Motivation: Reinforcement Learning Aim: Write Controller to act successfully in the environment  Minimize Cost/Maximize Rewards Agent Environment atat ctct stst

External Memory Value Iteration Edelkamp, Jabbar & Bonet 3 Motivation: External Reinforcement Learning Cover deterministic, non-deterministic, probabilistic environments (and games) But what to do, if the agent’s state space or policy space is too large to be computed and stored in RAM? Disk Space is Cheap (500 GB ~ 100$)  External Memory Algorithm

External Memory Value Iteration Edelkamp, Jabbar & Bonet 4 Overview Uniform Search Model Internal Memory Value Iteration Existing External Model and BFS External Memory Value Iteration Experimental Highlights Summary & Outlook

External Memory Value Iteration Edelkamp, Jabbar & Bonet 5 Overview Uniform Search Model Internal Memory Value Iteration Existing External Model and BFS External Memory Value Iteration Experimental Highlights Summary & Outlook

External Memory Value Iteration Edelkamp, Jabbar & Bonet 6 Uniform Search Modell: Deterministic Non-Deterministic Probabilistic

External Memory Value Iteration Edelkamp, Jabbar & Bonet 7 Overview Uniform Search Model Internal Memory Value Iteration Existing External Model and BFS External Memory Value Iteration Experimental Highlights Summary & Outlook

External Memory Value Iteration Edelkamp, Jabbar & Bonet 8 ε-Optimal for solving MDPs, AND/OR trees… Problem: Needs to have the whole state space in the main memory.

External Memory Value Iteration Edelkamp, Jabbar & Bonet 9 Why External Memory Algorithms ? Search algorithms perform well as long as they consume RAM only! Virtual memory slows down the performance! 0x000…000 0xFFF…FFF Virtual Address Space Memory Page 7 I/Os

External Memory Value Iteration Edelkamp, Jabbar & Bonet 10 Overview Uniform Search Model Internal Memory Value Iteration Existing External Memory Model and BFS External Memory Value Iteration Experimental Highlights Summary & Outlook

External Memory Value Iteration Edelkamp, Jabbar & Bonet 11 External Memory Model [Vitter and Shriver, 94] M If the input size is very large, running time depends on the I/Os rather than on the number of instructions. Input of size N >> M B

External Memory Value Iteration Edelkamp, Jabbar & Bonet 12 External Breadth-First Search (Munagala and Ranade, SODA’99) A D C B E A Open (0) A A D D E External Sort Open (2) A D E Compact Open (2) D E Remove Duplicates w.r.t 2 previous layers Open (2) B C Open (1) D A A D E For undirected graphs, subtracting two layers is enough [Munagala & Ranade, 99]. For directed graphs, the longest back-edge has to be taken into account [Zhou & Hansen, 05].

External Memory Value Iteration Edelkamp, Jabbar & Bonet 13 External Memory Algorithms for Implicit Graphs Frontier Search [Korf, 03] External A* [Edelkamp, Jabbar, Schrödl, 04] Structured Duplicate Detection [Zhou & Hansen, 04]. Cost-Optimal External Planning [Edelkamp, Jabbar, 06] Model Checking for Linear Temporal Logic  [Jabbar & Edelkamp, 05] for safety error detection  [Edelkamp & Jabbar, 06] for liveness detection (cycle)  [Barnat, Brim, Simecek, 07] for liveness detection (cycle) Real-Time Model Checking/Scheduling [Edelkamp, Jabbar, 06]

External Memory Value Iteration Edelkamp, Jabbar & Bonet 14 Overview Uniform Search Model Internal Memory Value Iteration Existing External Memory Model and BFS External Memory Value Iteration Experimental Highlights Summary & Outlook

External Memory Value Iteration Edelkamp, Jabbar & Bonet 15 External Memory Algorithm for Value Iteration What makes value iteration different from the usual external memory search algorithms? Answer:  Propagation of information from states to predecessors!  Edges are more important than the states. Ext-VI works on Edges:

External Memory Value Iteration Edelkamp, Jabbar & Bonet 16 External Memory Value Iteration Phase I: Generate the edge space by External BFS. Open(0) = Init; i = -1 while (Open(i-1) != empty )  Open(i) = Succ(Open(i-1))  Externally-Sort-and-Remove-Duplicates(Open(i))  for loc = 1 to Locality(Graph) Open(i) = Open(i) \ Open(i - loc)  i++ endwhile Merge all BFS layers into one edge list on disk! Open t = Open(0) U Open(1) U … U Open(DIAM) Temp = Open t Sort Open t wrt. the successors; Sort Temp wrt. the predecessors Remove previous layers

External Memory Value Iteration Edelkamp, Jabbar & Bonet 17 Working of Ext-VI Phase-II {(Ø, 1), (1,2), (1,3), (1,4), (2,3), (2,5), (3,4), (3,8), (4,6), (5,6), (5,7), (6,9), (7,8), (7,10), (9,8), (9,10)} {(Ø,1), (1,2), (1,3), (2,3), (1,4), (3,4), (2,5), (4,6), (5,6), (5,7), (3,8), (7,8), (9,8), (6,9), (7,10), (9,10)} ITT h= Temp : Edge List on Disk – Sorted on Predecessors Open t : Edge List on Disk – Sorted on Successors h= h’= Alternate sorting and update until residual < epsilon

External Memory Value Iteration Edelkamp, Jabbar & Bonet 18 Complexity Analysis Phase-I: External Memory Breadth-First Search. Expansion:  Scanning the red bucket: O(scan(|E|)) Duplicates Removal:  Sorting the green bucket having one state for every edge from the red bucket.  Scanning and compaction. O(sort(|E|)) Subtraction:  Removing states of blue buckets (duplicates free) from the green one. O(l x scan(|E|)) Complexity of Phase-I: O(l x scan(|E|) + sort(|E|) ) I/Os ………………

External Memory Value Iteration Edelkamp, Jabbar & Bonet 19 Complexity Analysis Phase-II: Backward Update Update:  Simple block-wise scanning.  Scanning time for red and green files: O(scan(|E|)) I/Os External Sort:  Sorting the blue file with the updated values to be used as red file later: O(sort(|E|)) I/Os Fast External Sort:  If |E| / M < Max file pointers  O(scan(|E|)) I/Os Total Complexity of Phase-II: For t max iterations, O( t max x sort(|E|)) I/Os With Fast External Sort: O( t max x scan(|E|)) I/Os Sorted on preds Sorted on states Updated h-values ………

External Memory Value Iteration Edelkamp, Jabbar & Bonet 20 Overview Uniform Search Model Internal Memory Value Iteration Existing External Model and BFS External Memory Value Iteration Experimental Highlights Summary & Outlook

External Memory Value Iteration Edelkamp, Jabbar & Bonet 21 Experiments: 3x3 Sliding Tiles Puzzle p=1.0; heuristic = 0 Alg.|S|/|E|RAM#IterationsTime VI181,44021M276.3 Ext-VI483,83911M p=0.9; heuristic = Manhattan distance Alg.|S|/|E|RAM#IterationsTime VI181,44021M358.3 Ext-VI967,67712M Number of Iterations differ!!

External Memory Value Iteration Edelkamp, Jabbar & Bonet 22 3x4 Sliding Tile Puzzle with p=0.9 (State space: 12!/2 = 239 x 10 6 ) On 2 Gigabytes, VI could not generate the state space. External VI Finished:  Took 45 GB of disk space for the edges.  Total 1,357,171,197 edges.  Took 437 hours and 72 iterations to converge.  ε = RAM used: 1.4 Gigabytes

External Memory Value Iteration Edelkamp, Jabbar & Bonet 23 Race Track Domain Example Alg.150x300 RaceTrack VIOut of mem. > 2GB LRTDPOut of mem. >2 GB; 12 hours LDFSOut of time >1.5 GB; 118 hours Ext-VIConverged! 1.6GB; 91 hours

External Memory Value Iteration Edelkamp, Jabbar & Bonet 24 Overview Uniform Search Model Internal Memory Value Iteration Existing External Model and BFS External Memory Value Iteration Experimental Highlights Summary & Outlook

External Memory Value Iteration Edelkamp, Jabbar & Bonet 25 Summary Achievements First I/O efficient disk-based algorithm for solving Markov Decision Processes. I/O Complexity Analysis. Features General Cost Model Can Pause-and-Resume Execution to add more Hard Disks. Refinements Disk Space eaten by Duplicate States:  Start “Early” Delayed Duplicate Detection

External Memory Value Iteration Edelkamp, Jabbar & Bonet 26 Outlook Application to Bellman-Ford Parallel External Value Iteration: During the time of internal update, hard disk is not in use..

Thank You! Questions ?