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

Fft optimize #120

Merged
merged 7 commits into from
Jul 19, 2021
Merged

Fft optimize #120

merged 7 commits into from
Jul 19, 2021

Conversation

yosupo06
Copy link
Collaborator

This PR introduces 4-bases FFT for convolution and speed up. The result of benchmark is as follows:

Before:

-------------------------------------------------------------------
Benchmark                         Time             CPU   Iterations
-------------------------------------------------------------------
CONV_same_length/1             13.8 ns         13.8 ns     50392558
CONV_same_length/2             17.4 ns         17.4 ns     40197565
CONV_same_length/4             29.9 ns         29.9 ns     23621755
CONV_same_length/8             84.7 ns         84.7 ns      8243246
CONV_same_length/16             306 ns          306 ns      2279322
CONV_same_length/32            1171 ns         1171 ns       596264
CONV_same_length/64            2864 ns         2864 ns       240826
CONV_same_length/128           6082 ns         6082 ns       114430
CONV_same_length/256          13056 ns        13056 ns        53707
CONV_same_length/512          27946 ns        27946 ns        24995
CONV_same_length/1024         60019 ns        60019 ns        11825
CONV_same_length/2048        125968 ns       125967 ns         5524
CONV_same_length/4096        268298 ns       268296 ns         2611
CONV_same_length/8192        580586 ns       580588 ns         1199
CONV_same_length/16384      1237440 ns      1237433 ns          565
CONV_same_length/32768      2616973 ns      2616977 ns          267
CONV_same_length/65536      5648103 ns      5648079 ns          125
CONV_same_length/131072    11793062 ns     11792968 ns           60
CONV_same_length/262144    24629007 ns     24628875 ns           28
CONV_same_length/524288    51344038 ns     51343554 ns           13
CONV_same_length/1048576  105986983 ns    105986967 ns            6

After:

-------------------------------------------------------------------
Benchmark                         Time             CPU   Iterations
-------------------------------------------------------------------
CONV_same_length/1             13.8 ns         13.8 ns     49156026
CONV_same_length/2             17.9 ns         17.9 ns     39657967
CONV_same_length/4             31.2 ns         31.2 ns     22500225
CONV_same_length/8             85.0 ns         85.0 ns      8218895
CONV_same_length/16             306 ns          306 ns      2284680
CONV_same_length/32            1177 ns         1177 ns       591425
CONV_same_length/64            2498 ns         2498 ns       281165
CONV_same_length/128           5103 ns         5103 ns       137464
CONV_same_length/256          11161 ns        11161 ns        62321
CONV_same_length/512          23222 ns        23222 ns        30208
CONV_same_length/1024         50215 ns        50215 ns        13905
CONV_same_length/2048        103985 ns       103986 ns         6722
CONV_same_length/4096        228466 ns       228466 ns         3091
CONV_same_length/8192        481168 ns       481168 ns         1473
CONV_same_length/16384      1033450 ns      1033452 ns          677
CONV_same_length/32768      2170169 ns      2170174 ns          328
CONV_same_length/65536      4623062 ns      4623070 ns          152
CONV_same_length/131072     9460578 ns      9460592 ns           74
CONV_same_length/262144    20084465 ns     20084506 ns           34
CONV_same_length/524288    41024224 ns     41024259 ns           17
CONV_same_length/1048576   85474862 ns     85474975 ns            8

@yosupo06 yosupo06 merged commit 89d5d0a into master Jul 19, 2021
@yosupo06 yosupo06 deleted the fft-optimize branch March 5, 2023 20:09
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

Successfully merging this pull request may close these issues.

1 participant