Skip to content
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

load_variables not defined for SCS #47

Closed
matbesancon opened this issue Dec 4, 2020 · 5 comments
Closed

load_variables not defined for SCS #47

matbesancon opened this issue Dec 4, 2020 · 5 comments
Labels
bug Something isn't working

Comments

@matbesancon
Copy link
Collaborator

MOIU.load_variables(model.optimizer.model.optimizer, MOI.get(model, MOI.NumberOfVariables()))

in backward_conic! throws an error, it does not seem to be implemented for SCS models

@matbesancon matbesancon added the bug Something isn't working label Dec 4, 2020
@matbesancon
Copy link
Collaborator Author

Related in the tests:

Differentiating conic with PSD and SOC constraints: Error During Test at /home/mbesancon/Documents/crptests/project_julia/DiffOpt.jl/test/MOI_wrapper.jl:624
  Got exception outside of a @test
  The Allocate-Load interface is not implemented by the model
  Stacktrace:
   [1] correct_throw_add_constraint_error_fallback(::SCS.Optimizer, ::MathOptInterface.VectorAffineFunction{Float64}, ::MathOptInterface.PositiveSemidefiniteConeTriangle; error_if_supported::ErrorException) at /home/mbesancon/.julia/packages/MathOptInterface/ZJFKw/src/constraints.jl:156
   [2] throw_add_constraint_error_fallback(::SCS.Optimizer, ::MathOptInterface.VectorAffineFunction{Float64}, ::MathOptInterface.PositiveSemidefiniteConeTriangle; kwargs::Base.Iterators.Pairs{Symbol,ErrorException,Tuple{Symbol},NamedTuple{(:error_if_supported,),Tuple{ErrorException}}}) at /home/mbesancon/.julia/packages/MathOptInterface/ZJFKw/src/constraints.jl:135
   [3] load_constraint(::SCS.Optimizer, ::MathOptInterface.ConstraintIndex{MathOptInterface.VectorAffineFunction{Float64},MathOptInterface.PositiveSemidefiniteConeTriangle}, ::MathOptInterface.VectorAffineFunction{Float64}, ::MathOptInterface.PositiveSemidefiniteConeTriangle) at /home/mbesancon/.julia/packages/MathOptInterface/ZJFKw/src/Utilities/copy.jl:689
   [4] backward_conic!(::Optimizer{MathOptInterface.Bridges.LazyBridgeOptimizer{MathOptInterface.Utilities.CachingOptimizer{SCS.Optimizer,MathOptInterface.Utilities.UniversalFallback{MathOptInterface.Utilities.Model{Float64}}}}}, ::Array{Float64,2}, ::Array{Float64,1}, ::Array{Float64,1}) at /home/mbesancon/Documents/crptests/project_julia/DiffOpt.jl/src/MOI_wrapper.jl:563
   [5] top-level scope at /home/mbesancon/Documents/crptests/project_julia/DiffOpt.jl/test/MOI_wrapper.jl:688
   [6] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
   [7] top-level scope at /home/mbesancon/Documents/crptests/project_julia/DiffOpt.jl/test/MOI_wrapper.jl:628
   [8] include(::String) at ./client.jl:457
   [9] top-level scope at /home/mbesancon/Documents/crptests/project_julia/DiffOpt.jl/test/runtests.jl:25
   [10] top-level scope at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.5/Test/src/Test.jl:1115
   [11] top-level scope at /home/mbesancon/Documents/crptests/project_julia/DiffOpt.jl/test/runtests.jl:25

@matbesancon
Copy link
Collaborator Author

ping @blegat and @Aks1996 on this one, not sure what load_variables is meant to do here

@blegat
Copy link
Member

blegat commented Dec 5, 2020

It used to be defined for SCS but not anymore. Anyway, DiffOpt should not require the solver to implement it. It should use add_variables and solvers like SCS should be used with a CachingOptimizer

@matbesancon
Copy link
Collaborator Author

so we should just remove the line or should I assume it was doing something?

@matbesancon
Copy link
Collaborator Author

I wanted to replace the following:

-            MOIU.load_constraint(model.optimizer.model.optimizer, CI{F, S}(CONES_OFFSET[S]), func, set)
+            MOI.add_constraint(model.optimizer.model.optimizer, func, set)

but it seems some constraint types are not supported

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants