-
Notifications
You must be signed in to change notification settings - Fork 25
Remove dependency on MutableArithmetics #330
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
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #330 +/- ##
=======================================
Coverage 92.16% 92.16%
=======================================
Files 12 12
Lines 689 689
=======================================
Hits 635 635
Misses 54 54 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Why did you do this? I get a brutal slowdown, |
|
Do you have a reproducible example? |
|
Before your change julia> using JuMP, SCS
julia> model = Model();
julia> set = SCS.ComplexPositiveSemidefiniteConeTriangle(50);
julia> @variable(model, x[1:2500]);
julia> @variable(model, y[1:2500]);
julia> @time MOI.Utilities.set_dot(x,y,set);
0.370305 seconds (2.31 M allocations: 113.229 MiB, 4.22% gc time, 99.87% compilation time)
julia> @time MOI.Utilities.set_dot(x,y,set);
0.000867 seconds (19.64 k allocations: 1.191 MiB)After your change: julia> using JuMP, SCS
Precompiling SCS finished.
1 dependency successfully precompiled in 22 seconds. 56 already precompiled.
julia> model = Model();
julia> set = SCS.ComplexPositiveSemidefiniteConeTriangle(50);
julia> @variable(model, x[1:2500]);
julia> @variable(model, y[1:2500]);
julia> @time MOI.Utilities.set_dot(x,y,set);
0.295810 seconds (291.24 k allocations: 431.760 MiB, 45.06% gc time, 39.39% compilation time)
julia> @time MOI.Utilities.set_dot(x,y,set);
0.111543 seconds (106.55 k allocations: 422.962 MiB, 43.15% gc time) |
|
What about an example where it isn't called directly? You're passing in JuMP variables. In MOI, it's only really used to compute the dual objective value, and it will always have I'd be willing to just lock in many of the |
|
No, I'm not going to waste my time writing more examples. Perhaps you shouldn't change code around for no benefit? I wrote the function the way it's done in MOI. And it will certainly be used for numerical types other than |
|
My point was that, can you actually trigger this when using SCS.Optimizer? I don't think so.
But this bridge in SCS is not one of them? I dislike Julia code that is overly generic. @blegat can chime in. |
|
These functions aren't even covered by the tests: |
|
The point of writing this set was to incorporate it into MOI as the replacement for the complex PSD cone, as suggested by @blegat. It's supposed to be generic. |
|
We already have too many PSD cones in MOI. I don't want to add another. It can stay in SCS.jl. |
|
The point is not to add another set, but to replace one. |
|
My rule of thumb is: if a set is used by only one solver then the set and bridges should be defined by the solver. When it's used by several ones, we can move it to MOI. So at the moment it is in SCS but we may move it in the future. If it's moved in the future, the MA calls will be more appropriate, e.g. |
|
Hypatia already uses this set, so if we move it to MOI we can remove Hypatia's bridge. |
|
Indeed, I guess it would allow getting rid of |
|
Fair enough, I added |
No description provided.