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

Single GPU training in Multi-GPU system doesn't work. #975

Open
Sehyo opened this issue Aug 31, 2024 · 2 comments
Open

Single GPU training in Multi-GPU system doesn't work. #975

Sehyo opened this issue Aug 31, 2024 · 2 comments

Comments

@Sehyo
Copy link

Sehyo commented Aug 31, 2024

Single GPU training in Multi-GPU system doesn't work even if limited to 1 GPU with os.environ CUDA_VISIBLE_DEVICES before importing unsloth.

Reason:
check_nvidia function spawns new process to check nvidia-smi, thus bypassing the cuda_visible_devices set.

Fix:
#974

Pushed fix here, changed check_nvidia as well as patched the handler to check only the GPU that is set by os environ. If no os environ set, defaults to original behaviour.

@unslothai unslothai deleted a comment Aug 31, 2024
@danielhanchen
Copy link
Contributor

Ok will check your PR out - thanks so much!

@Sehyo
Copy link
Author

Sehyo commented Aug 31, 2024

Ok will check your PR out - thanks so much!

Any update? fyi a solution like "CUDA_VISIBLE_DEVICES={x} nvidia-smi" won't work as that still prints out all GPUs anyways.

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