-
Notifications
You must be signed in to change notification settings - Fork 287
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
Use GPU instead of CPU #228
Comments
Hello! I believe you need to move your inputs on to gpu as well. Have you tried this The way I would go about running this on a GPU is to move the model to your desired device after initialization. This should look something like this:
When you are generating you should move your inputs to the same device as well. This can be done using the following code:
|
Thanks a lot. It works perfect. |
Hey, I am running into an issue trying to load the model on my GPU. If I set init_device to 'meta' in Here is my code:
And this is the error:
Do you know what causes this? How can I load the OpenFlamingo model on GPU? |
Did you every solve it I am running into the same issue |
Hi, I tried to run this project on my PC. It was very slow, because it used CPU insted of GPU.
There was info:
You are using config.init_device='cpu', but you can also use config.init_device="meta" with Composer + FSDP for fast initialization
I found that I can change
config.init_device='cpu'
toconfig.init_device='meta'
in model config.cache/huggingface/hub/models--anas-awadalla--mpt-1b-redpajama-200b/snapshots/8bc4eba452b5a5330f81975a761e4a59c851beea
But I got error:
You are calling .generate() with the input_ids being on a device type different than your model's device. input_ids is on cpu, whereas the model is on meta. You may experience unexpected behaviors or slower generation. Please make sure that you have put input_ids to the correct device by calling for example input_ids = input_ids.to('meta') before running .generate().
RuntimeError: Tensor on device meta is not on the expected device cpu!
How can I set up this project to use GPU?
The text was updated successfully, but these errors were encountered: