-
Notifications
You must be signed in to change notification settings - Fork 23
implement dpnp.nanmedian
#2191
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
implement dpnp.nanmedian
#2191
Conversation
View rendered docs @ https://intelpython.github.io/dpnp/index.html |
Timing for Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Data Center GPU Max 1100 12.60.7 [1.6.31294+9]
Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8480+ OpenCL 3.0 (Build 0) [2024.18.9.0.28_160000] import dpnp, numpy
a = numpy.ones((16*8192, 32))
axis = 1
%timeit numpy.median(a, axis=axis)
a_cpu = dpnp.array(a, device="cpu")
%timeit dpnp.median(a_cpu, axis=axis); a_cpu.sycl_queue.wait();
a_gpu = dpnp.array(a, device="gpu")
%timeit dpnp.median(a_gpu, axis=axis); a_gpu.sycl_queue.wait();
|
Timing for Intel(R) oneAPI Unified Runtime over Level-Zero, Intel(R) Data Center GPU Max 1100 12.60.7 [1.6.31294+9]
Intel(R) OpenCL, Intel(R) Xeon(R) Platinum 8480+ OpenCL 3.0 (Build 0) [2024.18.9.0.28_160000] import dpnp, numpy
a = numpy.ones((16*8192, 32))
axis = 1
# Randomly set some elements to NaN:
w = numpy.random.random((len(a.shape), 200)) * numpy.array(a.shape)[:, None]
w = w.astype(numpy.intp)
a[tuple(w)] = numpy.nan
%timeit numpy.nanmedian(a, axis=axis)
a_cpu = dpnp.array(a, device="cpu")
%timeit dpnp.nanmedian(a_cpu, axis=axis); a_cpu.sycl_queue.wait();
a_gpu = dpnp.array(a, device="gpu")
%timeit dpnp.nanmedian(a_gpu, axis=axis); a_gpu.sycl_queue.wait();
|
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.
Thank you @vtavana, LGTM!
In this PR,
dpnp.nanmedian
is implemented.