Skip to content

Multi-thread in FFT doesn't work #285

@xinxing02

Description

@xinxing02

Trying to evaluate the parallel efficiency of openTSNE (with FFT) as in https://opentsne.readthedocs.io/en/stable/benchmarks.html, but didn't see significant acceleration in the optimization step while increasing n_jobs.

Used Claude to dig a bit deeper, and here is what it found:

  1. if compiled with FFTW3, the code never calls fftw_init_threads()/fftw_plan_with_nthreads(). Without those calls, FFTW3 always runs single-threaded regardless of OMP_NUM_THREADS or n_jobs.
  2. if compiled with numpy fft
    • OpenBLAS — FFT is single-threaded (OpenBLAS only parallelizes BLAS/LAPACK, not FFT)
    • MKL (Intel) — FFT is multi-threaded via MKL_NUM_THREADS
    • FFTPACK (NumPy's built-in fallback) — single-threaded

Just to confirm, is the scaling plot provided in https://opentsne.readthedocs.io/en/stable/benchmarks.html done with numpy fft + MKL, in order to achieve the demonstrated performance?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions