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

Unable to load unsloth models in just single GPU in a multi GPU system #983

Open
karthik-codex opened this issue Sep 3, 2024 · 7 comments
Labels
currently fixing Am fixing now! URGENT BUG Urgent bug

Comments

@karthik-codex
Copy link

I have two RTX A6000 and I understand the opensource unsloth version only supports single GPU. Is there anyway I can config to use only one GPU? I currently get this error when I import unsloth and load models

image

@coenvdgrinten
Copy link

In the command line, you can try setting the CUDA_VISIBLE_DEVICES environment variable to a single number, e.g.:
export CUDA_VISIBLE_DEVICES=0

You could look at nvidia-smi for which GPU you want to use.

@karthik-codex
Copy link
Author

I still get the same error

@mahiatlinux
Copy link
Contributor

mahiatlinux commented Sep 4, 2024

Try using the CUDA_VISIBLE_DEVICES environment variable in the script itself.

import os
os.environ['CUDA_VISIBLE_DEVICES'] = '0'  # Use GPU 0

or

import os
os.environ['CUDA_VISIBLE_DEVICES'] = '1'  # Use GPU 1

Put it at the top of the script. By the way, the first GPU is "0" and second one is "1".

@Sehyo
Copy link

Sehyo commented Sep 6, 2024

I have implemented a fix for this here:
#974

@danielhanchen danielhanchen added currently fixing Am fixing now! URGENT BUG Urgent bug labels Sep 7, 2024
@danielhanchen
Copy link
Contributor

Will look into @Sehyo's PR and implement a fix - sorry everyone!

@jlin816
Copy link

jlin816 commented Sep 25, 2024

I'm still getting this issue, is there a fix planned? I patched with @Sehyo 's fix locally, but 50% of runs still fail:

trainer.train()
  File "<string>", line 154, in train
  File "<string>", line 219, in _fast_inner_training_loop
RuntimeError: Unsloth currently does not support multi GPU setups - but we are working on it!

@giuliabaldini
Copy link
Contributor

Any updates on this? Also having the same problem. Would it be possible to put it as a warning to be able to ignore it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
currently fixing Am fixing now! URGENT BUG Urgent bug
Projects
None yet
Development

No branches or pull requests

7 participants