nvdla/doc

Question about data format document Fig17

Closed this issue · 5 comments

对于新增的data format 文档中winograd weight data format有些疑问,在图17中,为什么假设kernel是5x5 stride 2 , 根据我的理解,dla目前支持kernelsize=3x3,stride=1的情景?
One question about the figure17 in the lastest document about the data format: why the original weight kernel in the left of figure is 5x5 x48byte with stride size of 2 ? I do not think dla can support winograd opt in this situation .
http://nvdla.org/_images/format_channel_extension_and_conversion_for_wingorad.svg

NVDLA supports Winograd not only 3x3 kernels but also other cases.
The condition of kernel supported by Winograd:
int((original_kernel_width + conv_x_stride - 1) / conv_x_stride) == 3 &&
int((original_kernel_height + conv_y_stride - 1) / conv_y_stride) == 3
Once the condition is reached, that kernel can be supported for Winograd with some extra steps.

简单来说,NVDLA的Winograd模式可以支持3x3以外的kernel,只要保证kernel的水平大小除以水平stride等于3(上取整)以及垂直大小除以垂直stride也等于3(上取整),那么这个kernel就可以被Winograd加速,当然需要一些额外的kernel调整步骤

非常感谢您的回复,对我来说非常重要的信息,之前我在研究winograd相关算法的时候一直没有考虑到相关问题,而且我看到winograd的output activation 的反变换是基于固定连接关系的加法器实现,所以一直以为只能支持一种变换; 关于kernel的调整有相关的paper可以参考么,再次感谢!
Thanks so much! It's very important for me since I never considerate that case and I think the inverse transform of output activation is fixed by the adders . Could you please share me some related papers about the adjustment of kernel.
By the way , I think "int" is a bit of confusing , ceiling is better.

Actually it's still 3x3 case. A non-3x3 kernel which meetis the formulas above can be transformed to a 3x3 kernel whose stride is 1x1. It is showed in first two diagram of http://nvdla.org/_images/format_channel_extension_and_conversion_for_wingorad.svg
The input activition should be remapped accordingly. CDMA in NVDLA will handle the conversion of input activation automatically.
PS: I'm used to C code :-)

实际上这依然是3x3的kernel。对于非3x3的kernel而言,只要满足上述两个表达式,就可以被转化为3x3并且stride是1x1的kernel
相应的,输入的activation也需要重新排列来适配转化后的kernel。这一点是由NVDLA中的CDMA来完成的。

Thanks! happy new year

@pengwubj can you please get in touch with me at jerrycainjr@gmail.com? It concerns a systems programming course I teach.