-
Notifications
You must be signed in to change notification settings - Fork 48
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
Should dilated pooling be supported #180
Comments
This is already supported. Please take a look at pool2d operations in the current spec. |
I suppose @fujunwei 's question is whether WebNN spec should not support dilated pooling given WebNN-native implementation feedbacks on OpenVINO and DirectML. According to the following table, only max pool of DirectML supports dilation.
|
TensorFlow, PyTorch, and ONNX all support dilated pooling as the feature is used in real models e.g. the one described in this paper, with TensorFlow supporting it on both AVG and MAX pool. https://www.tensorflow.org/api_docs/python/tf/nn/pool It makes sense since dilation has been supported in convolution for a long time. A follow-up pooling operation might as well support it too. A general question here is what to do if the underlying platform doesn't support a particular feature. I think in such case, the graph builder should probably fail fast at graph construction time to give the user a chance to either fail or recover from it. This situation, hopefully, won't be common since WebNN is most likely just a backend of a framework used by the user; if the framework doesn't support this feature to begin with, it isn't likely to cause the WebNN backend to fail on it. |
@wchao1115 , thanks for the pointers, they are helpful.
I understand a WebNN implementation should support the spec defines, otherwise it would not pass the conformance tests. Given the dilated pooling is not widely available on native platform ML APIs yet, should we exclude it for now and support it in the future? |
My concern is that a webnn backend may be limited in their support for this feature for the frameworks that do support it, like the major frameworks I cited above i.e. there will be no way to implement TensorFlow, PyTorch, or ONNX dilated pooling, for examples, through webnn backend, if we remove this feature from the spec. FWIW, the way we approach conformance in DirectML is that there are two classes of features -- the required and optional features. A required feature must be implemented to be fully conformed, but the implementation needs not be native i.e. it may be emulated. This is the implementation strategy I suggested for An optional feature, however, is something that is either not possible or cannot be easily emulated, but also not required in all scenarios. This type of features requires a capability flag so that the caller can independently probe if it's actually supported by the implementation. I think of dilated pooling in this category. We could make dilated pooling an optional feature with a capability flag exposed in the context e.g. |
According to the current Chromium prototype, dilated pooling are not widely supported by targeting backends:
Because dilated pooling ops cannot be easily emulated. We probably should consider either removing it from the spec or making it as a detectable feature in Thoughts? |
To convolve, reduce, or pool a tensor is a very similar operation, so much so that if you can rearrange one problem to any of the others, it's likely emulatable.
¹ For TF, should I be using this list or this list or another, to know which ops Chromium may call? |
OpenVINO doesn't support dilated pooling because there are no attributes to specify the dilation, for example MaxPooling.
For DML, only
MAX_POOLING2
support with adding an additional constant arrayDilations
, butAVERAGE_POOLING
andLP_POOLING
still don't support dilated pooling.System API only has limit capabliity to support dilated pooling, should it be defined in WebNN Spec?
The text was updated successfully, but these errors were encountered: