-
Notifications
You must be signed in to change notification settings - Fork 5
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
Global sparsity detection with control flow #90
Comments
Example where the sparsity pattern depends on whether The trouble is that we need to explore both branches to give a global pattern that holds for different values of |
We can support |
The real issue is having to decide what comparisons like However, having comparisons return tracers could lead to all kinds of problems, including code invalidations in Julia Base. And without comparisons on non-dual tracers, control flow is basically useless. Note that all of this is just to support |
Indeed we can't, but supporting
I actually had a different overloading scheme in mind:
That is indeed a valid worry, and it goes against the specification of comparison operators:
|
I think your way of returning a tracer would be better, because it also allows the quantity |
I mirror a lot of the worries that have been expressed in here. I suggest we try out overloading |
Done. AMPGO07.jl now passes, but it's a trivial scalar-in-scalar-out function. Would be interesting to see how many other problems in #83 this solves @gdalle. |
I think the distinction between ForwardDiff and Symbolics is arbitrary. We can do just as much damage with operator overloading (and to some extent that's also how Symbolics works). The question is only how much we want to overload.
As you see in the Discourse thread, "abstract interpretation" is ill-defined. We are already doing abstract interpretation, by reinterpreting scalar operations to work on index sets. So it's not a good concept to use for clarification purposes. |
Ideally we want all of the problems in the OptimizationProblems.jl test suite to be amenable to global sparsity detection, because the sparsity pattern must be reusable for various At the moment we don't see these problems because I fall back on local tracing every time. The real test would be to remove these fallbacks in #83. |
Upsides:
Downsides:
|
The result of the comparison should be a tracer, at least for
In a way, |
We need to handle both branches of
ifelse
so that global sparsity patterns may be reused at different pointsx
Maybe with a "branch analysis" option
The text was updated successfully, but these errors were encountered: