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

半精度和8bit量化的计算 #21

Closed
asurachqtan opened this issue Jul 25, 2017 · 9 comments
Closed

半精度和8bit量化的计算 #21

asurachqtan opened this issue Jul 25, 2017 · 9 comments

Comments

@asurachqtan
Copy link

您好!我看了您的代码,发现目前版本只支持半精度浮点和8bit量化的存储,但是没有提供这两种类型的计算。最近我也在做半精度浮点计算和8bit量化计算的工作,不知道您是否有提供半精度浮点和8bit量化计算的打算?

@nihui
Copy link
Member

nihui commented Jul 25, 2017

半精度计算现在的硬件还不支持,8bit实际只是量化存储,读出来还是单精度浮点数

@asurachqtan
Copy link
Author

@nihui 我们目前想做的是计算转换为8bit来进行 不知道精度损失会有多少 正在实现中

@qfdong
Copy link

qfdong commented Jul 27, 2017

转换为8bit的网络,需要重新retraining一下可以提高model的精度,我也在做类似的工作,希望能多交流

@ccJia
Copy link

ccJia commented Aug 2, 2017

@qfdong 请问你们在做8bit的乘法的时候,溢出问题严重吗?怎么规避的?

@qfdong
Copy link

qfdong commented Aug 2, 2017

@ccJia 我们在做量化的时候,会统计每层的输入,输出,以及参数的最大值,会选取合适的bit数来保证没有溢出的现象发生,然而每一层的layer的计算过程中,的确有可能溢出,中间的乘法的结果是存储在int类型来避免溢出,你是在什么平台上开发?这个受限于指令集

@ccJia
Copy link

ccJia commented Aug 2, 2017

@qfdong 我是在V8上面搞的,我没有动态的划分BIT数,中间乘法也是转存了一下。

@quietsmile
Copy link

请问,8bit优化在armv7上(3516/3519)有加速空间么?@ccJia @qfdong @nihui

@BUG1989
Copy link
Contributor

BUG1989 commented Nov 20, 2017

理论上耗时缩减为原来的25%

@nihui
Copy link
Member

nihui commented Jan 4, 2018

move to #230

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

6 participants