|
1 | 1 | # [Advice for performant SDE simulations](@id sde_simulation_performance)
|
2 |
| -While there exist relatively straightforward approaches to improve performance for [ODE](@ref ref) and [Jump](@ref ref) simulations, this is generally not the case for SDE simulations. Below, we briefly describe some options. However, as one starts to investigate these, one quickly reaches what is (or could be) active areas of research. |
| 2 | +While there exist relatively straightforward approaches to manage performance for [ODE](@ref ode_simulation_performance) and [Jump](@ref ref) simulations, this is generally not the case for SDE simulations. Below, we briefly describe some options. However, as one starts to investigate these, one quickly reaches what is (or could be) active areas of research. |
3 | 3 |
|
4 | 4 | ## [SDE solver selection](@id sde_simulation_performance_solvers)
|
5 |
| -We have previously described [how ODE solver selection](@ref ref) can impact simulation performance. Again, it can be worthwhile to investigate this for SDE simulations. Throughout this documentation, we generally use the `STrapezoid` solver as the default choice. However, if the `DifferentialEquations` package is loaded |
| 5 | +We have previously described how [ODE solver selection](@ref ode_simulation_performance_solvers) can impact simulation performance. Again, it can be worthwhile to investigate solver selection's impact on performance for SDE simulations. Throughout this documentation, we generally use the `STrapezoid` solver as the default choice. However, if the `DifferentialEquations` package is loaded |
6 | 6 | ```julia
|
7 | 7 | using DifferentialEquations
|
8 | 8 | ```
|
9 |
| -automatic SDE solver selection is automatically enabled (just like is the case for ODEs by default). Generally, the automatic SDe solver choice enabled by `DifferentialEquations` is better than just using `STrapezoid`. Next, if performance is critical, it can be worthwhile to check the [list of available SDE solvers](https://docs.sciml.ai/DiffEqDocs/stable/solvers/sde_solve/) to find one with advantageous performance for a given problem. When doing so, it is important to pick a solver compatible with *non-diagonal noise* and with [*Ito problems*](https://en.wikipedia.org/wiki/It%C3%B4_calculus). |
| 9 | +automatic SDE solver selection enabled (just like is the case for ODEs by default). Generally, the automatic SDE solver choice enabled by `DifferentialEquations` is better than just using `STrapezoid`. Next, if performance is critical, it can be worthwhile to check the [list of available SDE solvers](https://docs.sciml.ai/DiffEqDocs/stable/solvers/sde_solve/) to find one with advantageous performance for a given problem. When doing so, it is important to pick a solver compatible with *non-diagonal noise* and with [*Ito problems*](https://en.wikipedia.org/wiki/It%C3%B4_calculus). |
10 | 10 |
|
11 | 11 | ## [Options for Jacobian computation](@id sde_simulation_performance_jacobian)
|
12 |
| -In [the section on ODE simulation performance](@ref ref) we describe various options for computing the system Jacobian, and how these could be used to improve performance for [implicit solvers](@ref ref). These can be used in tandem with implicit SDE solvers (such as `ImplicitEM`). However, due to additional considerations during SDE simulations, it is much less certain whether these will actually have any impact on performance. So while these options might be worth reading about and trialling, there is no guarantee that they will be beneficial. |
| 12 | +In the section on ODE simulation performance, we describe various [options for computing the system Jacobian](@ref ode_simulation_performance_jacobian), and how these could be used to improve performance for [implicit solvers](@ref ode_simulation_performance_stiffness). These can be used in tandem with implicit SDE solvers (such as `STrapezoid`). However, due to additional considerations during SDE simulations, it is much less certain whether these will actually have any impact on performance. So while these options might be worth reading about and trialling, there is no guarantee that they will be beneficial. |
13 | 13 |
|
14 | 14 | ## [Parallelisation on CPUs and GPUs](@id sde_simulation_performance_parallelisation)
|
15 |
| -We have previously described how simulation parallelisation can be used to [improve performance when multiple ODE simulations are carried out](@ref ref). The same approaches can be used for SDE simulations. Indeed, it is often more relevant for SDEs, as these often are re-simulated using identical simulation conditions (to investigate their typical behaviour across many samples). CPU parallelisation of SDE simulations uses the same approach as for ODEs. For GPU parallelisation we |
| 15 | +We have previously described how simulation parallelisation can be used to [improve performance when multiple ODE simulations are carried out](@ref ode_simulation_performance_parallelisation). The same approaches can be used for SDE simulations. Indeed, it is often more relevant for SDEs, as these are often re-simulated using identical simulation conditions (to investigate their typical behaviour across many samples). |
| 16 | + |
| 17 | +CPU parallelisation of SDE simulations uses the [same approach as ODEs](@ref ode_simulation_performance_parallelisation_CPU). GPU parallelisation is carried out very similarly to [GPU parallelisation of ODE simulations](@ref ode_simulation_performance_parallelisation_GPU). The only difference is that a GPU-compatible SDE solver is required, with the only alternative currently available being `GPUEM`. |
16 | 18 |
|
17 | 19 | ### [Multilevel Monte Carlo](@id sde_simulation_performance_parallelisation_mlmc)
|
18 |
| -An approach for speeding up parallel stochastic simulations are so-called [*multilevel Monte Carlo approaches*](https://en.wikipedia.org/wiki/Multilevel_Monte_Carlo_method) (MLMC). These are used when a stochastic process is simulated repeatedly using identical simulation conditions. Here, instead of performing all simulations using identical tolerance, the ensemble is simulated using a range of tolerances (primarily lower ones, which yields faster simulations). Currently, [StochasticDiffEq.jl](https://github.com/SciML/StochasticDiffEq.jl) do not have a native implementation for performing MLMC simulations (this will hopefully be added in the future). However, if high performance of parallel SDE simulations is required, these approaches may be worth investigating. |
| 20 | +An approach for speeding up parallel stochastic simulations is so-called [*multilevel Monte Carlo approaches*](https://en.wikipedia.org/wiki/Multilevel_Monte_Carlo_method) (MLMC). These are used when a stochastic process is simulated repeatedly using identical simulation conditions. Here, instead of performing all simulations using identical [tolerance](@ref ode_simulation_performance_error), the ensemble is simulated using a range of tolerances (primarily lower ones, which yields faster simulations). Currently, [StochasticDiffEq.jl](https://github.com/SciML/StochasticDiffEq.jl) do not have a native implementation for performing MLMC simulations (this will hopefully be added in the future). However, if high performance of parallel SDE simulations is required, these approaches may be worth investigating. |
0 commit comments