Giter VIP home page Giter VIP logo

Comments (6)

578123043 avatar 578123043 commented on August 20, 2024 2

image

In FP16 , output is nan , and in mid layer(maybe 17th or 18th) in the bert , I found that the attention is -3000,and softmax result is nan

from spanbert.

marcos0318 avatar marcos0318 commented on August 20, 2024 2

When I tried to finetune spanbert large on my own task using fp16 with the "amp" module from the apex, I meet a similar error.

I am using the code from huggingface and tried both using "Spanbert/spanbert-large-cased" and the model binaries provided in this repo. Both gives the identical result, which kept telling me gradient overflow and rescaling the loss.

Interestingly, when I tried to replace spanbert-large with BERT base/large, and spanbert-base model, these models work perfectly and achieved expected results.

Also, the spanbert-large work very well when I turn off the fp16 training.

Here I found this guy cannot run fp16 with spanbert on another task.

In a conclusion, I guess that the spanbert-large model may work with the new Nvidia amp

from spanbert.

mandarjoshi90 avatar mandarjoshi90 commented on August 20, 2024

I will need more information to help you debug. Could you please include what command you're running?

from spanbert.

578123043 avatar 578123043 commented on August 20, 2024

YES , I use {https://dl.fbaipublicfiles.com/fairseq/models/spanbert_hf.tar.gz} to runing Huggingface`s run_squad , it Failed
Does it work with the latest amp?

from spanbert.

mandarjoshi90 avatar mandarjoshi90 commented on August 20, 2024

We haven't tested this with the new HF code. ICYMI, there's a run_squad.py in this repo. I'd recommend using that.

from spanbert.

YuxianMeng avatar YuxianMeng commented on August 20, 2024

Met same issue here, is there any solution yet?

from spanbert.

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.