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

chapter 6 - OutOfMemoryError: CUDA out of memory. Tried to allocate 96.00 MiB. GPU #7

Open
amscosta opened this issue Sep 20, 2024 · 1 comment

Comments

@amscosta
Copy link

Hello,
From the very beginning of chapter 6, when trying to running the jupyter notebook locally with my 8GB VRAM gpu card:

Load model and tokenizer

model = AutoModelForCausalLM.from_pretrained(
"microsoft/Phi-3-mini-4k-instruct",
device_map="cuda",
torch_dtype="auto",
trust_remote_code=True,
)

Is resulting in the message : OutOfMemoryError: CUDA out of memory. Tried to allocate...
Any workaround is very welcome, for instance a less robust model with almost similar results?
Thanks.

@jalammar
Copy link
Contributor

Might wanna try a smaller model like Gemma 2B

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