{"action":"created","issue":{"url":"https://api.github.com/repos/BVLC/caffe/issues/544","labels_url":"https://api.github.com/repos/BVLC/caffe/issues/544/labels{/name}","comments_url":"https://api.github.com/repos/BVLC/caffe/issues/544/comments","events_url":"https://api.github.com/repos/BVLC/caffe/issues/544/events","html_url":"https://github.com/BVLC/caffe/pull/544","id":36579852,"number":544,"title":"Fft based convolutional layer","user":{"login":"borisgin","id":7542441,"avatar_url":"https://avatars.githubusercontent.com/u/7542441?v=3","gravatar_id":"","url":"https://api.github.com/users/borisgin","html_url":"https://github.com/borisgin","followers_url":"https://api.github.com/users/borisgin/followers","following_url":"https://api.github.com/users/borisgin/following{/other_user}","gists_url":"https://api.github.com/users/borisgin/gists{/gist_id}","starred_url":"https://api.github.com/users/borisgin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/borisgin/subscriptions","organizations_url":"https://api.github.com/users/borisgin/orgs","repos_url":"https://api.github.com/users/borisgin/repos","events_url":"https://api.github.com/users/borisgin/events{/privacy}","received_events_url":"https://api.github.com/users/borisgin/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/BVLC/caffe/labels/ES","name":"ES","color":"bfdadc"},{"url":"https://api.github.com/repos/BVLC/caffe/labels/JD","name":"JD","color":"fbca04"},{"url":"https://api.github.com/repos/BVLC/caffe/labels/JL","name":"JL","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":26,"created_at":"2014-06-26T14:19:19Z","updated_at":"2015-06-15T08:39:50Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/BVLC/caffe/pulls/544","html_url":"https://github.com/BVLC/caffe/pull/544","diff_url":"https://github.com/BVLC/caffe/pull/544.diff","patch_url":"https://github.com/BVLC/caffe/pull/544.patch"},"body":"I implemented Convolutional layer with fft-based Forward() . There is no FFT support in Backward() yet. The implementation is based on FFTW3 library. It was tested both with native FFTW3 and with MKL. Into addition it supports OpenMP to utilize all cores. Was tested with native gcc OpenMP and with MKL. \r\n\r\nThe current version is CPU-only . Is anybody interested in doing CUDA - version?\r\n\r\nMy impression, based on current CPU implementation (FFT+openMP),  is that FFT-based convolutional layer makes sense only for large kernels (kernel_size / stride >= 7). There are more details on benchmark below:\r\nI modified net_speed-benchmark to test Forward() only, then I took \"examples/imagenet\" imagenet topology and modified two first convolutonal layers:\r\n* batch = 128 \r\n* stride = 1\r\n* kernel = { 5,7, 9,11,13,15} \r\n* 10 forward iterations\r\nFor each kernel I slightly changed crop size in data layers to make map size  FFT- friendly (128, 256,..) The results are below (time is seconds for 10 forward iterations): \r\n\r\n   Layer Kernel     Input             Output         base,sec fft,sec  \r\n---------------------------------------------------------------------------- |\r\n    conv1 15 128x3x242x242  128x96x228x228      79    28 \r\n    conv2 15 128x96x114x114 128x256x104x104 549  168 \r\n---------------------------------------------------------------------------- |\r\n   conv1 13 128x3x244x244  128x96x232x232       58  30 \r\n    conv2 13 128x96x116x116 128x256x108x108 431 170  \r\n---------------------------------------------------------------------------- |\r\n    conv1 11 128x3x246x246  128x96x236x236      44    28\r\n    conv2 11 128x96x118x118 128x256x112x112 314 168 \r\n--------------------------------------------------------------------------- |\r\n    conv1 9 128x3x248x248  128x96x240x240       33   29\r\n    conv2 9 128x96x120x120 128x256x116x116  230 170\r\n-------------------------------------------------------------------------- |\r\n    conv1 7 128x3x250x250  128x96x244x244        23   29\r\n    conv2 7 128x96x122x122 128x256x122x122  152 170\r\n------------------------------------------------------------------------- |\r\n    conv1 5 128x3x252x252  128x96x248x248       16   28\r\n    conv2 5 128x96x124x124 128x256x120x120   83  167 "},"comment":{"url":"https://api.github.com/repos/BVLC/caffe/issues/comments/111979598","html_url":"https://github.com/BVLC/caffe/pull/544#issuecomment-111979598","issue_url":"https://api.github.com/repos/BVLC/caffe/issues/544","id":111979598,"user":{"login":"bhack","id":1710528,"avatar_url":"https://avatars.githubusercontent.com/u/1710528?v=3","gravatar_id":"","url":"https://api.github.com/users/bhack","html_url":"https://github.com/bhack","followers_url":"https://api.github.com/users/bhack/followers","following_url":"https://api.github.com/users/bhack/following{/other_user}","gists_url":"https://api.github.com/users/bhack/gists{/gist_id}","starred_url":"https://api.github.com/users/bhack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bhack/subscriptions","organizations_url":"https://api.github.com/users/bhack/orgs","repos_url":"https://api.github.com/users/bhack/repos","events_url":"https://api.github.com/users/bhack/events{/privacy}","received_events_url":"https://api.github.com/users/bhack/received_events","type":"User","site_admin":false},"created_at":"2015-06-15T08:39:50Z","updated_at":"2015-06-15T08:39:50Z","body":"Happy pull request birthday @borisgin :)"}}