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

[question] error message while finetuning #460

Open
nevermet opened this issue Oct 21, 2023 · 2 comments
Open

[question] error message while finetuning #460

nevermet opened this issue Oct 21, 2023 · 2 comments

Comments

@nevermet
Copy link

Dear all,
I ran finetuning and while validating, I encountered this error message:
iter 3198: loss nan, time: 123.08ms
Validating ...
.......
lit-llama/generate.py", line 74, in generate
idx_next = torch.multinomial(probs, num_samples=1).to(dtype=dtype)
RuntimeError: probability tensor contains either inf, nan or element < 0

Could you tell me how I can solve this problem?

Thanks in advance.

@rasbt
Copy link
Contributor

rasbt commented Oct 21, 2023

It may or may not be related, but are you using --precision 16-true? I noticed that for training some models it results in NaNs during training. If your GPU supports it, can you try brain float precision, i.e. --precision bf16-true?

@nevermet
Copy link
Author

No I did not use --precision 16-true.

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

2 participants