question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tracker: cupyx.scipy.interpolate

See original GitHub issue

Description

This is an issue to keep track of the current improvement work to the cupyx.scipy.interpolate module. The order of the checkboxes denote the planned order and priority of implementation of each module. This plan was devised by @ev-br and is subject to change and discussion.

First phase

Second phase (details subject to change)

  • RegularGridInterpolator: methods cubic, quintic, slinear, pchip
  • Interpn: alias to RegularGridInterpolator
  • CubicBSpline
  • splantider, splderhttps://github.com/cupy/cupy/pull/7086
  • BPoly
  • NdPPoly

QHull-dependent modules

  • make_lsq_spline
  • interp1d: @ev-br states that it could be ignored (maybe?)

“Odds and ends”

Problematic modules and functions

QHull-dependent

  • `CloughTocher2DInterpolator
  • LinearNDInterpolator
  • NearestNDInterpolator
  • griddata: a wrapper over the above three
  • RBFInterpolator(..., neighbors=not None): Depends on KD-Tree

FITPACK code (Black-box Fortran code)

  • BivariateSpline
  • LSQBivariateSpline
  • LSQSphereBivariateSpline
  • RectBivariateSpline
  • RectSphereBivariateSpline
  • SmoothBivariateSpline
  • SmoothSphereBivariateSpline
  • UnivariateSpline
  • InterpolatedUnivariateSpline
  • LSQUnivariateSpline
  • bisplev
  • bisplrep
  • insert
  • spalde
  • splev
  • splint
  • splprep
  • splrep
  • sproot

Deprecated APIs

  • Interp2d
  • Rbf

New APIs (not available in SciPy main)

  • make_smooth_spline
  • NdBSpline

Please feel free to discuss any changes to this roadmap/exploration.

cc @rgommers @ev-br

Additional Information

No response

Issue Analytics

  • State:open
  • Created 10 months ago
  • Reactions:16
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

3reactions
ev-brcommented, Nov 14, 2022

I guess I’d need to explain a bit the ordering here. This is indeed opinionated 😃 and is very much up to a discussion.

First phase: once these are all done, cupyx.interpolate can be declared MVP: most common usage is possible. The first phase work can be done partly asynchronously:

  • make_interp_spline is a factory which constructs BSpline instances from data.
  • PPoly is a base class (similar to BSpline) needed for actual interpolators. CubicHermiteSpline is a PPoly subclass, which is then the base for pchip, akima and CubicSpline. The hard part is I guess PPoly, as it has cython code / needs C kernels. The rest is pure python.
  • CubicSpline is listed in the 2nd phase mainly because its functionality is a subset of make_interp_spline. Since the work on BSpline is already quite far, I don’t see a reason to not finish it up. (Did I mention that the list is opinionated?)
  • RGI is independent
  • RBF is independent

So the first phase seems to have four lines of work which can be done in parallel: BSpline/make_interp_spline, PPoly and subclasses, RGI, RBF. In principle, once can pospone the BSpline work and concentrate on PPoly instead if there is a strong feel for it.

The second phase:

There is a small typo (which propagates from the original where I made this typo): BPoly, NdPPoly, CubicSpline and interp1d are not Qhull-based.

BPoly is very similar to PPoly but less used (Mainly superseded by CubicHermiteSpline), NdPPoly is underused, so can be left for later. interp1d is legacy.

All these can be pushed to later, after the QHull based stuff is done. And that needs qhull or a cuda analog. Is there a triangulation library for CUDA we can depend on?

The last big question is what to do with FITPACK based smoothing splines. Hopefully this question can be postponed 😃.

1reaction
rgommerscommented, Nov 21, 2022

If I wanted to contribute to this work, how would I do it? Do I just pick something from the list without a check mark or a link to a pull request, and start working on it?

You can just pick something and start digging in, CuPy welcomes PRs from everyone and it doesn’t require pre-assigning a topic. However, given that this tracker is currently quite actively being worked on, I would suggest that once you’ve looked into a particular API for a little bit and think it’s a good fit for you, to post here that you’re tackling it - just to avoid double work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Tracker] Implement all scipy.* APIs in CuPy #6324 - GitHub
This is a tracker issue that summarizes the implementation status of each ... scipy.interpolate ) ( Tracker: cupyx.scipy.interpolate #7186) ...
Read more >
Interpolation (cupyx.scipy.interpolate) — CuPy 12.0.0b2 ...
Compute the (coefficients of) interpolating B-spline. splder (tck[, n]). Compute the spline representation of the derivative of a given spline.
Read more >
CuPy Documentation - Read the Docs
CuPy is a NumPy/SciPy-compatible array library for GPU-accelerated computing with Python. CuPy acts as a drop-in replacement to run existing NumPy/SciPy ...
Read more >
Use CUB reduction classes in cupyx.jit (#7145)
Increased coverage of cupyx.scipy.interpolate APIs, which now includes BSpline ... Check the tracking issue (#7082) for detailed information.
Read more >
cuCIM API Reference - RAPIDS Docs
<not supported yet> If buf is specified (buf's type can be either numpy object that ... Use interpolation to get a mix of...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found