From 7f4d44625eefc8aaca38d34d04341ddf3798c3c1 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Sun, 4 Feb 2024 19:11:15 +0000 Subject: [PATCH 1/2] Update README text to match latest benchmarks --- README.md | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 1bff4c6..60f9c67 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,15 @@ PhastFT is a high-performance, "quantum-inspired" Fast Fourier Transform (FFT) library written in pure Rust. -Despite its simplicity, it is competitive with and often outperforms -the fastest Rust FFT libraries, including [RustFFT](https://crates.io/crates/rustfft/). +Despite its simplicity, its performance is competitive with FFTW. +On large inputs it outperforms even the fastest Rust FFT libraries, including [RustFFT](https://crates.io/crates/rustfft/). ## Features -- Simple implementation using a single, general-purpose FFT algorithm. +- Performance on par with FFTW and far exceeding other Rust implementations +- Simple implementation using a single, general-purpose FFT algorithm - Zero `unsafe` code -- Takes advantage of latest CPU features up to and including AVX-512, but performs well even without them. +- Takes advantage of latest CPU features up to and including AVX-512, but performs well even without them - Optional parallelization of some steps to 2 threads (with even more planned) - 2x lower memory usage than [RustFFT](https://crates.io/crates/rustfft/) - Python bindings (via [PyO3](https://github.com/PyO3/pyo3)) @@ -103,6 +104,18 @@ submit a pull request. Follow the contribution guidelines outlined in the CONTRI ... +## PhastFT vs RustFFT + +[RustFFT](https://crates.io/crates/rustfft/) is another excellent FFT implementation in pure Rust. +RustFFT and PhastFT are optimized for different workloads. + +RustFFT performs best on small inputs that fit entirely into the L2 cache, +while PhastFT is optimized for large input sizes common in scientific computing. + +RustFFT made the choice to work on stable Rust compiler at the cost of `unsafe` code, +while PhastFT contains no `unsafe` blocks but requires a nightly build of Rust compiler +to access the Portable SIMD API. + ## What's with the name? The name, **PhastFT**, is derived from the implementation of the From d2f71f0d76a17f929b5a9d617ff250a735d32904 Mon Sep 17 00:00:00 2001 From: "Sergey \"Shnatsel\" Davidoff" Date: Sun, 4 Feb 2024 19:12:09 +0000 Subject: [PATCH 2/2] Expand on the Python installation instructions --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 60f9c67..a578abb 100644 --- a/README.md +++ b/README.md @@ -70,9 +70,17 @@ fn main() { ### Python +Follow the instructions at https://rustup.rs/ to install Rust, then switch to the nightly channel with + +```bash +rustup default nightly +``` + +Then you can install PhastFT itself: + ```bash pip install numpy -pip install git+https://github.com/QuState/PhastFT#subdirectory=pybindings +RUSTFLAGS='-Ctarget-cpu=native' pip install git+https://github.com/QuState/PhastFT#subdirectory=pybindings ``` ```python