Code Monkey home page Code Monkey logo

Comments (9)

fchollet avatar fchollet commented on June 12, 2024

@james77777778 any thoughts on this?

from keras.

james77777778 avatar james77777778 commented on June 12, 2024

If the model is trained with fp8, it is ready for inference. We can fix the scaling factor and drop the amax_history if we don't train the model in the future.

If the model is not trained with fp8 and we don't plan to train it in the future, we need a mechanism to calibrate it. Calibration is similar to fp8 training but we only need to compute the scaling factor offline with an additional calibration dataset.

I'm unsure whether we should add the calibration logic into Keras.

from keras.

lingzhi98 avatar lingzhi98 commented on June 12, 2024

Thanks for your reply. It seems keras need more discussion to decide whether to support fp8 calibration. Maybe you can update the latest progress if have any result in the future.

from keras.

lingzhi98 avatar lingzhi98 commented on June 12, 2024

And for fp8 inference after fp8 training, keras seems support not well. Can we add is_training argument in float8_call to decide whether to compute new scale? New amax history is also not need.

from keras.

james77777778 avatar james77777778 commented on June 12, 2024

And for fp8 inference after fp8 training, keras seems support not well. Can we add is_training argument in float8_call to decide whether to compute new scale? New amax history is also not need.

Since #19682 has been merged, you can set training=False for the layer (or model) to skip the computation of both the scaling factor and amax history.
The variable for amax history will still be retained but it should occupy a small portion of memory.

from keras.

lingzhi98 avatar lingzhi98 commented on June 12, 2024

Thanks, will test it soon.

from keras.

gowthamkpr avatar gowthamkpr commented on June 12, 2024

Hi @lingzhi98 Do you test it? It should be working as expected since the PR has been merged.

from keras.

lingzhi98 avatar lingzhi98 commented on June 12, 2024

Sorry for slow response. Have checked it, close this issue.

from keras.

lingzhi98 avatar lingzhi98 commented on June 12, 2024

Thank you!

from keras.

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.