pyllama icon indicating copy to clipboard operation
pyllama copied to clipboard

world size assertionerror

Open sharlec opened this issue 2 years ago • 1 comments

I try to make the 7B model on my single GPU server, and I have error:

Traceback (most recent call last):
  File "inference.py", line 82, in <module>
    run(
  File "inference.py", line 50, in run
    generator = load(
  File "inference.py", line 17, in load
    assert world_size == len(
AssertionError: Loading a checkpoint for MP=0 but world size is 1

I used the community way to download the model files.

Where can i modify the MP setting? or I have to run it with multiple GPU way?

sharlec avatar Mar 14 '23 21:03 sharlec

I encountered a similar problem and was able to resolve it using this command. torchrun --nproc_per_node 1 inference.py --ckpt_dir ./pyllama_data/7B --tokenizer_path ./pyllama_data/tokenizer.model with A100(40G)*2

randyadd163 avatar Mar 17 '23 07:03 randyadd163

I still have the same problem, on single 3070 8GB

sharlec avatar Mar 24 '23 19:03 sharlec

same problem on single 1070 8GB

solved this problem. my file with model had exttension .pt, in python code need .pth in file inferency.py in 16 line

but now i can find params.json for my model, there is only model.pth and tokenizer.model

alexch33 avatar Mar 27 '23 14:03 alexch33

same problem on single 1070 8GB

solved this problem. my file with model had exttension .pt, in python code need .pth in file inferency.py in 16 line

but now i can find params.json for my model, there is only model.pth and tokenizer.model

Fixed the params.json by downloading the params.json here: https://huggingface.co/nyanko7/LLaMA-7B/tree/main

regstuff avatar Apr 03 '23 14:04 regstuff

Hi, I solved this issue by correcting the path ...

I ran inference.py without quantization. The command is python inference.py --ckpt_dir pyllama_data/7B --tokenizer_path pyllama_data/tokenizer.model

MianchuWang avatar Apr 04 '23 19:04 MianchuWang

thanks for all the comments and help here. In my scenario, it turns out my code did not detect the file properly, so the length of the files is always 0. If anyone has a similar issue, maybe check the file loading folder.

sharlec avatar Apr 04 '23 23:04 sharlec