-
Notifications
You must be signed in to change notification settings - Fork 35
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
Use autodiff in screening routines #1588
Conversation
039dfe0
to
c46c04d
Compare
Performance comparisons, using
CPU, without derivatives (n_cell=128, loops=1):
CUDA, with derivatives (CUDA_LTO=TRUE, n_cell=64, loops=100):
CUDA, without derivatives (CUDA_LTO=TRUE, n_cell=64, loops=100):
|
cd77340
to
0f83ed6
Compare
Needs #1593 |
Only unit_test/test_screening_templated compiles at the moment.
They should only be needed in `RHS::jac()`.
The extra precision of std::log1p only matters at very small gamma, and will be completely overshadowed by the imprecision of fast_atan().
7f43311
to
3758386
Compare
all the Jacobian diffs in the test suite are roundoff level, so this seems to be working well. |
This PR gives the same results for
test_screening
to within roundoff, and the performance is about the same or slightly better. It also adds a page to the docs about how to use the autodiff library.One notable change is that the templated networks don't calculate the derivative terms when screening is called from
RHS::rhs()
(this is also how the pynucastro networks behave). Previously, they would be calculated unnecessarily ifintegrator.jacobian
was set to 1.