Skip to content
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

Question about data format document Fig17 #9

Closed
pengwubj opened this issue Feb 7, 2018 · 5 comments
Closed

Question about data format document Fig17 #9

pengwubj opened this issue Feb 7, 2018 · 5 comments

Comments

@pengwubj
Copy link

pengwubj commented Feb 7, 2018

对于新增的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

@yigua2000
Copy link

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调整步骤

@pengwubj
Copy link
Author

pengwubj commented Feb 9, 2018

非常感谢您的回复,对我来说非常重要的信息,之前我在研究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.

@yigua2000
Copy link

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来完成的。

@pengwubj
Copy link
Author

Thanks! happy new year

@nvhook nvhook closed this as completed Jul 24, 2018
@jerrycainjr
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants