-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
solving problems with non-Float64 types #890
Comments
Hi @goulart-paul this is an interesting question. I don't know much about the new type-specific JuMP models but for sure PowerModels was not designed with this feature in mind, it will be interesting to see if we can get it work. I hope @odow will be able to provide some insights. My guess would be that PowerModels builds a JuMP model that is One little known trick is that you can pass a JuMP model into these functions. So maybe you could try something like,
This may just push around the error to a different part of PowerModel's code where it starts building the model, but worth a try. I don't know what would be require to make PowerModels support this in a robust and flexible way, but I do think it would be a good feature to have. |
A partial fix seems possible by just changing one line here: PowerModels.jl/src/core/objective.jl Line 7 in a8d1aad
to Base.getindex(v::JuMP.GenericVariableRef, i::Int) = v Then this works: using Clarabel, JuMP, PowerModels
m = GenericModel{BigFloat}()
solve_dc_opf("pglib_opf_case14_ieee.m", Clarabel.Optimizer{BigFloat}, jump_model=m) or at least it works in the sense that a problem is presented to the solver in [warn | InfrastructureModels]: build_solution_values found unknown type GenericVariableRef{BigFloat} Going down in precision doesn't work even with the above modification, i.e. substituting Other problem types, e.g. SOCPs, still fail, so I will see if I can find an easy fix there as well. We are particularly interested in using PowerModels as a source of SOCP benchmarks, and were finding that some fraction of SOCPs terminate only with reduced accuracy. My suspicion is that most of those problems might be solvable with a 128 bit type. |
SOCPs appear to be fixed by modifying this file in I am sorry not to make a PR of this, but I think there are probably a lot of other places that require a similar treatment and I have only a very dim understanding of what is going on with this code. I couldn't get SDPs to work, though it seems like it should be possible. For the moment we are happy to have working SOCPs for benchmarking. |
Wait up, why is this method even here??? 🏴☠️ PowerModels.jl/src/core/objective.jl Line 7 in a8d1aad
|
But yes, there are probably a bunch of places that we need to replace hard-coded constants with the appropriate I don't know if there's anything fundamental limiting, it's just a matter of grinding through the different cases. |
Trying to solve problems with solvers that are configured for something other than Float64 lead to failures. I am not sure if this is a solver issue or a PowerModels one, but it happens with more than one solver.
Example:
The same holds for
Clarabel.Optimizer{Float32}
etc.The stack trace for the error is quite long, bu the gist of it is that it appears that constraints and objectives of parametrized as
Float64
are still reaching the model.The text was updated successfully, but these errors were encountered: