Implement 3D deconvolution (cuDNN)#5615
Conversation
4addd13 to
6482f8e
Compare
|
please fix gpu test |
|
Tests are passing now. The upsampling operator initialized the target_shape to (0,0), which is not meaningful. While this worked for the old Deconvolution code (as shape (0,0) was the default target_shape), this pull request adapted the default target_shape to (), which is more meaningful given that shapes of different dimension can be supplied and aligns with the way the convolution code handles the defaults. |
If no target shape is supposed to be set, then indeed no target shape shall be set (and not (0,0) as before).
|
I decide to merge this in. |
|
I rebased on current master, which restarted the tests. They finished running now, so the status is again green. |
| wmat_ptr = wmat.dptr_; | ||
| gwmat_ptr = gwmat.dptr_; | ||
| data_ptr = data.dptr_; | ||
| gdata_ptr = gdata.dptr_; |
There was a problem hiding this comment.
Why not use grad.dptr_ directly?
There was a problem hiding this comment.
It would be out of scope.
|
I just noticed 2d deconv isn't tested. Could you add tests? |
|
What kind of test do you have in mind? Currently there is:
Where the latter does a pair test between the cpu and gpu version of 2d deconv. Would pair tests against other libraries (that could be installed via pip) be desirable? |
* Implement 3D deconvolution for cudnn * Adapt upsampling operator to new deconvolution API If no target shape is supposed to be set, then indeed no target shape shall be set (and not (0,0) as before).
This pull request adds support for 3D deconvolution when compiled with cudnn and run on GPU. It does not break the current 2D Deconvolution non-cudnn code and simply throws an error if the non-cudnn code is called with a 3D kernel.
As the non-gpu version does not support 3D deconvolution, this pull request does not add test cases to compare that their output is similar. Instead I manually compared the output to the PyTorch 3D Deconvolution implementation.
I have seen that the cudnn convolution code uses
DMLC_DECLARE_FIELD(workspace).set_default(1024).set_range(0, 8192). Shall the cudnn deconvolution code be adapted to use a default of 1024 for as well? Currently the default is 512.The following code can be used to compare with PyTorch: