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

RuntimeError: probability tensor contains either inf, nan or element < 0 #4

Open
Phoebe-ovo opened this issue Oct 18, 2023 · 10 comments

Comments

@Phoebe-ovo
Copy link

Hello, when I evaluate for Perception and Action Prediction, I got this error for decapoda-research/llama-7b-hf.
How can I fix this? Thanks!

@xzebin775
Copy link

Hi, have you solved it, I come across the same problem

@melights
Copy link
Collaborator

Hi @Phoebe-ovo @xzebin775 thanks for reporting this issue! We are not able to reproduce this error on the GPUs we have. Could you please let me know what GPUs were you using?
Also, can you try setting load_in_8bit to False to see if this issue can be solved?

@Phoebe-ovo
Copy link
Author

The GPU I used is V100, what GPUs were you using?

@xzebin775
Copy link

It is GTX 1080 Ti.

@melights
Copy link
Collaborator

Thanks for confirming. Can you try if setting load_in_8bit to False in here solves the problem?

@xzebin775
Copy link

I set load_in_8bit to False, but I get the error below. It seems I cann't load the model to GPU

torch.cuda.OutOfMemoryError: CUDA out of memory. Tried to allocate 86.00 MiB (GPU 0; 10.92 GiB total capacity; 10.44 GiB already allocated; 22.62 MiB free; 10.45 GiB reserved in total by PyTorch) If reserved memory is >> allocated memory try setting max_split_size_mb to avoid fragmentation. See documentation for Memory Management and PYTORCH_CUDA_ALLOC_CONF

@melights
Copy link
Collaborator

Upon thorough investigation, we are not able to reproduce the error on the GPUs we have (NVIDIA A100 and 3090), but it might related to other issues. I suggest you try these:

  • Try clean up the virtualenv (rm env -rf), pull the latest main and setup the environment following the Setup section in the README
  • Try using Python 3.9+

Also, we noticed the base model we used decapoda-research/llama-7b-hf was removed by the author in the huggingface model repo and we are testing the workarounds.

@xjturjc
Copy link

xjturjc commented Jan 5, 2024

I meet the same problem, and I set "do_sample" = False, then it worked. Don't know what impact this will have. (same with GPUV100)

@kevinchiu19
Copy link

Change 'decapoda-research/llama-7b-hf' to 'huggyllama/llama-7b' and 'load_in_8bit=False'.

It works for me. (My env v100)

@uniquezhengjie
Copy link

Change 'decapoda-research/llama-7b-hf' to 'huggyllama/llama-7b' and 'load_in_8bit=False'.

It works for me. (My env v100)

I get error:
ValueError: The device_map provided does not give any device for the following parameters: base_model.model.weighted_mask

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

6 participants