Community
cancel
Showing results for 
Search instead for 
Did you mean: 
rahul_modi
Beginner
124 Views

Performance comparison for Convolution - Direct vs FFT vs Auto

Jump to solution
Hi,
This is regarding the comparison of Direct Mode vs FFT mode for Multi-dimensional convolutions in terms of performance. My expectation was that the FFT mode should be faster than direct mode, but it turned out to be the other way for my test cases.
I tested all modes for 2-dimensional convolution of a 256 x 256 matrix with a 5 x 5 kernel
Approximate runtime (averaged over 1000 runs) was
DIRECT mode: 2.4 ms
FFT mode: 9.5 ms
AUTO mode: 9.5 ms
I was surprised by the slower run time of FFT mode.Any insight regarding performance of Intel MKL convolution routines will be helpful.

Thanks,

Rahul Modi.
0 Kudos

Accepted Solutions
Victor_Gladkikh
New Contributor I
124 Views

Teoretically direct mode is faster then FFT mode for kernels less then 7*7but actuallycut-off pointdepends to performance of FFT mode and direct mode which depend to MKL version andhardaware.

Victor

View solution in original post

4 Replies
Victor_Gladkikh
New Contributor I
124 Views
Hi Rahul,

Which MKL release and Intel processordo you use?

FFT mode vs. DIRECT mode:
FFT mode hasoverhead, soexecution time of FFT modecan be bigger then execution time of direct mode for "small" problem. This overhead depends to hardware, MKL version and sizes of problem.

Victor.
rahul_modi
Beginner
124 Views
Hey Victor,
Thanks again for your prompt reply.
I am using MKL ver 10.3 Update 8 release and I am using an Intel core i7-2600K CPU @ 3.4 GHz
Currently I have MKL configured to run in the sequential mode.
So do you suggest using direct mode for smaller problems?
As for more on the test problem, I had a simple 256*256 input array
0 1 2 . . . . 255
256 257 ... ... ... ... 511
...
...
65280 ... ... ... ... 65535
Ans this array is convolved with a 5*5 kernel
-1, -0.5, 0, 0.5, 1,
-1.5, -0.75, 0, 0.75, 1.5,
-2, -1, 0, 1, 2,
-1.5, -0.75, 0, 0.75, 1.5,
-1, -0.5, 0, 0.5, 1,
-1, -0.5, 0, 0.5, 1
Thanks for all your help.
Best,
Rahul Modi.
Victor_Gladkikh
New Contributor I
125 Views

Teoretically direct mode is faster then FFT mode for kernels less then 7*7but actuallycut-off pointdepends to performance of FFT mode and direct mode which depend to MKL version andhardaware.

Victor

View solution in original post

rahul_modi
Beginner
124 Views
Thanks, that helps
-Rahul
Reply