-
-
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
Asymmetric padding fails on gpu models #775
Comments
CuArrays is responsible for the implementation here, so it'd be worth an issue there. I'm not sure what we can do though. Actually padding the array before executing the convolution might be one option. |
Hi, I'm interested in adding this functionality (pad input manually) where it belongs (Flux, NNlib or CuArrays). NNLib seems to be the lowest level where it can fit as the API to CuArrays seems to require passing a reference to an already allocated output array (or?). Adding it in Flux has the (maybe negligible) advantage that one can determine at layer creation time what approach to have and therefore avoid having checks for asymetric padding or not when evaluating (as done in the example in the reference below). Haven't thought so much about gpu <-> cpu, but I guess that if the logic is in the "primary" constructor it should be possible to work it out? I made an example implementation here and it seems to have acceptable performance (if the benchmark is correct of course): |
This should now work after FluxML/NNlibCUDA.jl#34. |
Of course, cudnn does not support asymmetric padding and CuArrays tries to handle this by forcing the use of symmetric padding; however, this still fails. For example,
I am currently using the following versions:
The problem occurs in the
NNlib/src/conv.jl line 112
with the call ofoutput_size(cdims)
in the creation ofy
. The size ofy
is incorrect becauseoutput_size(cdims)
assumes the use of the asymmetric padding but CuArrays will force a symmetric pad in later a call.I am not sure who (Flux, NNlib, CuArrays) should be responsible for providing a fix.
The text was updated successfully, but these errors were encountered: