670 likes | 773 Views
Search-based Optimization of Cyber-Physical System Software Deployment & Configuration. Dr. Christopher Jules White jules@dre.vanderbilt.edu www.dre.vanderbilt.edu/~jules/ Research Assistant Professor Vanderbilt University Nashville, Tennessee.
E N D
Search-based Optimization of Cyber-Physical System SoftwareDeployment & Configuration Dr. Christopher Jules White jules@dre.vanderbilt.edu www.dre.vanderbilt.edu/~jules/ Research Assistant Professor Vanderbilt University Nashville, Tennessee Presented at the University of Alabama, Birmingham, February 2nd, 2009 • Sponsors: NSF, Air Force Research Lab, Lockheed Martin Advanced Technology Lab, Raytheon, & Siemens Corporate Research
Cyber-Physical Systems & Quality of Service • A Cyber-Physical System (CPS) involves close coordination between the system's computational & physical elements • CPS applications areessential in mission- & safety-critical domains, such as aerospace, automotive, chemical processes, civil infrastructure, energy, entertainment, healthcare, manufacturing, & transportation • CPS applications must adhere to complex sets of Quality of Service (QoS) constraints, such as real-time scheduling, to ensure safety & efficiency
QoS Constraints Make Manual CPS Design Hard Safety Constraints Fault-tolerance Constraints Resource Constraints Real-time Scheduling Constraints Cost Constraints • A key problem in developing CPS systems is that the large number of stringent QoS constraints & the need for optimization make it hard for developers to manually find valid/optimized design solutions • We need intelligent modeling & automation techniques to help developers find solutions to these hard CPS design problems
Open Deployment & Configuration Problems in CPS Automated Software Configuration Software Configuration Constraints Resource Constraints Cost Constraints Problem 1 Problem 2 Problem 3 • Problem 1: How to automate the configuration of software components to meet resource constraints & optimize a linear function at scale? • (Past Work)
Open Deployment & Configuration Problems in CPS Fault-tolerance Constraints Resource Constraints Real-time Scheduling Constraints Cost Constraints Problem 1 Problem 2 Problem 3 • Problem 2: How can the software deployment to processors in CPS be automated & optimized at scale? • (Ongoing / Emerging Work)
Open Deployment & Configuration Problems in CPS Resource Constraints Real-time Scheduling Constraints Cost Constraints Problem 1 Problem 2 Problem 3 • Problem 3: How can the software deployment & configuration be optimized in tandem to meet real-time scheduling, resource, & fault-tolerance constraints? • (Future Work)
Summary of My Research Area Search-based Automation Software Deployment & Configuration at Scale Modeling My work focuses on using modeling & search-based automation to decrease the complexity of CPS software deployment & configuration My work spans the gamut of theory, tools, & experimentation “at scale”
Open Deployment & Configuration Problems in CPS Automated Software Configuration Software Configuration Constraints Resource Constraints Cost Constraints Problem 1 Problem 2 Problem 3 • Problem 1: How to automate the configuration of software components to meet resource constraints & optimize a linear function at scale? • (Past Work)
Automated Feature Model Configuration SPLs for CPS Feature Models Problem 1: Goal Roadmap Goal: Help designers automate the completion of partial software configurations for large-scale systems Context: CPS Software Product Lines Challenges Solution Evaluation Goal CPS Configuration
Problem 1: Automated CPS Software Configuration Feature Models CPS Conf CPS SPLs Automated Conf. Poor Deployment & Configuration Good Deployment & Configuration • Key Challenges • CPS applications can have 100s to 1,000s of components& constraints making finding ANYvalid configuration hard • Optimization is critical, e.g., differences of a few $$$ can translate into millions of $$$ in additional costs or drastic differences in QoS • The configurationcan have a substantial impact on QoS
Software Product-lines Feature Models CPS Conf CPS SPLs Automated Conf. Conf. 3 Conf. 2 Software Product Line Configuration 1 • Software Product Lines (SPLs) create software that can be reconfigured for new requirement sets • The configuration rules for the software are capture in a model • Development is done via configuration rather than coding or ad hoc reuse
Feature Model: Configuration Grammar Feature Models CPS Conf CPS SPLs Automated Conf. Automobile Variability in a Feature Model • Feature Models have become a widely accepted modeling standardto specify SPL configuration rules • Software variabilities & increments of functionality are modeled as features • Feature models are a tree-like arrangement of features & constraints between features • Configurations of SPL variants are described as feature selections
Goal: Helping Designers via Configuration Automation Feature Models CPS Conf CPS SPLs Automated Conf. Goal: Automation selects the remaining 980+ features • User manually selects desired features • User specifies key constraints that must be adhered to, such as resource limits • Intelligent automation determines how to optimize the selection of the remaining features & adhere to constraints The user selects the 20 important features
CPS Scale Multiple Models Mixed Constraints New Heuristic Alg. Needed CSP Limitations Problem 1: Challenge Roadmap Challenges: Configuration scale Multiple models Mixed resource & configuration constraints Limitations of Existing Solutions Challenges Solution Evaluation Goal
Challenge 1.1: Scalable Automated Configuration CPS Scale Multiple Models Mixed Constraints New Heuristic Alg. Needed CSP Limitations Automobile feature model has 1,000s of features & memory + cost constraints Automobile Software ~5K Features • Selecting a valid set of features that satisfies a resource constraint is NP-Hard • It is estimated that current cell phones have 1 million lines of code • Automobiles are estimated to have 100’s of millions of lines of codes • Defense system software repositories are also growing dramatically Large-scale problems most need automation to reduce complexity!
Challenge 1.2: Multi-model Automated Configuration CPS Scale Multiple Models Mixed Constraints New Heuristic Alg. Needed CSP Limitations ….. Brake Controller GPS Navigation • In production CPS environments, the problem is even harder: • We have multiple independent applications sharing the same resources, such as memory • Each application is represented by an independent feature model • The feature selections across all feature models must satisfy the resource constraints
CPS Scale Multiple Models Mixed Constraints New Heuristic Alg. Needed CSP Limitations Challenge 1.3: Mixed Resource/Configuration • Can we just turn this into a knapsack problem? • …or bin-packing? • Feature selection with resource constraints is NP-hard Knapsack
Existing Work: CSP-based Automated Configuration CPS Scale Multiple Models Mixed Constraints New Heuristic Alg. Needed CSP Limitations CSP Solver Existing Approaches: • Feature models mapped to Constraint Satisfaction Problems (CSPs) • Partial configurations represented as a partial labeling of the CSP variables • A CSP solver is used to autonom-ously complete partial configuration Jules White et al., Constraint-based Model Weaving, Springer Transactions on Aspect-Oriented Programming Special Issue on Aspects & Model-Driven Engineering, 39pgs., (to appear) Jules White et al., Automated Diagnosis of Product-line Configuration Errors in Feature Models, Software Product Lines Conference (SPLC), 10pgs., September, 2008, Limmerick, Ireland (30% Acceptance Rate), ***Received the Best Paper Award*** Automated Configuration Choices
CSP Approaches Don’t Scale to Emerging CPS CPS Scale Multiple Models Mixed Constraints New Heuristic Alg. Needed CSP Limitations CSP approaches can top out around ~150 features for tough configuration problems with resource constraints We want techniques to handle 1,000’s of features! CSP There are 100,000,000,000,000 possible configurations for this example
Transform to MMKP MMKP Set Construction Set Aggregation Problem 1: Solution Roadmap Solution Approach: Transform feature configuration problems with resource constraints into multi-dimensional multiplechoice knapsack problems Benefits: Ability to apply scalable polynomial-time heuristic algorithms & aggregate sets for multiple models Challenges Solution Evaluation Goal Set Population FCF Alg.
Transform to MMKP MMKP Set Construction Set Aggregation Solution Approach: Filtered Cartesian Flattening Set Population FCF Alg. • Our solution approach is called Filtered Cartesian Flattening (FCF): • We reduce the feature model to the less constrained Multidimensional Multiple-choice Knapsack Problem (MMKP) • We use an MMKP heuristic algorithm to solve • We translate the MMKP solution into a feature model configuration
Transform to MMKP MMKP Set Construction Set Aggregation Overview of MMKP Set Population FCF Alg. • Divides items into sets & requires choosing exactly one item from each set • Challenge 1 Solution There are excellent polynomial-time MMKP algs • Challenge 2 Solution MMKP mixes resource & configuration constraints
Transform to MMKP MMKP Set Construction Set Aggregation Simplify by Converting FM to MMKP Sets/Items Set Population FCF Alg. • We simplify the configuration problem by converting to an MMKP • To convert to MMKP, we create a series of MMKP sets, such that • The items in the sets represent partial feature model configurations • The partial configurations are divided into sets such that choosing one configuration from each set always results in a complete & valid configuration
Transform to MMKP MMKP Set Construction Set Aggregation Flattening/Filtering (Compilation) Set Population FCF Alg. Set { (Euclidean,PCA,Face..), (MahCosine,PCA,Face..), (IdaSoft,LDA,Face..), …. } • We create the items & sets by enumerating the possible configurations of subtrees • A state explosion occurs as we flatten the subtrees by enumerating the configurations • We bound the number of items per set: • A heuristic (filter) is used to select items when the bound is exceeded • We calculated value/resource consumption & took the top 2,000 partial configurations
Transform to MMKP MMKP Set Construction Set Aggregation Simplify Multi-Model Configuration with MMKP Set Population FCF Alg. ….. Brake Controller Infotainment System GPS Navigation • Challenge 3 Solution Multiple feature models can be merged into the same MMKP problem by collecting their MMKP sets
Problem 1: Evaluation Evaluation: Empirically demonstrate that FCF can configure feature models far beyond the scale of standard CSP techniques Challenges Solution Evaluation Goal
FCF Scalability Validation CSP technique FCF can scale up to problems CSP can’t handle & is fast (10s ms)
FCF Scales to Models with 1,000 Features Models with 1,000 features configured in ~1s
FCF Scales to Models with 10,000 Features Models with 10,000 features configured in 1-12s
FCF Provides “Configuration Assistant” Results: • A developer can use FCF to rapidly analyze different configuration alternatives • What configuration minimizes memory while adding infotainment capabilities? • Is it possible to find a configuration that includes ABS Brake Controllers for less than X$? • Software configurations are generated in seconds rather than hours, days, etc. The FCF automation acts as a design assistant for the developer
FCF Provides “Configuration Assistant” Publications: Jules White et al, Using Filtered Cartesian Flattening & Microrebooting to Build Enterprise Applications with Self-adaptive Healing, Software Engineering for Self-Adaptive Systems, 2009 (to appear) Jules White et al, Filtered Cartesian Flattening: An Approximation Technique for Optimally Selecting Features while Adhering to Resource Constraints, First International Workshop on Analyses of Software Product Lines at the 12th International Software Product Line Conference, Limerick, Ireland, September 12, 2008 Jules White et al, Selecting Highly Optimal Architectural Feature Sets with Filtered Cartesian Flattening, Journal of Software & Systems Special Issue on Design Decisions & Design Rationale in Software Architecture (Submitted) The FCF automation acts as a design assistant for the developer
Open Deployment & Configuration Problems in CPS Fault-tolerance Constraints Resource Constraints Real-time Scheduling Constraints Cost Constraints Problem 1 Problem 2 Problem 3 • Problem 2: How can the software deployment to processors in CPS be automated & optimized at scale? • (Ongoing / Emerging Work)
Problem 2: Goal Goal: Help designers automate the deployment of software to hardware processors to minimize hardware footprint & network bandwidth consumption Impact: Reduced cost, power consumption, weight, maintenance Challenges Solution Evaluation Goal
Goal: Optimized Software Deployment How do we minimize hardware infrastructure needed to support software configuration? • Goal • Find a deployment that minimizes the number of required processors • In planes, each 1lb of processing infrastructure adds 4lbs of supporting infrastructure as well as power, cost, & maintenance complexity to the system • Find a deployment of the software to hardware that minimizes network load
Multiple Constraints Network Opt. Problem 2: Challenge Roadmap Challenges: Multiple constraint types Need for network bandwidth optimization Limitations of Existing Solutions Challenges Solution Evaluation Goal
Challenge 2.1: Mixed Constraint Bin-packing Most resource constrained deployment problems are modeled as bin-packing problems Bin-packing algorithms do not simultaneously handle real-time scheduling, co-location, bin restriction, & resource constraints Existing Approaches: • Bin-packing for multiprocessor scheduling (real-time scheduling & resource constraints) • Bin-packing for memory constraints (resource constraints) • CSP deployment models (exponential algorithms) Bin-packing models CPUs as bins but cannot handle all constraint types Multiple Constraints Network Opt.
Challenge 2.2: Network Bandwidth Optimization Multiple Constraints Network Opt. Bin-packing does not optimize for network bandwidth usage Bin-packing algorithms do not perform network bandwidth optimization Existing Approaches: • Bin-packing with partitioning (subdivides components for network optimization – different problem) • Mapping Task-Graphs using Integer Programming (exponential algorithms) • CSPdeployment models (exponential algorithms) Network
New Bin-packing Alg. PSO Particle Positions Flight Plan Guardrail Problem 2: Solution Roadmap Solution Approach: Combine hybrid heuristic bin-packing with particle swarm optimization Benefits: Reduced weight, cost, power consumption, fuel consumption, etc. for CPS Challenges Solution Evaluation Goal PSO Seeding
PSO Particle Positions PSO Seeding Guardrail 2.1 Approach: Black Box Bin-packing New Bin-packing We developed a first-fit hybrid bin-packing constraint propagation algorithm Solution Approach: • *fits* is a pluggable black box function • Items are sorted in increasing order according to the number of bins they will fit into • Items are placed using a first-fit policy • Remaining items are resorted after each item placement Publications: Brian Dougherty, Jules White, JaiganeshBalasubramanian, Chris Thompson, and Douglas C. Schmidt, Deployment Automation with BLITZ, 31st International Conference on Software Engineering, May 16-24, 2009 Vancouver, Canada An item *fits* into a bin if it is schedulable using response time analysis or Liu & Layland, does not exceed resource limits, & does not violate constraints in the constraint network
PSO Particle Positions PSO Seeding Guardrail Bin-packer Constraint Extensibility New Bin-packing Solution Approach: • *fits* is a pluggable black box function The bin-packing heuristic is based on: • A first-fit packing policy • Sorting items based on the number of available bins they could fit into *fits* can be modified to incorporate new constraint types without affecting the core heuristics *Fits* can be modified to use domain-specific constraints like “it fits if the processor is 21 inches from the perimeter of the car”
PSO Particle Positions PSO Seeding Guardrail 2.2 Approach Swarm Intelligence New Bin-packing Existing techniques weren’t designed to handle network bandwidth minimization & a combination of real-time scheduling, memory, & co-location constraints Solution Approach: • Leverage evolutionary algorithms to explore the design space for deployment plans that minimize bandwidth • Competing deployment plans are evolved over a series of generations to find an optimized solution • Best deployment plan(s) is presented to the developer Particle Swarm Optimization (PSO) Genetic Optimization
PSO Particle Positions PSO Seeding Guardrail Overview of Particle Swarm Optimization (PSO) New Bin-packing Particle’s Personal Best Current Global Best Possible Flight Path Each particle is *pulled* towards a combination of its personal best solution & the global best solution: Velocity Calculation Formula: Particle
PSO Particle Positions PSO Seeding Guardrail Challenges Applying PSO New Bin-packing Challenges Applying PSO: • How do you represent deployment plans as particle positions? • How do you randomly generate valid initial deployment plans? • How do you modify the particle flight plans to adhere to deployment constraints & use heuristic information? PSO degenerates to random search for many problems!!!
PSO Particle Positions PSO Seeding Guardrail Particle Position Approach: Deployment Vectors New Bin-packing Node 1 Node 2 Deployment topologies are represented as vectors: Example: 1, 2, 1
PSO Particle Positions PSO Seeding Guardrail Permuting Deployment Plans New Bin-packing Design at Step i + 1 Design at Step i Node 1 Node 2 Node 1 Node 2 2, 1, 2 Velocity = 1, -1, 0 1, 2, 2
PSO Particle Positions PSO Seeding Guardrail Poor Results with Random Particle Generation New Bin-packing Relatively Sparse Valid Solution Population X Invalid Solutions Dominate Space • Most of the solution space represents invalid solutions • The evolutionary & swarm intelligence algorithms degenerate into random searches with poor results!
PSO Particle Positions PSO Seeding Guardrail Random Deployment Plan Approach: Semi-random Bin-packing New Bin-packing By starting most of the particles on valid solution points, we can help focus the search to valid points
PSO Particle Positions PSO Seeding Guardrail Random Deployment Plan Generation A Particle Represents A Deployment Topology New Bin-packing • We used our hybrid first-fit heuristic bin-packing algorithm with randomization to generate the initial particle positions • Bin-packer is forced to deploy a random subset of the components first • Bin-packer is forced to use a random ordering for those components • Remaining components are deployed normally with the bin-packer Particle Seeding Semi-Randomized Bin-Packing Particle Swarm
PSO Particle Positions PSO Seeding Guardrail Constrained Flight Path Approach: Packing Order Positions New Bin-packing In the process of flying towards a more optimal solution, a particle may fly out of the valid solution space
PSO Particle Positions PSO Seeding Guardrail Approach: Add “Guardrail” to Solution Space New Bin-packing Our next approach was to try & add a “guardrail” to do a better job of restricting the search to valid solutions