Comments (4)
Also, RegularGridInterpolator is for ndim> 1 data. Using it for 1D is bound to incur extra overhead as compared to cupy.interp or 1D interpolators from cupyx.scipy.interpolate namespace.
from cupy.
NumPy has its dispatch mechanism and when numpy.interp
take a CuPy ndarray, it dispatches the input to cupy.interp
. So what you're seeing is eventually the result of calling cupy.interp
.
from cupy.
I (accidentally) found that
numpy.interp
can take cupy arrays as inputs and run directly on the GPU device.
As @takagi suggested it is executed by CuPy, using mechanism described in NEP 18.
Also note that time.perf_counter()
cannot be used for benchmarks that involves asynchronous GPU execution. (see https://docs.cupy.dev/en/latest/user_guide/performance.html#benchmarking for details)
I can observe significantly faster computation using
numpy.interp
instead ofcupyx.scipy.interpolate.RegularGridInterpolator
andcupyx.scipy.interpolate.interpn
.
There is a functional difference between them - cupy.interp
only supports 1-D but the latter supports N-D.
from cupy.
Thank you very much for those very complete explanations.
Best wishes
from cupy.
Related Issues (20)
- Failures to compile on operations on boolean arrays HOT 3
- RFC: Seeking feedback on adding new special functions from SciPy HOT 5
- Support NumPy 2.0 HOT 5
- cp.unique without sorting HOT 4
- `cupyx.scipy.sparse.bmat` default return format is different than `scipy.sparse.bmat` HOT 1
- cufft call with callback producing CUFFT_INTERNAL_ERROR HOT 2
- libnvrtc not found, v13 HOT 6
- Might be a bug with ReductionKernel and stream capture HOT 4
- Test with Ubuntu 24.04
- Jitify is performing a one-time only warm-up to populate the persistent cache HOT 7
- cp.unique runs forever HOT 2
- cupy.sign(NaN) == 0, unlike numpy HOT 9
- [Deleted]
- `cupyx.scipy.sparse._csr.csr_matrix.getcol()` -1 indexing
- Build error on main under Windows w/ CUDA 12.2 HOT 3
- how to properly import cupyx submodules HOT 2
- Support CUDA 12.5
- The version number on main seems to be out of date HOT 2
- cupy do not suport two axis operation? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cupy.