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

使用unsloth加速报错 #7177

Open
1 task done
GEK1 opened this issue Mar 6, 2025 · 5 comments
Open
1 task done

使用unsloth加速报错 #7177

GEK1 opened this issue Mar 6, 2025 · 5 comments
Labels
bug Something isn't working pending This problem is yet to be addressed

Comments

@GEK1
Copy link

GEK1 commented Mar 6, 2025

Reminder

  • I have read the above rules and searched the existing issues.

System Info

opt/LLaMA-Factory/src/llamafactory/model/model_utils/unsloth.py:53: UserWarning: WARNING: Unsloth should be imported before trl, transformers, peft to ensure all optimizations are applied. Your code may run slower or encounter memory issues without these optimizations.

Please restructure your imports with 'import unsloth' at the top of your file.
from unsloth import FastLanguageModel
🦥 Unsloth: Will patch your computer to enable 2x faster free finetuning.
🦥 Unsloth Zoo will now patch everything to make training faster!
Traceback (most recent call last):
File "/opt/anaconda3/envs/llf/bin/llamafactory-cli", line 8, in
sys.exit(main())
File "/opt/LLaMA-Factory/src/llamafactory/cli.py", line 112, in main
run_exp()
File "/opt/LLaMA-Factory/src/llamafactory/train/tuner.py", line 93, in run_exp
_training_function(config={"args": args, "callbacks": callbacks})
File "/opt/LLaMA-Factory/src/llamafactory/train/tuner.py", line 67, in _training_function
run_sft(model_args, data_args, training_args, finetuning_args, generating_args, callbacks)
File "/opt/LLaMA-Factory/src/llamafactory/train/sft/workflow.py", line 52, in run_sft
model = load_model(tokenizer, model_args, finetuning_args, training_args.do_train)
File "/opt/LLaMA-Factory/src/llamafactory/model/loader.py", line 141, in load_model
model = load_unsloth_pretrained_model(config, model_args)
File "/opt/LLaMA-Factory/src/llamafactory/model/model_utils/unsloth.py", line 53, in load_unsloth_pretrained_model
from unsloth import FastLanguageModel
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth/init.py", line 214, in
from .models import *
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth/models/init.py", line 16, in
from .granite import FastGraniteModel
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth/models/granite.py", line 15, in
from .llama import *
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth/models/llama.py", line 2686, in
PatchFastRL(FastLanguageModel = FastLlamaModel)
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth/models/rl.py", line 680, in PatchFastRL
patch_trl_rl_trainers()
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth/models/rl.py", line 673, in patch_trl_rl_trainers
_patch_trl_rl_trainers(trainer)
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth/models/rl.py", line 493, in _patch_trl_rl_trainers
created_module = create_new_function(
File "/opt/anaconda3/envs/llf/lib/python3.10/site-packages/unsloth_zoo/compiler.py", line 332, in create_new_function
if trials == 1000: raise RuntimeError("Unsloth: Failed to create dynamic compiled")
RuntimeError: Unsloth: Failed to create dynamic compiled

Reproduction

Put your message here.

Others

No response

@GEK1 GEK1 added bug Something isn't working pending This problem is yet to be addressed labels Mar 6, 2025
@xiaoxiaojuwuba
Copy link

the same problem happened to me

@aspwebchh
Copy link

aspwebchh commented Mar 6, 2025

#7170 (comment) 看这儿,解决了。 Look here. Same problem solved

@TalhaUsuf
Copy link

same

@chishti055nsu
Copy link

Why is it happening ??

@1stdeddy2nd
Copy link

1stdeddy2nd commented Mar 7, 2025

Relevance answer

pip install unsloth==2025.3.6 unsloth_zoo==2025.3.4

Or you can also do this

pip install --no-deps "unsloth>=2025.3.8" "unsloth_zoo>=2025.3.7" --upgrade --force-reinstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working pending This problem is yet to be addressed
Projects
None yet
Development

No branches or pull requests

6 participants