-
-
Notifications
You must be signed in to change notification settings - Fork 398
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
[docs] add Dualization tutorial #3402
Conversation
Codecov ReportPatch and project coverage have no change.
Additional details and impacted files@@ Coverage Diff @@
## master #3402 +/- ##
=======================================
Coverage 98.05% 98.05%
=======================================
Files 34 34
Lines 4926 4926
=======================================
Hits 4830 4830
Misses 96 96 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some small tweaks.
I'll leave you to it: the commit was me not understand the github editor.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as resolved.
This comment was marked as resolved.
Pushed a local fix here. But I'll fix upstream SCS.jl |
So I'm going to push back on the suggestion that we should use Dualization in other tutorials. This is an extra for experts thing, and the addition of I think a compromise might be to drop some **Pointing them to a technical page on conic duality and the implementation of a specific solver is not an answer. Even the YALMIP docs, https://yalmip.github.io/command/dualize/, https://yalmip.github.io/tutorial/automaticdualization, point out that the user will likely be confused reading their documentation: |
We shouldn't distract the user, we can just refer to the dualization tutorial saying that it's not specific to this tutorial so it's not a prerequisite for understanding the tutorial. It is however very important. We already had many users on discourse that were wondering why JuMP is slower than YALMIP. And that's only a fraction of users encountering this issue. Throwing users at conic formulation without mentioning that they should check dualization is like throwing someone in a fight without a sword. The argument should rather be whether we should mention dualization on tutorials that happen to be in the SCS format so we don't need it. Moreover, if we show the SCS log in the tutorial, the user will see that the dimensions are much larger than he would expect. When you read the documentation of SCS, it does not say in which format you should input it, dual or primal. We made an arbitrary decision when writing the MOI wrapper and the user cannot guess what this is. If we don't say anything, the user should expect that we dynamically choose the right one. But we don't, we just bridge to the format that we arbitrarily chose. Since we're not doing the right thing and leave to the user the job to dualize when needed we should at least let the user know about this responsibility. Because, intuitively, the user would think that we're doing it for him.
I don't think this is what is meant. He is just referred to the previous 2 sentences that are purposely meant to be confusing (by using twice the words primal and dual) to emphasize that YALMIP is doing to nice things under the hood. |
See also #3408 |
Thanks! Another way to look at it. Here it looks like we give a lot of theoretical explanation on the dual, exemplified by the MAX-CUT only. and then for the conic example, we say we don't want to make the exercise and the user to figure it out by himself. If instead we say: in all conic examples, we are always dualizing if it's purely in one of the two forms then at least it gives the user more examples to practice his understanding. Otherwise it's like giving an exam directly after a lecture without a TA session ^^ In |
Copying your comment from: #3399 (comment)
Ah! So this is our source of disagreement then. If this is the case, then yes, it should be in every conic tutorial. And we should run examples with both SCS and Clarabel (for example) to show the difference. And it isn't sufficient just to sprinkle But stepping back, if it's that important, shouldn't we choose to dualize automatically? (I think cvxpy does this?) This feels like the wrong decision to force users to learn. |
But it is 'try it out' because if the use SCS then they should, but if they use a different solver then maybe they shouldn't. And we don't have good documentation for each solver on whether it expects the standard or geometric forms so there's no way for the average user to tell. |
We probably should but unless it's pure standard or pure geometric, we don't really know which form to use. One idea would be to see the total sum of bridge cost for dualized and non-dualized version and choose that one. Then should be multiply the bridge cost by the number of constraints of that type ? So we could have an automatic mode doing this and then a manual mode where the user sets whether he want it dualized or not. Even if we have that in the future, we should mitigate this issue in the meantime.
Yes, it is "try it out". The message is "always try both", I think that's what your tutorial conveys when you say that if they plan to solve it multiple times or for a large instance then first try both and then choose and then run the large computational workload. Understanding why one is better is for the curious users but they don't need to understand why (if there was a need to understand why something works then ML/AI wouldn't be a thing :D) |
Co-authored-by: James Foster <[email protected]>
Co-authored-by: James Foster <[email protected]>
Co-authored-by: Benoît Legat <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once the missing word is added
Co-authored-by: Benoît Legat <[email protected]>
x-ref #2348
https://jump.dev/JuMP.jl/previews/PR3402/tutorials/conic/dualization/