-
Notifications
You must be signed in to change notification settings - Fork 32
crps ensembles is faster and more robust #694
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
crps ensembles is faster and more robust #694
Conversation
8a6fc61
to
f07ea42
Compare
I've done some performance testing and this approach leads to some big speed-ups. I also refactored the unit tests as I was adding more |
One additional change that I would like to make before this is merged is to add an additional arg to be able to choose where or not to use dask to parallelise the loop. It will need a little refactoring. |
I have started some investigation in response to this. I think more realistic testing is needed. So far on synthetic data, the new unvectorised option is faster than the original code. Should that bear out, then the original code should be replaced rather than having the flags added. Using dask didn't seem to change the execution time particularly, but didn't hurt either. |
I have some some benchmarking. I don't think that the parallelisation of the loop with dask offers any significant benefit. For 40x40 fcst/obs with 700 ensemble members:
For higher ensemble member counts memory errors start occurring. Even using dask is problematic as it has to do a extremely large broadcast For 600x600 fcst/obs with 50 ensemble members:
For 1200x1200 fcst/obs with 50 ensemble members:
I plan to simplify this to only do an unvectorised calculation with no dask option. I'll create a separate issue to explore if numba + xr.apply_ufunc can be used to speed up the for loop |
31e84f7
to
16f13ba
Compare
@tennlee I have simplified this pull request to only contain the simple loop calculation of the forecast spread term. I left in the refactoring of the unit tests as you will see. |
Thanks, this looks great. I'll merge it shortly. |
No description provided.