equinor / iterative_ensemble_smoother

Algorithms for data assimilation using ensemble methods.
GNU General Public License v3.0
17 stars 12 forks source link

Benchmark to make sure `groupby_indices` is necessary #200

Closed dafeda closed 8 months ago

dafeda commented 9 months ago

The idea of groupby_indices was put together while trying to make Troll run in reasonable time. Many things have changed since, and my benchmarking while working with Troll was not rigorous. This trick introduces some complexity and we should make sure it's worth it. I therefore think we should try running at least Drogon, and perhaps even Troll with and without it.

https://github.com/equinor/iterative_ensemble_smoother/blob/cf2c87270d31cbc1539e9d9cfb64f3167333233c/src/iterative_ensemble_smoother/experimental.py#L281-L295

dafeda commented 9 months ago

Ran with and without trick on a gaussian field with 1 million parameters, 50 observations and 25 realizations. The sigma=10 controls the smoothness of the field. It runs faster without the trick.

    p = 1 mill, m = 50, N = 25, sigma = 10
    With trick:    1.8s, 1.7s, 1.9s (Mean)
    Without trick: 1.3s, 1.2s, 1.3s (Mean)

image

I also ran Drogon with and without the trick and it runs much faster without the trick My conclusion for now is that the trick is faster when the field is very smooth which it does not seem to be in practice (Drogon). So, I suggest we remove it.