More Related Content Similar to Interesting Use Cases for the CPLEX Remote Object (20) Interesting Use Cases for the CPLEX Remote Object2. © 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
3. © 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
4. © 2013 IBM Corporation
Decision Optimization
4
DistMIP
Phases of the algorithm
– Presolve problem
• Copy presolved model
to workers
– Racing Rampup
• Until winner is chosen then
terminate other rampup runs
– Distributed tree search
• Distribute nodes from tree
of the winner across workers
• Process distributed tree search
4
Presolve
Rampup
Worker1
Worker2
WorkerN
Tree Search
Worker1
Worker2
WorkerN
5. © 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
6. © 2013 IBM Corporation
Decision Optimization
6
Racing Rampup
6
Master
Main
problem
Worker N
Worker 1
root
presolve
7. © 2013 IBM Corporation
Decision Optimization
7
Racing Rampup
7
Master
Main
problem
Worker N
Worker 1
root
presolve
root
root
Copy problem
Start limited MIP optimization
8. © 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
9. © 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
10. © 2013 IBM Corporation
Decision Optimization
10
Racing Rampup
10
Master
Worker N
Worker 1
root
root
root
Master querries worker
• Determines winner to
be worker N
Primal bound
Dual bound 1
Dual bound N
11. © 2013 IBM Corporation
Decision Optimization
11
Racing Rampup
11
Master
Worker N
Worker 1
root
root
root
Master querries worker
• Determines winner to
be worker N
• Terminates other workers
kill
12. © 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
13. © 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
14. © 2013 IBM Corporation
Decision Optimization
14
Racing Rampup
14
Master
Worker N
Worker 1
root
root
Master queries winner
• Grab open nodes
• Distribute nodes to
worker queues
Grab nodes
15. © 2013 IBM Corporation
Decision Optimization
15
Racing Rampup
15
Master
Worker N
Worker 1
root
Master
• Setup node from queue in
each worker
• Start MIP optimizer to
deterministic time limit
• Winner continues its tree
Setup node
root
16. © 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
17. © 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
18. © 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
19. © 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