GithubHelp home page GithubHelp logo

Comments (4)

LvanderGoten avatar LvanderGoten commented on July 19, 2024

I just saw that there is a "gradient_clipping" option in the config. However, setting it to 1.0, does not eliminate the gradient overflow messages. Is this expected?

from deepspeed.

tjruwase avatar tjruwase commented on July 19, 2024

Gradient overflow messages, typically at the beginning of training, are not surprising. But this should eventually stop once the dynamic loss scale has decreased to a point that allows training stability.

Are you not seeing the overflow messages stop?

from deepspeed.

LiweiPeng avatar LiweiPeng commented on July 19, 2024

Regarding to the original question, what's the purpose to disable 'max_grad_norm' for fp16?
if self.fp16_enabled() and 'max_grad_norm' in optimizer_parameters.keys():
optimizer_parameters['max_grad_norm'] = 0.0

from deepspeed.

tjruwase avatar tjruwase commented on July 19, 2024

The rationale for this was to support both the old and new ways of specifying gradient clipping. The difference is that in the old way, gradient clipping is specified as max_grad_norm parameter of the fp32 optimizer, while in the new (and more intuitive way IMHO) gradient clipping is handled in the fp16 wrapper optimizer, such as here. In summary, this logic allows the fp16 optimizers in DeepSpeed to handle both old and new gradient clipping styles.

All that said, we are thinking of ways to improve the interface and avoid this confusion, and we certainly appreciate your input on that.

from deepspeed.

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.