exanauts / exaadmm.jl Goto Github PK
View Code? Open in Web Editor NEWJulia implementation of ADMM solver on multiple GPUs
License: MIT License
Julia implementation of ADMM solver on multiple GPUs
License: MIT License
Check out eq.(3.8) in https://link.springer.com/article/10.1007/s00186-020-00713-x
@wzhangw found the initialization of single-period ACOPF on GPU was not correct or compatible to that for CPU.
There may be some bug from refactoring ModelAcopf
.
ERROR: type ModelAcopf has no field ngen
Stacktrace:
[1] getproperty
@ ./Base.jl:42 [inlined]
[2] admm_restart_rolling(env::ExaAdmm.AdmmEnv{Float64, CuArray{Float64, 1}, CuArray{Int64, 1}, CuArray{Float64, 2}}, mod::ExaAdmm.ModelAcopf{Float64, CuArray{Float64, 1}, CuArray{Int64, 1}, CuArray{Float64, 2}}; start_period::Int64, end_period::Int64, result_file::String)
@ ExaAdmm ~/.julia/packages/ExaAdmm/srowl/src/models/acopf/acopf_admm_rolling_gpu.jl:24
[3] solve_acopf_rolling(case::String, load_prefix::String; case_format::String, outer_iterlim::Int64, inner_iterlim::Int64, rho_pq::Float64, rho_va::Float64, obj_scale::Float64, scale::Float64, use_gpu::Bool, use_linelimit::Bool, use_projection::Bool, tight_factor::Float64, outer_eps::Float64, gpu_no::Int64, verbose::Int64, ramp_ratio::Float64, start_period::Int64, end_period::Int64, result_file::String)
@ ExaAdmm ~/.julia/packages/ExaAdmm/srowl/src/interface/solve_acopf_rolling.jl:28
# TODO: Parallelize the time horizon. Can we parallelize this?
This is simple to implement based on https://arxiv.org/pdf/1704.06209.pdf. It looks effective for QPsub.
This requires #55.
Can we rely on the PowerModels.jl
parser to avoid ambiguity between the parsed case files.
This work was done by @frapac in exanauts/ExaTron.jl#35 for ExaTron.jl. I guess it would be similar here. I can take a stab.
To run on AMD and Intel GPUs we need to use a portability layer like KernelAbstractions.jl.
The goal is to add KA to the already existent CPU and CUDA.jl code without changing those.
Device
type or Array type (not use_gpu
)Comments and discussions are welcome! @kibaekkim @youngdae @frapac
Right now, Solution
does not contain Vm
and Va
. This required in exanauts/ProxAL.jl#72 .
ExaAdmm.jl/src/utils/environment.jl
Line 175 in 18dcaee
Why should this be separate from the above? Why does this have to use a different CUDA setting?
ExaAdmm.jl/src/models/ucmp/ucmp_admm_update_x_gpu.jl
Lines 42 to 47 in 8638503
Some tests got failed only on GPU.
Test Summary: | Pass Fail Total
Testing ADMM algorithms on GPUs | 198 27 225
Testing [x,xbar,z,l,lz] updates and a solve for ACOPF | 57 57
Testing [x,xbar,z,l,lz] updates and a solve for MPACOPF | 141 27 168
Testing U_GEN t=1 | 3 3
Testing U_GEN t=2 | 3 3
Testing U_GEN t=3 | 3 3
Testing U_BR t=1 | 9 9
Testing U_BR t=2 | 9 9
Testing U_BR t=3 | 9 9
Testing V_GEN t=1 | 3 3
Testing V_GEN t=2 | 3 3
Testing V_GEN t=3 | 3 3
Testing V_BR t=1 | 9 9
Testing V_BR t=2 | 9 9
Testing V_BR t=3 | 9 9
Testing Z_GEN t=1 | 3 3
Testing Z_GEN t=2 | 3 3
Testing Z_GEN t=3 | 3 3
Testing Z_BR t=1 | 9 9
Testing Z_BR t=2 | 9 9
Testing Z_BR t=3 | 9 9
Testing L_GEN t=1 | 3 3
Testing L_GEN t=2 | 3 3
Testing L_GEN t=3 | 3 3
Testing L_BR t=1 | 9 9
Testing L_BR t=2 | 9 9
Testing L_BR t=3 | 9 9
ERROR: LoadError: Some tests did not pass: 198 passed, 27 failed, 0 errored, 0 broken.
Issue with #43: observe sync/wait in SQOPF test with ExaAdmm branch https://github.com/exanauts/ExaAdmm.jl/tree/bowen/qp
] test
, SQOPF stuck with sync/wait error asusing SQP
using LinearAlgebra
using CUDA
case = "test/algorithms/case9.m"
#SQP with QP solver: ExaADMM with GPU
sqp1 = SQOPF.sqp_solve(case; itermax = 30, eps_inf = 1e-4, eps_res = 1e-4, eps_dir = 1e-4, pen = 5e5, TR = 10, lambda = 0.0, output_flag = 1, outer_iterlim=5000, rho_pq=5000.0, rho_va=5000.0, obj_scale=1.0, scale=1e-4, outer_eps=1e-4, verbose = 0, use_ipopt = false, use_feas_check = false, use_gpu = true, gpu_no = 1);
Variable use_twolevel::AdmmEnv
is not used in the code. We can remove the variable and clean up the code as if use_twolevel=false
. As a result, SolutionTwoLevel
can be removed, and SolutionOneLevel
may better be renamed to a generic one.
We need to remove deps
directory and update Project.toml
. This requires the new release (v1.0.0) of ExaTron.jl: exanauts/ExaTron.jl#40 (review)
It may not need specific to OPF.
ExaAdmm.jl/src/common/environment.jl
Line 360 in 350fa51
As part of refactoring #6 we need to remove unused folders.
ExaAdmm.jl/src/common/environment.jl
Line 90 in 34a25e8
This looks like a data-specific member in AdmmEnv
struct.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
We can generalize the tolerance-based termination criteria according to this paper: https://arxiv.org/pdf/1704.06209.pdf. The current implementation terminates ADMM based on the absolute tolerance only.
@youngdae I see a lot of CUDA.@timed @cuda
calls, like here
This only times the kernel launch or? Should we replace those with CUDA.@timed CUDA.@sync @cuda
or does that lead to a slowdown?
youngdae/abstraction
Multiperiod ACOPF (mpacopf) is not passing the test on gpu.
[email protected]
mpacopf runs the test only with [email protected]
. Even this fails some tests for the values of L_BR
.
[email protected]
and laterThe test returns the following error:
Testing [x,xbar,z,l,lz] updates and a solve for MPACOPF: Error During Test at /home/kimk/REPOS/ExaAdmm.jl/test/algorithms/mpacopf_update_gpu.jl:1
Got exception outside of a @test
GPU compilation of kernel auglag_generator_kernel(Int64, Int64, Int64, Int64, Int64, Float64, Float64, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceMatrix{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, CuDeviceVector{Float64, 1}, Float64) failed
KernelError: kernel returns a value of type `Union{}`
Make sure your kernel function ends in `return`, `return nothing` or `nothing`.
If the returned value is of type `Union{}`, your Julia code probably throws an exception.
Inspect the code with `@device_code_warntype` for more details.
ExaAdmm.jl/src/common/environment.jl
Lines 85 to 97 in 350fa51
Some fields are relevant to data. These fields may better be separated out from AdmmEnv
struct.
The first version will be released after the abstraction going on in branch youngdae/abstraction
.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.