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

Loading LLaMA ckpt速度特别慢 #4

Open
lhz-menarchy opened this issue Sep 23, 2024 · 1 comment
Open

Loading LLaMA ckpt速度特别慢 #4

lhz-menarchy opened this issue Sep 23, 2024 · 1 comment

Comments

@lhz-menarchy
Copy link

您好,我想问一下为什么在这段加载llama的代码中加载速度特别慢:

we enforce loading to llama checkpoint

    # if load: # this is deprecated


     ckpts = sorted(Path(llama_ckpt_dir).glob("*.pth"))
     for ckpt in tqdm(ckpts, desc="Loading LLaMA ckpt"):
         ckpt = torch.load(ckpt, map_location='cuda:0')
         names = self.llama.state_dict().keys()
         ckpt_names = ckpt.keys()
         for n in ckpt_names:
             if n not in names:
                 print(f"Warning: {n} not in llama model")
         self.llama.load_state_dict(ckpt, strict=False)
     self.llama_keys = ["llama." + i for i in ckpt_names]
@Max-Fu
Copy link
Owner

Max-Fu commented Oct 22, 2024

Hi,

This usually loads pretty fast on our server (< 1min for the 7b model). How long does it take on your end?

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