Skip to content

Conversation

@xmnlab
Copy link
Contributor

@xmnlab xmnlab commented May 27, 2019

this PR will resolve partially #18353

@pytorchbot pytorchbot added module: cpu CPU specific problem (e.g., perf, algorithm) module: internals Related to internal abstractions in c10 and ATen module: nccl Problems related to nccl support module: onnx Related to torch.onnx module: operators module: third_party labels May 27, 2019
@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch from 5cdbfd9 to a83dfda Compare May 29, 2019 00:18
@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch 2 times, most recently from 4742369 to ba14ded Compare May 31, 2019 04:56
@xmnlab
Copy link
Contributor Author

xmnlab commented Jun 1, 2019

@pearu do you have any tip here?

test/test_nn.py::TestNN::test_Conv1d_dilated PASSED                      [  3%]
test/test_nn.py::TestNN::test_grad_conv1d_input PASSED                   [  6%]
test/test_nn.py::TestNN::test_conv_double_backward PASSED                [  9%]
test/test_nn.py::TestNN::test_Conv1d_pad2 PASSED                         [ 12%]
test/test_nn.py::TestNN::test_spectral_norm_dim PASSED                   [ 15%]
test/test_nn.py::TestNN::test_Conv2d_depthwise PASSED                    [ 18%]
test/test_nn.py::TestNN::test_Conv2d_pad2circular PASSED                 [ 21%]
test/test_nn.py::TestNN::test_Conv1d_stride PASSED                       [ 24%]
test/test_nn.py::TestNN::test_Conv1d_stride1_pad2circular PASSED         [ 27%]
test/test_nn.py::TestNN::test_Conv2d_depthwise_dilated PASSED            [ 30%]
test/test_nn.py::TestNN::test_Conv1d_pad2size1 PASSED                    [ 33%]
test/test_nn.py::TestNN::test_Conv2d_depthwise_padded PASSED             [ 36%]
test/test_nn.py::TestNN::test_Conv2d_no_bias PASSED                      [ 39%]
test/test_nn.py::TestNN::test_conv_noncontig_weights PASSED              [ 42%]
test/test_nn.py::TestNN::test_grad_conv2d_input PASSED                   [ 45%]
test/test_nn.py::TestNN::test_ConvTranspose1d FAILED                     [ 48%]
test/test_nn.py::TestNN::test_ConvTranspose2d FAILED                     [ 51%]
test/test_nn.py::TestNN::test_Conv2d PASSED                              [ 54%]
test/test_nn.py::TestNN::test_Conv2d_padding PASSED                      [ 57%]
test/test_nn.py::TestNN::test_ConvTranspose1d_groups FAILED              [ 60%]
test/test_nn.py::TestNN::test_Conv2d_depthwise_strided PASSED            [ 63%]
test/test_nn.py::TestNN::test_Conv2d_groups PASSED                       [ 66%]
test/test_nn.py::TestNN::test_ConvTranspose1d_no_bias FAILED             [ 69%]
test/test_nn.py::TestNN::test_Conv2d_dilated PASSED                      [ 72%]
test/test_nn.py::TestNN::test_ConvTranspose2d_dilated FAILED             [ 75%]
test/test_nn.py::TestNN::test_conv_double_backward_groups PASSED         [ 78%]
test/test_nn.py::TestNN::test_ConvTranspose2d_groups FAILED              [ 81%]
test/test_nn.py::TestNN::test_ConvTranspose2d_output_size PASSED         [ 84%]
test/test_nn.py::TestNN::test_conv_double_backward_no_bias PASSED        [ 87%]
test/test_nn.py::TestNN::test_Conv2d_groups_thnn PASSED                  [ 90%]
test/test_nn.py::TestNN::test_conv_double_backward_stride PASSED         [ 93%]
test/test_nn.py::TestNN::test_Conv2d_depthwise_with_multiplier PASSED    [ 96%]
test/test_nn.py::TestNN::test_ConvTranspose2d_no_bias FAILED             [100%]

@xmnlab xmnlab requested review from pearu and skrah June 3, 2019 14:17
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the CI errors is '_thnn_conv_transpose2d_backward' is not a member of 'at::native::legacy::cuda'.

I'm pretty sure that if you do CPU/CUDA separately, you cannot remove thnn_conv_transpose2d_backward from native_functions.yaml until CUDA is ported as well.

This is why I recommend doing CPU/CUDA together.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @skrah .
However, to just test on CPU, use USE_CUDA=0 env variable when building. This allows finishing CPU porting before starting the CUDA porting.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@skrah @pearu thanks so much for the feedback! I will try to find a workaround for that ... not sure if it would be a good approach to port cpu and gpu in the same PR. I needed to move some steps back and rewrote again my code ... locally, the problematic tests passed. I will try to fix this GPU problem to move forward this PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant either leave thnn_conv_transpose2d_backward exactly as before for CUDA and use the new name for CPU only or port CPU/CUDA together.

I've never tried leaving the old name for CUDA though, I always took the second approach.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see .. thanks for the explanation @skrah ! I move steps back and worked on my first code ... and just realized that I already started the porting for cuda ... so I will probably port for gpu for 2d also im2col and col2im .. but I think the comparison between files will be easy ... I am not changing the structure here.

@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch from 3107b28 to 06670f7 Compare June 4, 2019 23:10
@pytorchbot pytorchbot added module: build Build system issues module: cuda Related to torch.cuda, and CUDA support in general labels Jun 4, 2019
@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch 2 times, most recently from 0e28c4a to a23b8fb Compare June 7, 2019 00:56
@xmnlab xmnlab changed the title [wip] 18353 convtranspose2d 18353 convtranspose2d Jun 7, 2019
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I guess if we merge this first, @pearu will handle the merge conflicts in his diff

@xmnlab xmnlab marked this pull request as ready for review June 8, 2019 00:40
@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch 2 times, most recently from 2ade5a4 to 233df28 Compare June 8, 2019 17:37
@pytorchbot pytorchbot added the module: cublas Problem related to cublas support label Jun 8, 2019
@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch from 233df28 to 57e2312 Compare June 10, 2019 03:35
@jeffreyksmithjr jeffreyksmithjr added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Jun 10, 2019
@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch 2 times, most recently from 9a75e13 to 9e8ad74 Compare June 12, 2019 14:53
@xmnlab xmnlab force-pushed the 18353-convtranspose2d branch from 9e8ad74 to c1622eb Compare June 17, 2019 22:10
@xmnlab xmnlab requested a review from ezyang June 18, 2019 14:38
@ezyang ezyang changed the title 18353 convtranspose2d Port convtranspose2d Jun 18, 2019
@ezyang
Copy link
Contributor

ezyang commented Jun 18, 2019

A remark that applies to the whole cluster of ports that are happening here: as we are porting, we are renaming the kernels from thnn_conv_transpose2d to conv_transpose2d. I'm not sure this is actually a renaming we should do. The name conv_transpose2d sounds very general: it is "THE" 2d transposed convolution. But actually it gives you a very specific (somewhat slow) implementation. It would be good if this was made clear. We shouldn't call them thnn because that implies legacy, but it would be good if we had some name that made it clear that it was a specific implementation, much in the same way cudnn_conv_transpose2d makes it clear we are using the cuDNN implementation.

- name: thnn_conv_transpose2d_forward(Tensor self, Tensor weight, int[2] kernel_size, Tensor? bias, int[2] stride, int[2] padding, int[2] output_padding, int[2] dilation) -> (Tensor output, Tensor columns, Tensor ones)
self, weight, bias: thnn_conv_transpose2d_backward(grad, self, weight, kernel_size, stride, padding, output_padding, dilation, columns, ones, grad_input_mask)
- name: conv_transpose2d(Tensor self, Tensor weight, int[2] kernel_size, Tensor? bias=None, int[2] stride=1, int[2] padding=0, int[2] output_padding=0, int[2] dilation=1) -> Tensor
self, weight, bias: conv_transpose2d_backward(grad, self, weight, kernel_size, stride, padding, output_padding, dilation, empty_like(grad), empty_like(grad), grad_input_mask)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I won't block land on this, but even better would be just to axe these arguments from the function entirely and have them be created inside the function itself.

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ezyang is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@xmnlab
Copy link
Contributor Author

xmnlab commented Jun 18, 2019

@ezyang I will work on a PR for the 3d so I can change the name there. do you have any suggestion for the name? does at_conv_transpose2d looks good to you?

@ezyang
Copy link
Contributor

ezyang commented Jun 18, 2019 via email

@xmnlab
Copy link
Contributor Author

xmnlab commented Jun 19, 2019

@ezyang just to sure, is there anything missing in this PR? Or could I apply the recommendations you pointed in a follow up PR?

@ezyang
Copy link
Contributor

ezyang commented Jun 19, 2019

I apparently need to adjust our internal build system to successfully land this

@xmnlab
Copy link
Contributor Author

xmnlab commented Jun 19, 2019

oh I see .. let me know if I can help in anyway

@ezyang
Copy link
Contributor

ezyang commented Jun 19, 2019

For the record, it looks like the error was we needed to delete aten/src/THCUNN/SpatialFullConvolution.cu

@xmnlab
Copy link
Contributor Author

xmnlab commented Jun 19, 2019

Ok thanks @ezyang for the feedback in the next PR, I will ensure that the corresponded file for 3d will be deleted. thanks!

@xmnlab
Copy link
Contributor Author

xmnlab commented Jun 19, 2019

@ezyang just to check, should I remove this file for 2d in this PR?

@ezyang
Copy link
Contributor

ezyang commented Jun 20, 2019 via email

@xmnlab xmnlab deleted the 18353-convtranspose2d branch June 20, 2019 14:16
zdevito pushed a commit to zdevito/ATen that referenced this pull request Jun 20, 2019
Summary:
this PR will resolve partially pytorch/pytorch#18353
Pull Request resolved: pytorch/pytorch#20994

Differential Revision: D15876052

Pulled By: ezyang

fbshipit-source-id: 5896e0cbb656d0530e39fd681808adc685841b37
@facebook-github-bot
Copy link
Contributor

@ezyang merged this pull request in f8f583c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

caffe2 Merged module: build Build system issues module: cpu CPU specific problem (e.g., perf, algorithm) module: cublas Problem related to cublas support module: cuda Related to torch.cuda, and CUDA support in general module: internals Related to internal abstractions in c10 and ATen module: nccl Problems related to nccl support module: onnx Related to torch.onnx module: third_party open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants