Skip to content

Commit

Permalink
Merge branch 'main' of github.com:QuState/PhastFT
Browse files Browse the repository at this point in the history
  • Loading branch information
smu160 committed Feb 4, 2024
2 parents e05f92a + 2bb5c06 commit d3c40cb
Showing 1 changed file with 26 additions and 5 deletions.
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -69,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
Expand Down Expand Up @@ -103,6 +112,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
Expand Down

0 comments on commit d3c40cb

Please sign in to comment.