-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Port convtranspose2d #20994
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
Port convtranspose2d #20994
Conversation
5cdbfd9 to
a83dfda
Compare
4742369 to
ba14ded
Compare
|
@pearu do you have any tip here? |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
3107b28 to
06670f7
Compare
0e28c4a to
a23b8fb
Compare
aten/src/ATen/cuda/CUDABlas.h
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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
2ade5a4 to
233df28
Compare
233df28 to
57e2312
Compare
9a75e13 to
9e8ad74
Compare
9e8ad74 to
c1622eb
Compare
|
A remark that applies to the whole cluster of ports that are happening here: as we are porting, we are renaming the kernels from |
| - 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) |
There was a problem hiding this comment.
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.
facebook-github-bot
left a comment
There was a problem hiding this 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.
|
@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_ or aten_ seems as good a name as any. Other possibilities are slow_
(cuz it's slow) or naive_. Up to you!
Excerpts from Ivan Ogasawara's message of 2019-06-18 08:05:18 -0700:
… @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 just to sure, is there anything missing in this PR? Or could I apply the recommendations you pointed in a follow up PR? |
|
I apparently need to adjust our internal build system to successfully land this |
|
oh I see .. let me know if I can help in anyway |
|
For the record, it looks like the error was we needed to delete |
|
Ok thanks @ezyang for the feedback in the next PR, I will ensure that the corresponded file for 3d will be deleted. thanks! |
|
@ezyang just to check, should I remove this file for 2d in this PR? |
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
this PR will resolve partially #18353