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

DOCS: Extra sections on the performance page #3813

Open
JHopeCollins opened this issue Oct 21, 2024 · 2 comments
Open

DOCS: Extra sections on the performance page #3813

JHopeCollins opened this issue Oct 21, 2024 · 2 comments

Comments

@JHopeCollins
Copy link
Contributor

JHopeCollins commented Oct 21, 2024

Following on from a recent discussion on slack, it would be useful to add some more sections to the manual page on performance. Some possible topics include:

  1. Using Constant or Real instead of float to avoid recompiling kernels every time the value changes.
  2. Setting constant_jacobian=True if the coefficients in a LinearVariationalProblem don't change between solves (or if they don't change every time, and use the invalidate_jacobian() method).
  3. Consider changing to an iterative method instead of the default LU once you scale up past smaller test problems.

Where to find
https://www.firedrakeproject.org/optimising.html

Additional info
Flamegraphs of before/after each change would be nice, and adding them to the existing "Calling solve repeatedly" section.

@pbrubeck
Copy link
Contributor

Regarding 2. aren't we clever enough to do this automatically if coefficient.dat.dat_version did not change for every coefficient in form.coefficients() since the last time we assembled?

@JHopeCollins
Copy link
Contributor Author

Maybe, but we don't. You also need to look at all the Constants in the form not just the dats. There may well be other things you'd need to check to do it reliably.

Combined with defaulting to LU, having constant_jacobian=False as the default can be a big performance hit so it should be in this manual section.

If we start doing it automagically then we can take that topic out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants