-
Notifications
You must be signed in to change notification settings - Fork 26.3k
Spatial Depthwise Convolution on the GPU #3057
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
Conversation
179816c to
d331efb
Compare
|
Some preliminary results (the parameters for the layers and inputs are taken from MobileNet). All times are for running 50 iterations of Forward/Backward. The trends:
|
|
Marking this as ready to review. I still need to write tests, but while I do that I think its worth looking at the kernels, and also the integration, which is a little messy. |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_nn.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
test/test_nn.py
Outdated
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
…r only, not bias)
…ount for accgradparams
b832c53 to
0feeca8
Compare
|
Okay, I addressed everything except:
|
| auto padding = vecToInt64(this->padding); | ||
| auto dilation = vecToInt64(this->dilation); | ||
|
|
||
| at::conv_depthwise2d_forward_out(output, input, weight, kernel_size, bias, stride, padding, dilation); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| if (output_mask[2]) { | ||
| grad_bias = bias.type().tensor(); | ||
| grad_bias.resize_as_(bias).zero_(); | ||
| update_grad_bias(grad_output, grad_bias); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
| value = THCNumerics<AccT>::add( | ||
| value, | ||
| THCNumerics<T>::mul(weight.data()[weightOffset], input.data()[offset])); | ||
| ScalarConvert<T, AccT>::to(THCNumerics<T>::mul(weight.data()[weightOffset], input.data()[offset]))); |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
|
Okay, I added support for Half-Precision. Let me know if there is anything else I need to do. |
|
LGTM. Did you figure out support for binding THCUNN half operations in ATen? |
|
@ngimel - yeah, we just needed to add an extra parameter to @colesbury's |
|
Cool! Will it also fix #2435? It is still broken. |
|
@ngimel I ran that repro script and it didn't crash so I think so. |
|
I have upgrade my pytorch to 0.3.0, but I found |
|
I have tried the depthwise convolution with |
|
@cddlyf me too, I found most existing code of separable_conv still use conv with group |
Partially addresses #1708. Currently works for Conv2D but needs testing.
TODO: