Coder Social home page Coder Social logo

半精度和8bit量化的计算 about ncnn HOT 9 CLOSED

tencent avatar tencent commented on May 12, 2024
半精度和8bit量化的计算

from ncnn.

Comments (9)

nihui avatar nihui commented on May 12, 2024

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

from ncnn.

asurachqtan avatar asurachqtan commented on May 12, 2024

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

from ncnn.

qfdong avatar qfdong commented on May 12, 2024

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

from ncnn.

ccJia avatar ccJia commented on May 12, 2024

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

from ncnn.

qfdong avatar qfdong commented on May 12, 2024

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

from ncnn.

ccJia avatar ccJia commented on May 12, 2024

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

from ncnn.

quietsmile avatar quietsmile commented on May 12, 2024

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

from ncnn.

BUG1989 avatar BUG1989 commented on May 12, 2024

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

from ncnn.

nihui avatar nihui commented on May 12, 2024

move to #230

from ncnn.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.