GPU-Accelerated Ensemble Simulation with Randomized Decay Rates #345
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Checklist
contributor guidelines, in particular the SciML Style Guide and
COLPRAC.
Additional context
This pull request adds a new tutorial to the DiffEqGPU.jl documentation. The new file, gpu_ensemble_random_decay.md, is placed in the docs/src/tutorials/ directory. The tutorial demonstrates how to perform GPU-accelerated ensemble simulations using a simple exponential decay ODE where each trajectory is assigned a random decay rate (λ sampled uniformly from [0.5, 1.5]).
Key points of the tutorial include:
1) Problem Setup:
We define an exponential decay ODE u′(t)=−λu(t) with a fixed initial condition and time span. We then use an EnsembleProblem with a prob_func to randomize λ for each ensemble member.
2) GPU & CPU Comparisons:
The tutorial shows how to run the ensemble on both GPU (using GPUTsit5() with EnsembleGPUKernel(CUDA.CUDABackend())) and CPU (using Tsit5() with EnsembleThreads()). Timing measurements are provided to illustrate the performance differences.
3) Statistical Analysis & Visualization:
It computes the ensemble statistics (mean and standard deviation) for u(t)u(t) over time and produces plots showing the ensemble's mean trajectory with ±1 standard deviation, along with a histogram of final values.
4) Reproducibility and Robustness:
A fixed random seed is set to ensure reproducibility, and the code includes checks to gracefully handle environments without a GPU.
This tutorial is intended to serve as both an educational resource and a practical example of how DiffEqGPU can be used for uncertainty quantification and sensitivity analysis through ensemble simulations.
I have tested the tutorial locally, ensured it builds with the documentation, and updated the tutorial index so that it appears alongside the other examples. Feedback and suggestions are welcome.
Thank you!
Parya