cupy icon indicating copy to clipboard operation
cupy copied to clipboard

`cp.logaddexp.reduce`

Open jcrist opened this issue 4 months ago • 3 comments

Description

In cuml we have a need for an API similar to numpy.logaddexp.reduce. For now I'm getting by with a custom cupy.ReductionKernel, but it would be nice if this API was supported. Currently cupy.logaddexp.reduce raises a NotImplementedError.

Additional Information

No response

jcrist avatar Sep 15 '25 15:09 jcrist

Discussed briefly with @shwina. This is the kind of tasks that I'd love to easily support using cuda.cccl.parallel (example, RFC), instead of homegrown solutions! 😄

leofang avatar Sep 16 '25 00:09 leofang

xref #7082

kmaehashi avatar Sep 16 '25 05:09 kmaehashi

I'll note that logaddexp isn't good at being "reduced" in NumPy. SciPy has a scipy.special.logsumexp which should be used and already exists in cupyx.scipy.special!

(I can see moving that into NumPy if it helps, but that seems unrelated. It may also be that the cupyx.scipy.special implementation can use optimization, as it is just Python code!)

seberg avatar Oct 01 '25 09:10 seberg