interesting use cases for the cplex remote object
DESCRIPTION
In November 2013, at INFORMS, we introduced one of the new features in CPLEX 12.6: Distributed MIP. This gives you the ability to solve a single MIP problem on several computers.TRANSCRIPT
Decision Optimization
Interesting Use Cases forthe CPLEX Remote Object
Laszlo Ladanyi & Daniel Junglas
© 2013 IBM Corporation
Decision Optimization
2
History
CPLEX Remote Object– Introduced with 12.5.0 in Fall 2012
• 3 transports: tcpip, MPI, process (ssh)– Example codes:
• Parmipopt:- Start two workers one working on primal and one working on dual bounds - Stop when bounds match
• Parbenders- master solves sub-problems within lazy constraint callback- sub-problems solved on remote machines using remote
CPLEX objects
2
© 2013 IBM Corporation
Decision Optimization
3
Fast forward to 12.6.0: DistMIP
DistMIP: A distributed memory MIP solver– Built using the CPLEX remote object– “Master” distributes tasks to multiple “workers” and controls them– Communication to workers done transparently via CPLEX Remote Object function– Algorithm runs deterministically
3
© 2013 IBM Corporation
Decision Optimization
4
DistMIP
Phases of the algorithm– Presolve problem
• Copy presolved modelto workers
– Racing Rampup• Until winner is chosen then
terminate other rampup runs– Distributed tree search
• Distribute nodes from treeof the winner across workers
• Process distributed tree search
4
Presolve
Rampup
Work
er 1
Work
er 2
Work
er N
Tree Search
Work
er 1
Work
er 2
Work
er N
© 2013 IBM Corporation
Decision Optimization
5
DistMIP: Racing Rampup
Task– Run concurrent MIP optimizer until– “Good” run has produced enough nodes to distribute among workers
Each worker gets same problem– Setup different parameter settings
• Different random seeds– Candidate winner (currently): worker with best dual;
Stop when candidate winner has enough nodes– Exchange primal and dual bounds between workers
5
© 2013 IBM Corporation
Decision Optimization
6
Racing Rampup
6
Master
Mainproblem
Worker N
Worker 1
rootpresolve
© 2013 IBM Corporation
Decision Optimization
7
Racing Rampup
7
Master
Mainproblem
Worker N
Worker 1
rootpresolve
root
root
Copy problemStart limited MIP optimization
© 2013 IBM Corporation
Decision Optimization
8
Racing Rampup
8
Master
Worker N
Worker 1
root
root
root
Master querries workers:• primal bound• dual bound• number of nodes
Primal bound
Dual bound 1
Dual bound N
© 2013 IBM Corporation
Decision Optimization
9
Racing Rampup
9
Master
Worker N
Worker 1
root
root
root
Master• Check for termination• Spread best primal bound• Other workers may prune
nodes from their tree
Primal bound
Primal bound
© 2013 IBM Corporation
Decision Optimization
10
Racing Rampup
10
Master
Worker N
Worker 1
root
root
root
Master querries worker• Determines winner tobe worker N
Primal bound
Dual bound 1
Dual bound N
© 2013 IBM Corporation
Decision Optimization
11
Racing Rampup
11
Master
Worker N
Worker 1
root
root
root
Master querries worker• Determines winner tobe worker N
• Terminates other workers
kill
© 2013 IBM Corporation
Decision Optimization
12
DistMIP: Racing Rampup
Termination– Regularly (after deterministic time interval) workers report dual bound and open-
node count to master– Master interrupts rampup if worker with best dual bound has enough nodes for
starting tree search– Otherwise workers continue
Infinite Rampup– Run until problem solved or time limit
12
© 2013 IBM Corporation
Decision Optimization
13
DistMIP: Distributed Tree Search
Master collects and redistributes nodes from winner to workers
Workers explore nodes independently as individual MIPs– Master distributes information between workers
• New incumbents• Root bounds
Master rebalances nodes from time to time
13
© 2013 IBM Corporation
Decision Optimization
14
Racing Rampup
14
Master
Worker N
Worker 1
root
root
Master queries winner• Grab open nodes• Distribute nodes toworker queues
Grab nodes
© 2013 IBM Corporation
Decision Optimization
15
Racing Rampup
15
Master
Worker N
Worker 1
root
Master• Setup node from queue ineach worker
• Start MIP optimizer todeterministic time limit
• Winner continues its tree
Setup node
root
© 2013 IBM Corporation
Decision Optimization
16
DistMIP: Distributed Tree Search
Steady state– Master has queue of nodes assigned to each worker– Worker gets single node to work on
In a loop– Each worker runs for limited deterministic time up to synchronization point– At synchronization point
• Exchange dual bound, tree size, solutions,...• Possibly master grabs nodes from workers• Possibly master reassigns nodes to workers
16
© 2013 IBM Corporation
Decision Optimization
17
DistMIP: Performance
Infinite Rampup– General purpose applicability to harder problems
• Exploit / reduce performance variability• Limited scalability (4-8 machines)
– Average speedup on our testset• >100s: 1.4x• >1000s: 1.7x
DistMIP– Special purpose solver for problems that require dealing with combinatorial growth
of tree size
17
© 2013 IBM Corporation
Decision Optimization
18
DistMIP: Technical details
Master– Responsible of enforcing limits
Rampup Workers– Combining presolve reductions from workers only allows one worker to carry out
dual reductions
18
© 2013 IBM Corporation
Decision Optimization
19
Ease of Use
Setup a Virtual Machine Configuration file config.vmc– Read in config file
• CPLEX> read config.vmc• CPXXreadcopyvmconfig (env, “config.vmc”)• CPXXreadvmcconfig (env, “...”);
– Call distmip optimizer• CPLEX> optimize• CPXXdistmipopt(env, lp);
19