-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Warning about compilation times (#467)
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Troubleshooting | ||
|
||
## Long compilation times | ||
|
||
If a solution routine takes surprisingly long to compile but then executes quickly, | ||
it may be due to the choice of Taylor-coefficient computation. | ||
Automatic-differentiation-based routines such as Taylor-mode or forward-mode Taylor-series | ||
estimation JIT-compile the ODE vector field $\nu$, respectively $\nu(\nu+1)/2$ times | ||
for $\nu$ derivatives in the state-space model (commonly referred to as `num_derivatives`). | ||
On top of this, the vector field is compiled a final time for the "actual" simulation. | ||
|
||
As a solution, either reduce the number of derivatives | ||
(if that is appropriate for your integration problem) | ||
or switch to a different Taylor-coefficient routine. | ||
For example, use | ||
```python | ||
simulate_terminal_values(..., taylor_fn=taylor.make_runge_kutta_starter_fn()) | ||
solve_and_save_at(..., taylor_fn=taylor.make_runge_kutta_starter_fn()) | ||
# etc. | ||
``` | ||
instead of | ||
```python | ||
simulate_terminal_values(..., taylor_fn=taylor.taylor_mode_fn) | ||
solve_and_save_at(..., taylor_fn=taylor.taylor_mode_fn) | ||
# etc. | ||
``` | ||
For $\nu < 5$, switching to Runge-Kutta starters should preserve performance of the solvers. | ||
High-order methods, e.g. $\nu = 9$ are only possible with `taylor_fn=taylor.taylor_mode_fn`. | ||
|
||
|
||
## Other problems | ||
Your problem is not discussed here? Please open an issue! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters