Improving performance of vectorized interpolation in Xarray #11236
Replies: 1 comment 3 replies
-
|
My suspicion is that we can we something very efficient (at least for linear interpolation), by writing the operation ourselves in terms of shifted indexing operations. Once you have the appropriate indexes calculated, implementing linear interpolation like For Xarray, we would replace indexing like |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
In Parcels we do a lot of point-wise interpolation onto ocean model data. We do this by first (a) looking up of the barycentric particle positions on the staggered curvilinear mesh, then (b) using these positions to use xarrays vectorized interpolation to get the data.
We're quite invested in the performance of Xarray vector interpolation (doing some initial profiling it looks like that where the majority of performance is left on the table). @shoyer you were mentioning during the xarray dev meeting that you think the vectorized interpolation in xarray can be improved, could you provide more details?
I'm still getting into all this, so this attach plan might not be fully formed: To deal with (a), I'm thinking of looking into Xarrays flexible indices - to see if we can define indices that allow us to easily from particle lat/lon look up position in the staggered mesh. For (b), I'm hoping this discussion topic provides more insight - maybe there are lower level public xarray endpoints that we can hook into (or, longer term, improvements that we can bring back upstream into Xarray)
I'm happy to provide performance profiles/tracing as part of this.
Feedback/tips are welcome.
Beta Was this translation helpful? Give feedback.
All reactions