-
Notifications
You must be signed in to change notification settings - Fork 1
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
Local sparsity support with ADTypes #72
Comments
We could add local tracing as a kwarg to For this reason, I would argue that local and global sparsity detection should be distinguished between on the level of ADTypes. |
First of all, if we add it it should be as a type parameter to enable dispatch.
It's not "packages" who decide when to recompute the sparsity pattern, it's users. They make the call as to whether Even what we call "global sparsity" depends on the control flow, so it's not robust to any change in |
This is not the issue. The issue is that in DI, |
Okay but that is something we want to warn users about, not explicitly forbid. The same warning holds for other types of preparation, like the tape in ReverseDiff: it depends on the control flow, and thus possibly on some values inside |
My point is basically holding the hand of the user: there is never any use to call |
Yes there is, because even when you compute a one-time Jacobian, jacobian(f, backend, x) = jacobian(f, backend, x, prepare_jacobian(f, backend, x)) |
In such cases, the user wouldn't call |
Yeah, now I see the issue. |
Basically
|
Then let's make it explicit and add a separate |
Sure |
I think our
TracerSparsityDetector
should offer the option to use either local or global patterns.I don't think it should be the job of ADTypes to provide that distinction, and here's why: the notion of "sparsity" is intrinsically ill-defined.
Our concept sparsity is not the same as that of Symbolics (for instance wrt dependency on control flow
if/else
), which may not be the same as that of a pre-specified pattern.It's not up to ADTypes to define a complete classification of the various types of sparsity. Rather, the sparsity detectors themselves should document their approach and limitations, and offer all the necessary toggles
The text was updated successfully, but these errors were encountered: