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

Struggle with training LLaMA with a single GPU using both PT v1 and v2 #14

Closed
linhduongtuan opened this issue Mar 11, 2023 · 4 comments
Closed
Assignees

Comments

@linhduongtuan
Copy link

Hi,
I love your code base and want to try how to train the LLaMA with a single GPU. This code I use is here https://github.com/juncongmoo/pyllama/blob/main/llama/model_single.py.
However, I struggle with an error. This message's shown that:
"
self.tok_embeddings = nn.Embedding(params.vocab_size, params.dim)
File "/home/linh/anaconda3/envs/a/lib/python3.9/site-packages/torch/nn/modules/sparse.py", line 139, in init
self.weight = Parameter(torch.empty((num_embeddings, embedding_dim), **factory_kwargs))
RuntimeError: Trying to create tensor with negative dimension -1: [-1, 512]
"
Can you help me to fix/test this code again.

Thank in advance.
Linh

@mldevorg
Copy link
Collaborator

Guess your torch version is too old?

@linhduongtuan
Copy link
Author

No. I test both PT V1 and V2 (updated very recent)

Repository owner deleted a comment from linhduongtuan Mar 12, 2023
@juncongmoo
Copy link
Owner

@linhduongtuan Can you please post your environment info like OS, torch version, Model files checksum? (I cannot reproduce your issue.)

@juncongmoo juncongmoo self-assigned this Mar 12, 2023
@linhduongtuan
Copy link
Author

@juncongmoo,
I use PT v2 nightly (or PT 1.13) in Os Ubuntu 20.4, CUDA 11.7, LLaMA 7B. Instead of loading the model checkpoint, I want to train the model from scratch.

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

3 participants