-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Does Flux support N-dimensional convolutions, where N>3? #451
Comments
Not right now; each of 1-, 2- and 3-D convolutions just calls out to a specific kernel. But I'd happily take an implementation of an N-D convolution in NNlib, even if it's not heavily optimised. |
@MikeInnes Right, thanks for the answer, I might look into it. I have 3D timeseries (fMRI volumes), and I did not want to go overboard with a 3D convolutional RNN, so I thought a simple 4D CNN (with kernel size 1 in the time dimension) could be a better idea. Do you want to keep the issue open as a feature request or should I close it? |
Yeah, we may as well keep this open, thanks. |
I would like to work on this issue. Can someone please guide me as to what needs to be done? |
Might be best to speak to @avik-pal. On the GPU we're limited by what NVIDIA provides in CUDNN, but it should be straightforward to write an N-dimensional CPU kernel. |
Unfortunately, CUDNN only provides 2D and 3D convolutions. |
@avik-pal So should I go ahead with the CPU part? And if yes can you please guide me as to where should I start looking into the code? |
@shreyas-kowshik you will first have to add it in NNlib. Here are the 2d and 3d implementations. |
Is it not possible to write a nd conv on the GPU? |
@datnamer It is definitely possible. We need to write the CUDA kernel with CUDAnative and get it integrated with the Flux API. However, making the kernel efficient is not as straightforward as optimizing the CPU kernel. |
Understood |
I was going through some code in NNlib.jl when I came across this : The PR effectively adds N-dimensional Conv to NNlib.jl |
Should this be closed since FluxML/NNlib.jl#94 has been merged? |
does that implementation work on GPUs? |
@cossio it doesn't appear to work though. What should be the syntax to get (4+)D convolutions working? |
I think this should no longer be an issue. |
Even on CUDA? |
Not sure. Will test tomorrow morning (or someone else can race me). |
On cpu, we support only up to 3d convolutions |
Okay then we definitely should keep this open. |
While this works:
This throws an error:
I'm running Julia 0.7 and:
The text was updated successfully, but these errors were encountered: