Does scipy have a standard way of using simd?

I was using scipy.signal.decimate and ran in to some performance issues for dropping the sample rate of some RF signals. I made a patch locally that worked for my use case that used simde to accelerate the inner loop and a pragma with two threads to get ~8x faster on avx2 and apple silicon. I wanted to upstream the patch, or, something similar that would meet scipy’s guidelines but I’m not sure where to look for coding standards or if cross platform simd support is a thing that’s currently readily available? I see that numpy is shifting to using C++ and google highway based on nep 54, is that something that scipy is also working towards?

1 Like

As far I know, SciPy makes very little use of SIMD, aside from compiler auto-vectorization.

Even for that, most files don’t have auto-vectorization turned on, (e.g. scipy/spatial/src/distance_wrap.c turns it on) and we make fairly conservative assumptions about what SIMD extensions are supported. For example, on x86_64 we don’t assume that SSSE3 is available - just extensions that are common to all x86-64-v1 targets.

Note that I am fairly unskilled with meson/C++, so you should take the preceding with a grain of salt.