-
Notifications
You must be signed in to change notification settings - Fork 6.8k
support 1D and 3D arrays in MKLDNN. #11906
Comments
I think mkldnn already has support for 3D arrays now. You can find the formats definition (ncdhw or nCdhw16c) here: https://github.com/intel/mkl-dnn/blob/master/include/mkldnn_types.h#L134 |
Please see more details by Sina here - #11909 |
I know mkldnn has 3D arrays, but not all mkldnn operators support 3D arrays. I believe the current implementation of mkldnn integration only allows 2D and 4D arrays. For example, mkldnn convolution only supports 2D kernel on 4D arrays. Currently, 1D convolution actually calls the native implementation. But if we add a fake dim to turn 1D conv into 2D conv, we can make substantial speedup. I think this applies to many other operators. |
3D tensors are common in audio signals, e.g. WaveNet. I specifically ran into this issue with WaveNet inference on CPU. |
@safrooze thanks for the information. mkldnn has already supported 3D convolution. The input of it may be 5D tensor if we take batch size and channel size into account. I think 1D convolution is still under development for mkldnn. As @zheng-da mentioned, currently we can add a fake dim to turn it into 2D convolution to benefit from mkldnn. |
@TaoLv I think the task should be more general. The integration of MKLDNN should support 1D and 3D input arrays. |
@TaoLv By 3D tensor, I meant something with (batch_size, channels, width), which is a 1D convolution. |
@zheng-da @safrooze It's on the plan to integrate 1D conv into MXNet soon by @xinyu-intel |
The request features are implemented :) |
MKLDNN currently only supports 2D and 4D arrays. As @safrooze reported that computation on 1D and 3D arrays is much slower than on 2D and 4D arrays. We can easily accelerate performance by adding a dummy dimension so that the computation can take advantage of MKLDNN. Right now users have to do it manually. We should improve the MKLDNN integration and accelerate 1D and 3D arrays automatically.
@pengzhao-intel @TaoLv
The text was updated successfully, but these errors were encountered: