-
Notifications
You must be signed in to change notification settings - Fork 59
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
Speed up quantiles with sorting #1513
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Welcome, new contributor! It appears that this is your first Pull Request. To give credit where it's due, we ask that you add your information to the
Please make sure you've read our contributing guide. We look forward to reviewing your Pull Request shortly ✨ |
for more information, see https://pre-commit.ci
For a 30 years period, over QC, the bias adjustment (first initial DQM + Npdf + restore) with these parameters:
took 8 hours for this branch and 8h40 for the master. EDIT: Not sure if it makes a difference but, the test for this branch ran mostly during work hours and the test for the master ran during the night. UPDATE: It took 6h30 with branch |
Small FYI, you need to add the notebook to the |
This is really interesting, thanks. I totally support you taking over this PR, I don't really have time to work on it these days. |
During testing, I had made a version of Abel's |
… into speed-up-quantile
Should be good to go, I added a few tests |
@Zeitsperre under |
Note It appears that this Pull Request modifies the On inspection, the No further action is required. |
@aulemahal I leave you to do the final review and merge. I won't pretend to be the expert here. |
@SarahG-579462 can you inspect a last time? Should be good now |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! a note about fastmath below.
Pull Request Checklist:
number
) and pull request (:pull:number
) has been addedWhat kind of change does this PR introduce?
nbutils.quantile
has a speed-up of more than 2.5x by a combination of changes innbutils.quantile
andnbutils._quantile
nbutils.vec_quantiles
(used foradapt_freq
) but similar principles could be usedfastnanquantile
module which is very fastDoes this PR introduce a breaking change?
No
Other information:
nbutils._quantile
is a 1d jitted version ofxclim.core.utils._nan_quantile
benchmarks/sdba_quantile.ipynb
, attached to this PR.