KTH ROYAL INSTITUTE OF TECHNOLOGY Distributed L-shaped Algorithms in Julia Martin Biel KTH - Royal Institute of Technology November 16, 2018
Motivation - Stochastic programming decision x Martin Biel (KTH) November 16, 2018 2/19
Motivation - Stochastic programming observation ξ ( ω ) decision x → Martin Biel (KTH) November 16, 2018 2/19
Motivation - Stochastic programming observation ξ ( ω ) decision x → → recourse y Martin Biel (KTH) November 16, 2018 2/19
Motivation - Stochastic programming observation ξ ( ω ) decision x → → recourse y • Determine optimal decision ˆ x based on predicted outcomes { ω i } n i = 1 Martin Biel (KTH) November 16, 2018 2/19
Motivation - Stochastic programming observation ξ ( ω ) decision x → → recourse y • Determine optimal decision ˆ x based on predicted outcomes { ω i } n i = 1 • Numerous industry applications ◮ Power systems ◮ Finance ◮ Transportation Martin Biel (KTH) November 16, 2018 2/19
Motivation - Stochastic programming observation ξ ( ω ) decision x → → recourse y • Determine optimal decision ˆ x based on predicted outcomes { ω i } n i = 1 • Numerous industry applications ◮ Power systems ◮ Finance ◮ Transportation • Traditional procedure ◮ Formulate deterministically equivalent optimization problem ◮ Optimize extended form using standard solvers Martin Biel (KTH) November 16, 2018 2/19
Motivation - Limitations of standard approaches • Industry-scale applications typically involve 10,000+ scenarios Martin Biel (KTH) November 16, 2018 3/19
Motivation - Limitations of standard approaches • Industry-scale applications typically involve 10,000+ scenarios • Example: 24-hour unit commitment problem [ Petra et al (2014) ] ◮ 16,384 scenarios ◮ 1.95 billion variables and constraints in the extended form ◮ ~ 1 hour computation time on a Titan supercomputer Martin Biel (KTH) November 16, 2018 3/19
Motivation - Limitations of standard approaches • Industry-scale applications typically involve 10,000+ scenarios • Example: 24-hour unit commitment problem [ Petra et al (2014) ] ◮ 16,384 scenarios ◮ 1.95 billion variables and constraints in the extended form ◮ ~ 1 hour computation time on a Titan supercomputer • Long computation time required to optimize Martin Biel (KTH) November 16, 2018 3/19
Motivation - Limitations of standard approaches • Industry-scale applications typically involve 10,000+ scenarios • Example: 24-hour unit commitment problem [ Petra et al (2014) ] ◮ 16,384 scenarios ◮ 1.95 billion variables and constraints in the extended form ◮ ~ 1 hour computation time on a Titan supercomputer • Long computation time required to optimize • Memory requirement exceeds the capacity of a single machine Martin Biel (KTH) November 16, 2018 3/19
Motivation - Limitations of standard approaches • Industry-scale applications typically involve 10,000+ scenarios • Example: 24-hour unit commitment problem [ Petra et al (2014) ] ◮ 16,384 scenarios ◮ 1.95 billion variables and constraints in the extended form ◮ ~ 1 hour computation time on a Titan supercomputer • Long computation time required to optimize • Memory requirement exceeds the capacity of a single machine Parallel algorithms that work on distributed data are required Martin Biel (KTH) November 16, 2018 3/19
Contribution • Framework for formulating and solving stochastic programs Martin Biel (KTH) November 16, 2018 4/19
Contribution • Framework for formulating and solving stochastic programs • A collection of L-shaped algorithms Martin Biel (KTH) November 16, 2018 4/19
Contribution • Framework for formulating and solving stochastic programs • A collection of L-shaped algorithms • Distributed-memory setting Martin Biel (KTH) November 16, 2018 4/19
Contribution • Framework for formulating and solving stochastic programs • A collection of L-shaped algorithms • Distributed-memory setting • Complex functionality using simple abstractions in Julia Martin Biel (KTH) November 16, 2018 4/19
Contribution • Framework for formulating and solving stochastic programs • A collection of L-shaped algorithms • Distributed-memory setting • Complex functionality using simple abstractions in Julia Rapidly formulate and solve real-world problems as stochastic programs Martin Biel (KTH) November 16, 2018 4/19
Contribution - Framework Workers · Local scenario data · Local JuMP model · Cuts for global problem Worker 1 Worker N Master · Global problem · Global solver · Worker coordination Master Run time Design time Domain-specific models Hydromodels.jl Algebraic modeling language StochasticPrograms.jl Scalable distributed solvers LShapedSolvers.jl Figure: Overview of software framework. Martin Biel (KTH) November 16, 2018 4/19
Outline • Background • Implementation • Numerical experiments • Final remarks Martin Biel (KTH) November 16, 2018 5/19
Background - Stochastic programming Two-stage linear stochastic program c T x + E ω [ Q ( x , ξ ( ω ))] minimize x ∈ R n s.t. Ax = b x ≥ 0 where q T Q ( x , ξ ( ω )) = min ω y y ∈ R m s.t. T ω x + Wy = h ω y ≥ 0 Martin Biel (KTH) November 16, 2018 6/19
Background - Stochastic programming Two-stage linear stochastic program Deterministically equivalent form c T x + E ω [ Q ( x , ξ ( ω ))] minimize x ∈ R n s.t. Ax = b x ≥ 0 n � c T x + π i q T minimize i y i x ∈ R n , y i ∈ R m i = 1 s.t. Ax = b T i x + W i y i = h i , i = 1 , . . . , n where x ≥ 0 , y i ≥ 0 , i = 1 , . . . , n q T Q ( x , ξ ( ω )) = min ω y y ∈ R m s.t. T ω x + Wy = h ω y ≥ 0 Martin Biel (KTH) November 16, 2018 6/19
Background - Stochastic programming A T 1 W T 2 W . ... . . T n W Figure: L-shaped structure. Martin Biel (KTH) November 16, 2018 6/19
Background - L-shaped algorithm Cutting-plane algorithms ˆ X X = { x ∈ R n | Ax = b , x ≥ 0 } ˆ X = Optimal set Figure: L-shaped cutting planes Martin Biel (KTH) November 16, 2018 6/19
Background - L-shaped algorithm Cutting-plane algorithms x 0 ˆ X X = { x ∈ R n | Ax = b , x ≥ 0 } ˆ X = Optimal set Figure: L-shaped cutting planes Martin Biel (KTH) November 16, 2018 6/19
Background - L-shaped algorithm Cutting-plane algorithms x 0 ˆ X X = { x ∈ R n | Ax = b , x ≥ 0 } ˆ X = Optimal set Figure: L-shaped cutting planes Martin Biel (KTH) November 16, 2018 6/19
Background - L-shaped algorithm Cutting-plane algorithms x 0 ˆ X X = { x ∈ R n | Ax = b , x ≥ 0 } x 1 ˆ X = Optimal set Figure: L-shaped cutting planes Martin Biel (KTH) November 16, 2018 6/19
Background - L-shaped algorithm Cutting-plane algorithms x 0 ˆ X X = { x ∈ R n | Ax = b , x ≥ 0 } x 1 ˆ X = Optimal set Figure: L-shaped cutting planes Martin Biel (KTH) November 16, 2018 6/19
Background - L-shaped algorithm Cutting-plane algorithms x 2 x 0 ˆ X X = { x ∈ R n | Ax = b , x ≥ 0 } x 1 ˆ X = Optimal set Figure: L-shaped cutting planes Martin Biel (KTH) November 16, 2018 6/19
Background - L-shaped algorithm Master problem Subproblems Q k i = q T minimize i y i y i ∈ R m n � c T x + s.t. Wy i = h i − T i x j minimize θ i x ∈ R n i = 1 y i ≥ 0 s.t. Ax = b ∂ Q x + θ i ≥ q , i = 1 , . . . , n x ≥ 0 ∂ Q j = π i λ T i , j T i q j = π i λ T i , j h i Martin Biel (KTH) November 16, 2018 7/19
Background - L-shaped algorithm Master problem Subproblems Q k i = q T minimize i y i y i ∈ R m n � c T x + s.t. Wy i = h i − T i x j minimize θ i x ∈ R n i = 1 y i ≥ 0 s.t. Ax = b ∂ Q x + θ i ≥ q , i = 1 , . . . , n x ≥ 0 ∂ Q j = π i λ T i , j T i q j = π i λ T i , j h i • One master problem, n subproblems • Theoretical convergence guarantees • Convergence can be improved through regularization procedures • Readily extended to operate in parallel on distributed data Martin Biel (KTH) November 16, 2018 7/19
Implementation - StochasticPrograms.jl • Flexible problem definition • Deferred model instantiation • Scenario data injection • Memory-distributed • Minimize data passing ◮ Lightweight sampler objects to generate data ◮ Lightweight model recipes to generate second stage problems • Interface to structure-exploiting solver algorithms • Registered Julia package Martin Biel (KTH) November 16, 2018 8/19
Implementation - Model recipes ✞ ☎ @first_stage sp = begin @variable(model, x 1 >= 40) @variable(model, x 2 >= 20) @objective(model, Min, 100*x 1 + 150*x 2 ) @constraint(model, x 1 + x 2 <= 120) end @second_stage sp = begin @decision x 1 x 2 ξ = scenario @variable(model, 0 <= y 1 <= ξ .d 1 ) @variable(model, 0 <= y 2 <= ξ .d 2 ) @objective(model, Min, ξ .q 1 *y 1 + ξ .q 2 *y 2 ) @constraint(model, 6*y 1 + 10*y 2 <= 60*x 1 ) @constraint(model, 8*y 1 + 5*y 2 <= 80*x 2 ) end ✝ ✆ Martin Biel (KTH) November 16, 2018 9/19
Recommend
More recommend