OverLordGoldDragon / ssqueezepy

Synchrosqueezing, wavelet transforms, and time-frequency analysis in Python
MIT License
599 stars 92 forks source link

CuPy-only option for GPU #100

Closed nup002 closed 10 months ago

nup002 commented 10 months ago

Hello,

I use ssqueezepy extensively in many of my projects, and I have recently started using it with GPU acceleration, which works really well. Kudos to the developer.

I also use Cupy in most of my projects, so it is not a big deal that ssqueezepy depends on it also. But I never use PyTorch, and it is a huge dependency (both in size and complexity) which I would have been more than happy to skip. How feasible would it be to make PyTorch an optional dependency, relying only on Cupy?

Thank you.

OverLordGoldDragon commented 10 months ago

It's used mainly for FFT, though there's also cupy.fft. Torch also enables autograd, but that's not this library's standard.

I'm not willing to develop this, but contributions are welcome. Easiest would be to find CuPy equivalents to all torch syntax that ssqueezepy uses, in your own local branch, only on parts you need, so you don't have to worry about keeping your edits up to contribution standards.

nup002 commented 10 months ago

Thank you for the rapid answer. I will see if I can find the time to implement this. It would have to be done in a robust manner and made part of the package you distribute so that the users of my software that depends on ssqueezepy can benefit from it.