[SciPy-Dev] Discussion on backend system for scipy.fftpack

Ralf Gommers ralf.gommers at gmail.com
Sun Feb 3 16:04:49 EST 2019


apologies for the slow reply; I'll be low on bandwidth for another 1-2 weeks


On Sun, Jan 6, 2019 at 11:46 PM Sourav Singh <ssouravsingh12 at gmail.com>
wrote:

> Hello,
>
> I am writing the mail to start a discussion on the backend system for
> scipy.fftpack.
>
> I am currently looking into ways of implementing a backend system and have
> found that the Keras library's method for backend to be elegant.
>
> The Keras library maintains separate modules for each backend, which has
> their own classes and functions for operations and session creation. The
> default backend can be set up through a configuration or a flag of some
> kind.
>

One or both of a config file and an environment variable could be useful,
but in Keras they're the only ways to choose a backend it seems, which is
odd. Possibly due to it not easily being possible to mix calls to different
backends within one program, but we have no such limitation for FFTs -
every call is independent of the next one. The main method we'd want is the
ability to set it in code, via some global singleton. A context manager
would be useful too (ala np.errstate).


> So far we have numpy.fft, scipy.fftpack, pyFFTW and cupy(I am not sure
> about having this) for FFT ops.
>

There's mkl-fft as well.

In SciPy we'd only want one default implementation (pocketfft), and a
well-defined method for external packages to provide their own backend.
Maybe the latter can indeed be borrowed from Keras.

Cheers,
Ralf


> I would like to discuss further about the decisions on the kind of backend
> system that would be required so I can design a document containing class
> diagrams and such.
>
> Thanks for taking the time to read my email and have a great day!
>
> Regards,
>
> Sourav
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at python.org
> https://mail.python.org/mailman/listinfo/scipy-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20190203/03d0d5ac/attachment.html>


More information about the SciPy-Dev mailing list