-
Notifications
You must be signed in to change notification settings - Fork 4
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
Update to MOI v1 #53
Comments
Hey, I'd be happy to help out as I would really like to use SDPA gmp in my work and not be tied to old versions of various packages. That said, my knowledge of MOI is rather limited and after looking through the release notes, it seems that most of the issue lies in the use of the discontinued load-allocate API. Are there any docs that could help me figure out which methods need to be defined (and how) for Also, this might be a better job for someone already very familiar with the details of MOI. If so, just lmk and I'll wait. It is not critical. Thanks! |
I looked a little bit but also wasn’t sure all the changes needed — but I also don’t fully understand the current implementation, to be honest. I think there are some parts we are doing incorrectly (edit: that is, I do think we get the correct answers, but I think in some less important ways we aren’t hooked up fully correctly to how MOI is supposed to work). I wonder if @odow or @blegat might be able to provide some guidance? |
One way to simplify the MOI wrapper is to remove the Allocate-Load API implementation and replace it with a single function MOI.copy_to(dest::Optimizer, src::MOI.ModelLike)
full_input_path = joinpath(m.tempdir, inputname)
sdpa = MOI.FileFormats.SDPA.Model()
index_map = MOI.copy_to(sdpa, src)
open(full_input_path, "w") do io
write(io, sdpa)
end
return index_map
end |
Thanks for offering help so quickly! I tried to adjust the wrapper accordingly (see fork here). However, I am even running into issues building the model in SDPA format. Specifically, when executing
I get an error (message below) suggesting that the SDPA format does not support non-negativity constraints on vector variables. I suspect that is unintended behavior as SDPA format typically supports LP blocks (right?). But before I go down the rabbit hole to understand what is happening there in greater detail, I meant to ask @blegat if this is potentially bug or if I am doing something silly. Detailed error message: |
Do we just write out a file to send to the binaries? If so, we can probably greatly simplify things. |
We essentially do. I did consider as a workaround using |
The example to follow is: https://github.com/jump-dev/AmplNLWriter.jl/blob/master/src/AmplNLWriter.jl. We just need to replace all the NL file bits with SDPA, and then replace the parsing of the If you have time/interest, it's probably a nice project to understand how MOI fits together, how to call binaries, and the intricacies of the SDPA file format. Start by replacing the write happens here: For the tests, we can use a caching optimizer ad a bridge to map between the conic forms: |
That sounds like a good guideline! I will look into it! |
Currently, the MOI wrapper supports: VectorOfVariables in Nonnegatives or PSD and equality constraints. |
Probably needs changes similar to jump-dev/SDPA.jl#35 and jump-dev/SDPA.jl#36 to account for the breaking changes from https://jump.dev/MathOptInterface.jl/latest/release_notes/#v0.10.0-(September-6,-2021)
The text was updated successfully, but these errors were encountered: