We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byRenee Horlick
Modified over 2 years ago
Copyright © ILOG 2008 IBM ILOG CPLEX Advanced Performance Tuning Optimization Technologies Workshop John Gregory CPLEX Product Manager IBM
2 Copyright © ILOG 2008 CPLEX Performance Tuning Overview Speed Continuous Models (LP, QP, QCP/SOCP) MIP Memory Operating System Deployment Application CPLEX Numerical Ill conditioning Numerical Instability Summary
3 Copyright © ILOG 2008 Tuning for Speed: Continuous Models Try each algorithm Primal Simplex Dual Simplex Network Simplex Barrier (only option for QCP/SOCP) Sifting (LP only) Concurrentopt (LP only, parallel processors)
4 Copyright © ILOG 2008 Tuning for Speed: Continuous Models Other tactics Presolve dual on (apply presolve, then solve the dual model) LP only Constraints : [Greater: ] Variables : [Free: ] Constraint nonzeros: Objective nonzeros: RHS nonzeros: Parallel barrier method Check for numerical difficulties
5 Copyright © ILOG 2008 Tuning for Speed: Continuous Models Iteration logs Degeneracy (simplex methods) Excessive time per iteration
6 Copyright © ILOG 2008 Tuning for Speed : Continuous Models Degeneracy, sample log Iter: 4751 Infeasibility = Iter: 4870 Infeasibility = Iter: 4976 Infeasibility = Iter: 5083 Infeasibility = Iter: 5191 Infeasibility = Iter: 5862 Infeasibility = Iter: 5968 Infeasibility = Perturbation started.
7 Copyright © ILOG 2008 Tuning for Speed: Continuous Models Excessive time per iteration, sample log Elapsed time = sec. (37000 iterations) Iter: Infeasibility = Iter: Infeasibility = Iter: Infeasibility = Elapsed time = sec. (41000 iterations)... Elapsed time = sec. ( iterations) Iter: Infeasibility = Elapsed time = sec. ( iterations) Elapsed time = sec. ( iterations) 12 sec. 827 sec.
8 Copyright © ILOG 2008 Tuning for Speed: Continuous Models Degeneracy Try each algorithm Instruct CPLEX to perturb the model Excessive time per iteration Try each algorithm Check for virtual memory usage Run with more memory available Turn on memory emphasis parameter Consider alternate pricing (pgradient/dgradient) Time per iteration depends on pricing scheme
9 Copyright © ILOG 2008 Tuning for Speed: MIP Try the Tuning Tool (CPLEX 11 or later) Primarily for MIPs, but works for all problem types Works with all CPLEX interfaces, including interactive optimizer Can make use of internal algorithm information Let CPLEX and your computer do the work
10 Copyright © ILOG 2008 Tuning for Speed: MIP Input: Model(s) to tune, tuning instructions Problem in memory or set of problems in files Fixed parameter set, parameters which should not be tuned, e.g., tolerances, threads Parameters, metrics to control tuning process (e.g. total tuning time, average or worst case run time) Output: Tuned and fixed parameter settings
11 Copyright © ILOG 2008 Tuning for Speed: MIP Examine node log (if Tuning Tool doesnt help) Excessive iteration counts for node relaxations. Use different start/sub algorithm. Barrier method doesnt support restarts. Set dual gradient to exact steepest edge norms, file parameter to store node file on disk and compress it. More progress needed in best integer or best node value?
12 Copyright © ILOG 2008 Nodes Cuts/ Node Left Objective IInf Best Integer Best Node ItCnt Fract: infeasible infeasible … infeasible … Solution time = sec. Iterations = Nodes = 10 (1) Tuning for Speed: MIP Excessive iteration counts for node LPs, sample node log #1 (dual simplex to solve node LPs)
13 Copyright © ILOG 2008 Tuning for Speed: MIP Excessive iteration counts for node LPs, sample node log #2 (primal simplex to solve node LPs) Nodes Cuts/ Node Left Objective IInf Best Integer Best Node ItCnt Fract: infeasible infeasible … infeasible … Solution time = sec. Iterations = Nodes = 10 (1)
14 Copyright © ILOG 2008 Tuning for Speed: MIP Progress in best node but not best integer: Nodes Cuts/ Node Left Objective IInf Best Integer Best Node ItCnt Gap % cutoff % % % % %
15 Copyright © ILOG 2008 Tuning for Speed: MIP Progress in best integer but not best node: Nodes Cuts/ Node Left Objective IInf Best Integer Best Node ItCnt Gap … % * % * % % %... * % % % %
16 Copyright © ILOG 2008 Tuning for Speed: MIP Tactics for lack of progress in best integer Use especially if customer accepts a good, perhaps sub optimal solution. MIP emphasis Set to 1 (emphasize integer feasibility) Set to 4 (emphasize finding hidden integer solutions) Solution Polishing Requires an integer feasible solution Use to improve sub optimal solutions at end of MIP search Or use as replacement for majority of MIP search when - local search works well - node LPs are time consuming - improving best node appears hopeless
17 Copyright © ILOG 2008 Tuning for Speed: MIP Lack of progress in best integer (continued) RINS Heuristic Local search heuristic - Needs an integer feasible solution MIP Starts and Solution Repair CPLEX 10.0 and later accepts partial MIP starts - Solution repair for (partial) infeasible MIP starts May make RINS, Solution Polishing more effective Feasibility Pump Heuristic (CPLEX 11 and later) Applied first at root node
18 Copyright © ILOG 2008 Tuning for Speed: MIP Lack of progress in best integer (continued) Probing Set to 3 (maximum probing) Cuts Set to 2 (aggressive cut generation) Cuts and Probing dont explicitly help find feasible solutions, but the resulting tighter formulation may help. Can be useful when combined with setting MIP emphasis to 1 (emphasize integer feasibility)
19 Copyright © ILOG 2008 Tuning for Speed: MIP Tactics for lack of progress in best node MIP emphasis Set to 2 or 3 to emphasize proving optimality and moving best node respectively. - May need Partial/Infeasible MIP start, Feasibility Pump or RINS Heuristic to compensate for fewer integer feasible solutions Probing Set to 3 (maximum probing) Cuts Set to 2 (aggressive cut generation) Cuts and Probing often tighten the model formulation
20 Copyright © ILOG 2008 Tuning for Speed: MIP Tactics for lack of progress in best node and best integer Set MIP emphasis to 3 May cause difficulties finding integer feasible solutions Compensate by using (partial or infeasible) MIP starts, Feasibility Pump, RINS Heuristic, Solution Polishing to help find more integer feasible solutions
21 Copyright © ILOG 2008 Tuning for Speed: MIP Tactics for lack of progress in best node and best integer (continued) Provide a starting solution, regardless of objective value Can help CPLEXs local search heuristics Can yield additional tightening of the model Consider external methods (e.g. Constraint Programming, Metaheuristics like Simulated Annealing, model specific heuristics) to find a starting solution Try CPLEXs feasopt feature
22 Copyright © ILOG 2008 Tuning for Speed: MIP Other tactics Specific model knowledge determines parameter settings Try branching up first
23 Copyright © ILOG 2008 Tuning for Speed: MIP Other tactics (continued) Specific model knowledge determines priority order. Time period models - Higher priority to earlier time periods. Dependencies among integer variables
24 Copyright © ILOG 2008 Tuning for Speed: MIP Other tactics (continued) Specific model knowledge determines changes to model Adding model specific cuts - Tighten formulation - Remove symmetry Sherali, Smith Improving Zero-One Model Representations Via Symmetry Considerations Model reformulation
25 Copyright © ILOG 2008 Memory Tuning: Operating System Virtual memory slows performance Task Manager (Windows) Top, ps, vmstat under Unix Make sure you can allocate all available memory Java VM limitations Use –Xmx option to increase heap size On a 32-bit machine, the real limit is 2GB Limits on individual accounts Compiler/Linker options 32 bit AIX has default of 256 MB for memory allocations. Write a simple program to test available memory (or ask us for one).
26 Copyright © ILOG 2008 Memory Tuning: Deployment Considerations Compare memory usage Solve the Deployment application model(s) with: Interactive CPLEX Simple example programs Purify, Insure, Bounds Checker, Valgrind (Linux only) can help with memory leaks Make sure you solve the correct model Display problem statistics Data check parameter Diagnostic routines in check.c
27 Copyright © ILOG 2008 Memory Tuning: CPLEX Considerations Sometimes CPLEX really uses all available memory Default settings emphasize speed over memory conservation. Is CPLEX memory usage reasonable? 1 GB per million constraints of an LP - Exceptions: large aspect ratios, very dense constraints 1 GB per million (constraints + quadratic variables) of a QP - Exception: dense Q matrix lacking sparse factorization At least that much for MIP, MIQP
28 Copyright © ILOG 2008 Memory Tuning: CPLEX Considerations Memory conservation techniques General Turn memory emphasis on (slight extra run time) Use different algorithm (LP and QP) As a last resort, turn presolve off (potential big increase in run time) LP Set presolve dual indicator on
29 Copyright © ILOG 2008 Memory Tuning: CPLEX Considerations Memory conservation techniques (continued) MIP MIP search tree often dominates memory usage - Performance tuning to reduce node count. - Setting node file parameter to 3 efficiently writes nodes to disk. - Setting variable select parameter to 3 (strong branching). Fewer nodes required to make the same amount of progress.
30 Copyright © ILOG 2008 Memory Tuning: Other Tactics Buy more memory (but only after accurately estimating requirements) Specialized algorithms Example: Column generation for models with large aspect ratios.
31 Copyright © ILOG 2008 Memory Tuning: Other Tactics Review of model development process Model reformulation Reduce problem dimensions Reduce difficulty while increasing problem size. MIP reformulations for column generation. Increase in problem size in exchange for sparser problem data
32 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Sensitivity of computed solutions to perturbations in problem data Condition number of a matrix CPLEX solves systems of equations of the form Exact solution is
33 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Condition number of a matrix (continued) To measure effects of perturbations, consider Exact solution is Combine with exact solution of x:
34 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Condition number of a matrix (ctd). Using Cauchy - Schwarz inequality This gives max. absolute change in x relative to change in b. Now consider relative change by using Cauchy - Schwarz inequality in original system:
35 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Condition number of a matrix (continued) Combine and rearrange to get Similar procedure for perturbing B yields
36 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Ill conditioning can occur under perfect arithmetic But, finite precision can perturb the exact system of equations we wish to solve, resulting in significant changes to the computed solution
37 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Sources of perturbations due to finite precision Rounding of data Near singular matrices Avoid computing data in single precision Round off error in the simplex method computations, particularly the basis factorization. Round off error due to scaling of large data values Floating point calculations involving values of greatly different orders of magnitude Avoid mixtures of very large and small coefficients
38 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Rounding of data Maximize x1 + x2 c1: 1/3 x1 + 2/3 x2= 1 c2: x1 + 2 x2 = 3 Solution: x1 = 3.0 Maximize x1 + x2 c1: x x2 = 1 c2: x1 + 2 x2 = 3 Solution: x1 = x2 = 1.0, cond(B) = e+06 Maximize x1 + x2 c1: x x2 = 1 c2: x1 + 2 x2 = 3 Solution: x1 = 3.0, cond(B) =
39 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Avoid rounding whenever possible Exact formulation: Maximize x1 + x2 c1: 1/3 x1 + 2/3 x2= 1 c2: x1 + 2 x2 = 3 Imprecisely rounded: Maximize x1 + x2 c1: x x2 = 1 c2: x1 + 2 x2 = 3 Scale to integral value whenever possible: Maximize x1 + x2 c1: x1 + 2 x2 = 3 c2: x1 + 2 x2 = 3
40 Copyright © ILOG 2008 Numerical Tuning: Ill conditioning Rounding of data (continued) Changes in right hand side can have similar effect Maximize x1 + x2 c1: x x2 = 1 c2: x1 + 2 x2 = 3 Solution: x1 = x2 = 1.0 Maximize x1 + x2 c1: x x2 = c2: x1 + 2 x2 = 3 Solution: x1 = 3.0
41 Copyright © ILOG 2008 Numerical Tuning: Numerical Instability Large values in problem data Bounds can magnify round off error: Large coefficient ratios in matrix rows or columns:
42 Copyright © ILOG 2008 Symptoms of Numerical Instability Sample iteration log Iter: 6389 Objective = Iter: 6390 Objective = Iter: 6391 Objective = Markowitz threshold set to 0.3. Iter: 6456 Scaled infeas = Iter: 6752 Scaled infeas = Iter: 6754 Objective =
43 Copyright © ILOG 2008 Numerical Tuning Tactics General Turn numerical emphasis on Rounding of data Compute data as accurately as possible Round off error in simplex method Set Markowitz tolerance to.90 (or higher if necessary) Large values in problem data Reduce large coefficients if possible Set scaling parameter to 1 (aggressive scaling)
44 Copyright © ILOG 2008 CPLEX Performance Tuning Summary CPLEX solves most problems with no trouble Organized tactics for the outliers can yield dramatic savings in time. Different categories of performance problems. Use all available information Iteration and node logs for LP and MIP Interactive CPLEX Simple test programs (CPLEX and your own) OS memory management tools Purify/Insure/Bounds Checker/Valgrind ILOG Technical Support and Consulting
Chapter 3: Supervised Learning. CS583, Bing Liu, UIC 2 Road Map Basic concepts Decision tree induction Evaluation of classifiers Rule induction Classification.
VMware vCenter Server High Availability Product Support Engineering VMware Confidential.
Chapter 14 Query Optimization. ©Silberschatz, Korth and Sudarshan14.2Database System Concepts 3 rd Edition Chapter 14: Query Optimization Introduction.
LINEAR PROGRAMMING 1.224J/ESD.204J TRANSPORTATION OPERATIONS, PLANNING AND CONTROL: CARRIER SYSTEMS Professor Cynthia Barnhart Professor Nigel H.M. Wilson.
Introduction to Crystal Reports Allows you to produce the report you want from virtually any data source. Designed to help analyze and interpret.
© 2009 Wellesley Information Services. All rights reserved. 20 technical tips and tricks to speed SAP NetWeaver Business Intelligence query, report, and.
1 PROJECT MANAGEMENT Using Microsoft Project 2000.
Debbie Sheetz Sr. Staff Consultant BMC Software, Customer Support/Waltham, MA Top Ten Topics in Performance Reporting/Modeling for Virtualization using.
1 Advanced Database Application Development Performance Tuning Performance Benchmarks Standardization E-Commerce Legacy Systems.
Database System Concepts, 6 th Ed. ©Silberschatz, Korth and Sudarshan See for conditions on re-usewww.db-book.com Chapter 12: Query Processing.
Chapter 2 Overview of the Data Mining Process 1. Introduction Data Mining – Predictive analysis Tasks of Classification & Prediction Core of Business.
Programming For Nuclear Engineers Lecture 10 MATLAB 1.
Mark Sherman Danilo Centazzo. 2 Introduction to FEMAP Agenda Day 1 Introduction Install, Setup and Customize FEMAP The User interface and the On-Line.
1 Summary of Papers 1. P. Sauer and M. Pai, Power System Steady-State Stability and the Load Flow Jacobian, IEEE Transactions on Power Systems, Vol. 5,
Work measurement Part II of Work Study. 2 Introduction Work measurement is the application of techniques designed to establish the time for a qualified.
Copyright 2011 John Wiley & Sons, Inc Business Data Communications and Networking 11th Edition Jerry Fitzgerald and Alan Dennis John Wiley & Sons, Inc.
1 Chapter 2: Decision Making, Systems, Modeling, and Support Conceptual Foundations of Decision Making The Systems Approach How Support is Provided.
E – 1 Copyright © 2010 Pearson Education, Inc. Publishing as Prentice Hall. Linear Programming E For Operations Management, 9e by Krajewski/Ritzman/Malhotra.
1 Copyright © 2010, Elsevier Inc. All rights Reserved Chapter 5 Shared Memory Programming with OpenMP An Introduction to Parallel Programming Peter Pacheco.
Constraint Satisfaction Problems CS 271: Fall 2007 Instructor: Padhraic Smyth.
Chapter 6 Three Simple Classification Methods The Naïve Rule Naïve Bayes k-Nearest Neighbor 1.
1 Logistic regression. 2 Regression Regression is a set of techniques for exploiting the presence of statistical ASSOCIATIONS among variables to make.
1 GREY BOX TESTING Web Apps & Networking Session 3 Boris Grinberg
10-1. Systems Analysis & Programming 10.1 Systems Development 10.2 Programming: A Five-Step Procedure Generations of Programming Languages 10.4.
1 Simple Linear Regression 1. review of least squares procedure 2. inference for least squares lines.
Constraint Programming and Local Search Filippo Focacci, Andrea Lodi CP -AI-OR02, School on Optimization.
1 Fuzzy expert systems Fuzzy inference n Mamdani fuzzy inference n Sugeno fuzzy inference n Case study n Summary.
Silberschatz, Galvin and Gagne ©2009 Operating System Concepts – 8 th Edition, Chapter 8: Main Memory.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 5 Slide 1 Topics covered l Functional and non-functional requirements l User requirements.
ISBN Prentice-Hall, 2006 Chapter 5 Designing the System Copyright 2006 Pearson/Prentice Hall. All rights reserved.
© 2016 SlidePlayer.com Inc. All rights reserved.