You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] model, tokenizer = FastLanguageModel.from_pretrained(...) hangs when using accelerate #2280
No error logs or crash — process becomes unresponsive.
All GPUs are visible and idle (verified using nvidia-smi).
Last visible output:
INFO 04-03 20:04:07 [cuda.py:291] Using Flash Attention backend.
loading configuration file /vault/ultraz/open-r1/data/llama3-3b-lora-checkpoint_1023/generation_config.json
Generate config GenerationConfig {
"bos_token_id": 128000,
"do_sample": true,
"eos_token_id": [
128001,
128008,
128009
],
"temperature": 0.6,
"top_p": 0.9
}
INFO 04-03 20:04:08 [cuda.py:291] Using Flash Attention backend.
[E403 20:14:00.181953387 socket.cpp:1023] [c10d] The client socket has timed out after 600000ms while trying to connect to (10.137.32.41, 40935).
[W403 20:14:00.182477993 TCPStore.cpp:330] [c10d] TCP client failed to connect/validate to host 10.137.32.41:40935 - retrying (try=0, timeout=600000ms, delay=32905ms): The client socket has timed out after 600000ms while trying to connect to (10.137.32.41, 40935).
Exception raised from throwTimeoutError at /pytorch/torch/csrc/distributed/c10d/socket.cpp:1025 (most recent call first)
The checkpoint contains the full weights of a trained LLaMA 3B Instruct model. I tried with meta-llama/Llama-3.2-3B-Instruct and it still hangs. However, when I run the same script using python train_script.py then it runs fine, but runs out of memory because its not distributing the memory across the GPUs
If it's hanging with a regular huggingface model it suggests a problem outside of unsloth, but also make sure you're using the latest unsloth versions. I suspect it could be due to accelerate and the config you have. Try without accelerate. Unsloth doesn't support multi-gpu yet so you generally don't need to launch with accelerate.
I see, I also have a feeling it might be a problem out of unsloth. Currently if I do not use accelerate, when it loads to my GPU, all the memory just goes to the first one, and the other ones have nothing so it goes out of memory. Are there any ways around equal GPU distribution?
Activity
[-][BUG] model, tokenizer = FastLanguageModel.from_pretrained(...) hangs[/-][+][BUG] model, tokenizer = FastLanguageModel.from_pretrained(...) hangs when using accelerate [/+]mmathew23 commentedon Apr 4, 2025
What's in your checkpoint? Does it hang when you load a huggingface model string?
Henchen99 commentedon Apr 4, 2025
The checkpoint contains the full weights of a trained LLaMA 3B Instruct model. I tried with
meta-llama/Llama-3.2-3B-Instructand it still hangs. However, when I run the same script usingpython train_script.pythen it runs fine, but runs out of memory because its not distributing the memory across the GPUsmmathew23 commentedon Apr 4, 2025
If it's hanging with a regular huggingface model it suggests a problem outside of unsloth, but also make sure you're using the latest unsloth versions. I suspect it could be due to accelerate and the config you have. Try without accelerate. Unsloth doesn't support multi-gpu yet so you generally don't need to launch with accelerate.
Henchen99 commentedon Apr 4, 2025
I see, I also have a feeling it might be a problem out of unsloth. Currently if I do not use accelerate, when it loads to my GPU, all the memory just goes to the first one, and the other ones have nothing so it goes out of memory. Are there any ways around equal GPU distribution?
mmathew23 commentedon Apr 4, 2025
unsloth does not support multi gpu at the moment. It's coming soon.
rolandtannous commentedon May 14, 2025
@Henchen99 @mmathew23
We're working on multi-gpu support. Should be released soon.
meanwhile have you tried accelerate?
merging this thread with #2435
Feel free to leave your comments and follow up questions there
thank you!