Skip to content
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

Is it possible enable multi-threading in RustFFT? #117

Open
Neutron3529 opened this issue Apr 14, 2023 · 3 comments
Open

Is it possible enable multi-threading in RustFFT? #117

Neutron3529 opened this issue Apr 14, 2023 · 3 comments

Comments

@Neutron3529
Copy link

Currently, fftw has a multi-threading option

Is it possible enable multi-threading in RustFFT?

I searched for keywords like parallel and thread but found nothing.

And a simple test shows a only 100% CPU time, which means RustFFT does not enable multi-threading by default.

Would RustFFT support multi-threading in the future?

@ejmahler
Copy link
Owner

ejmahler commented May 12, 2023

This could be done by adding a variant of the MixedRadix algorithm that uses rayon iterators instead of normal iterators for its inner width/height FFTs, and a custom transpose path that uses the rayon recursion feature. Then edit the planner to swap the topmost MixedRadix step with the multithreaded version. For Radix4, making that be multithreaded would be nontrivial. But what we could do is inject a ParallelMixedRadix step to divide the radix4 into 8 or 16 smaller radix4s.

And a similar process would need to be done for the AVX code path.

I'm not against it, the current architecture is explicitly designed to be highly modular to make changes like this possible, but it would be a relatively big undertaking.

@cpmech
Copy link

cpmech commented Apr 23, 2024

Quick, somewhat related question: Is RustFFT thread-safe? (noting that FFTW is not thread-safe)

@ejmahler
Copy link
Owner

ejmahler commented Apr 23, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants