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

Add preparation mechanism #218

Open
adrhill opened this issue Nov 28, 2024 · 0 comments
Open

Add preparation mechanism #218

adrhill opened this issue Nov 28, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@adrhill
Copy link
Owner

adrhill commented Nov 28, 2024

SCT could benefit from the addition of a preparation mechanism.
The following points primarily apply to local patterns, but don't harm global pattern detection.

1. Heuristics for the selection of pattern representations

The benchmarks in #211 have (once again) shown that there is no free lunch when it comes to the best internal pattern representation, as it depends on (a) the sparsity of the given function and (b) the size of index sets over the entire compute graph. The most-user friendly solution to this problem would be to introduce a heuristic, e.g. on input size1.

Since such a run-time selection of internal types is by definition type unstable, this heuristic should be moved outside of any hot loops, e.g. by moving it to a type-unstable preparation mechanism.

2. Avoid repeated input enumeration

Local pattern detection methods currently enumerate index sets on every call. This could be avoided by returning a reusable buffer when calling the preparation mechanism.

This feature will get more important in the context of reusable chunked index sets (see #194).

3. Chunked Hessian detection?

A preparation mechanism for Hessian patterns that first computes a global hessian pattern might be a possible avenue for chunked local Hessian detection.

4. Composability with DI

Ideally, SCT's preparation mechanism should be designed with DI's preparation of AutoSparse backends in mind, as the former should be called within the latter (CC @gdalle).

Footnotes

  1. In theory, the heuristic for local pattern detection could also call global pattern detection methods to get an upper estimate of the sparsity of a Jacobian/Hessian in addition to the input size.

@adrhill adrhill added the enhancement New feature or request label Nov 28, 2024
@adrhill adrhill self-assigned this Nov 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant