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
[op compatibility] conv2d #28
Comments
Is the |
Fixed, thanks :) |
The following table is based on WebNN POC native mapping. It captures the mapping to NNAPI, MPS and DirectML that can be used as the base for native APIs compatibility study.
According to the table, most features of proposed conv2d op can be supported by NNAPI, MPS and DirectML, BNNS and DNNL with some opens:
Another open question is: NNAPI, MPS and DML all support fused Bias and Activation for conv2d. It looks like there are two options to support them:
Any thoughts? |
Thanks Ningxin. Would it be useful to add BNNS and MKL to survey all the possible shapes? I believe fusing bias and activation should be done by the optimizer. The fused ops are arbitrary. It will make the API cleaner. |
Good point, thanks Benjamin. BNNS and MKL-DNN (renamed to DNNL) can support CPU acceleration. It would be useful to survey them. I updated the table with BNNS and DNNL columns. The opens have been updated accordingly. Please take a look.
+1 |
This should not be a problem. |
I think we're ready to formalize this op and add it into the spec. Thanks @BenjaminPoulain for Apple's perspective. @nsthorat and @RafaelCintron please chime in if you have further feedback or design considerations from Google and Microsoft. Unless we hear concerns, I'd ask @huningxin to craft a PR to add conv2d to the spec. |
I'll revert my previous comment on spec readiness. There are still opens that need to be addressed before this op can be spec-formalized, quoting @huningxin for opens:
Suggestions welcome on how to overcome these four issues! |
I'd like to add a few open questions:
|
Per 5 Dec CG meeting [1], move the conv2d compability table [2] to markdown. [1] https://www.w3.org/2019/12/05-webmachinelearning-minutes.html#x02 [2] webmachinelearning#28 (comment)
Per 5 Dec CG meeting, moved the conv2d native API compatibility table to op_compatibility/conv2d.md. Feel free to review and contribute. @RafaelCintron @walrusmcd |
@nsthorat Is supporting grouped convolution out of scope? Grouped convolution is used in AlexNet, the filter tensor shape for DirectML will be [out_channels / group_count, group_count, in_channels / group_count, H,W] when group_count > 1. And since the API is explicitly called 'conv2d', I'm assuming supporting 3-D volumetric convolution (with 'depth' input dimension) is out of scope. |
@wchao1115 asked:
On the 23 Jan 2020 call we agreed to keep grouped convolution a separate op, compatibility to be assessed in its own issue. |
Hi ningxin @huningxin ,I really appreciate the work WebNN has done. |
Thanks for the info @smilejames
I'd like to help. Let me take a look at paddle doc and make a PR. I'll ping you for review. |
@huningxin @wchao1115 I believe we can close this issue now. Please check if there are any opens remaining. |
@anssiko Ideally I would prefer that all the ? in the table are definitively answered e.g. striding/padding support in some API etc. but I would be ok closing this issue as-is. I assume people do look at the current spec and relate that to their respective API advocacy. Perfection is the enemy of progress! |
closing issue as per discussion above |
This issue will track op compatibility resolution for conv2d.
Signature:
conv2d(x, filter, padding, strides, dilations)
Arguments:
x: 4-dim tensor with logical shape [N, H, W, in_channels]
filter: 4-dim tensor with logical shape [H, W, in_channels, out_channels]
padding: array of ints. Padding for the beginning and ending along each spatial axis.
strides: array of ints that have length 1, 2 or 4. The stride of the sliding window for each dimension of input.
dilations: array of ints of length 2: [dil_height, dil_width] The dilation factor for each spatial dimension of the input.
Docstring:
Computes a 2-D convolution given 4-D input and filter tensors.
Notes:
To be discussed:
The text was updated successfully, but these errors were encountered: