QuantileDeltaMapping per month seems to be significantly slower than adjusting the months individually #1747
Replies: 2 comments 9 replies
-
Hi Sacha, thanks for this nice investigation. Two things: interpolation Say you obtain adjustment factors for the months of January and the month of February, how should we bias adjust jan 31rst? What your implementation with loops over months will do is to apply the adjustment factors of January to jan 31rst, correct? What xclim does is an interpolation between the results of January and February. I'm not 100% this causes the slowdown, a 16x slowdown seems a bit extreme for a simple interpolation, but it's useful to know right now the differences between those two codes! map_blocks So I think this might touch on a problem we are already aware of, but we don't have a definitive answer on how to improve things yet. |
Beta Was this translation helpful? Give feedback.
-
Potentially related, I am trying to understand why QuantileDeltaMapping is much slower when using chunked DaskArrays. For the numbers below I reduced the data again: t = xr.cftime_range("2010-01-01", "2030-12-31", freq="D", calendar="noleap")
lon = np.arange(0, 30, 1)
lat = np.arange(10, 40, 1) Without chunking training takes If I add |
Beta Was this translation helpful? Give feedback.
-
Setup Information
0.48.2
Context
I am using xclim's QuantileDeltaMapping for some bias adjustment and see significant performances differences if I use a monthly grouping (
group='time.month'
) compared to performing the adjustment in a loop per month. I understand that there is some logic that adds an extra month for circularity but in my head that doesn't add up to the differences. In my real world problem, the loop is 16x faster than usinggroup='time.month'
. In my example below its only 2x.I modified the example from the docs a little to create the data
The straight-forward approach I'd like to use takes around 3min:
If I do the same with a loop instead like below, it takes around 1.6min:
Any explanation why its like this or how I could improve the performance of the first approach?
Steps To Reproduce
No response
Beta Was this translation helpful? Give feedback.
All reactions