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
GRPO example missing PEFT config resulting in "LLMEngine should not be pickled" #1632
# Reference model
if is_deepspeed_zero3_enabled():
self.ref_model = AutoModelForCausalLM.from_pretrained(model_id, **model_init_kwargs)
elif peft_config is None:
# If PEFT configuration is not provided, create a reference model based on the initial model.
self.ref_model = create_reference_model(model)
else:
# If PEFT is used, the reference model is not needed since the adapter can be disabled
# to revert to the initial model.
self.ref_model = None
which crashes in vllm/engine/llm_engine.py:497 with an LLMEngine should not be pickled! runtime error.
Same here, running on a 4090. I modified the code according to #1624 (comment) and then met this error
[rank0]: File "/usr/local/lib/python3.11/dist-packages/vllm/engine/llm_engine.py", line 497, in __reduce__
[rank0]: raise RuntimeError("LLMEngine should not be pickled!")
[rank0]: RuntimeError: LLMEngine should not be pickled!
Ran into this error while trying to run something locally. I think you need to run PatchFastRL("GRPO", FastLanguageModel) before importing GRPOTrainer or any trainers from trl, since PatchFastRL calls a bunch of helpers that remove the need for peft_config in the trainer (see here).
When I moved PatchFastRL("GRPO", FastLanguageModel) before my trl import statements, the issue went away.
Reacted by jenghub, ryota.mitsuhashi, Eric Yue, Markus and LeMoussel
Ran into this error while trying to run something locally. I think you need to run PatchFastRL("GRPO", FastLanguageModel) before importing GRPOTrainer or any trainers from trl, since PatchFastRL calls a bunch of helpers that remove the need for peft_config in the trainer (see here).
When I moved PatchFastRL("GRPO", FastLanguageModel) before my trl import statements, the issue went away.
Gah. Thanks. That's obviously the issue. I did a ruff organize without thinking.
Activity
marv1nnnnn commentedon Feb 7, 2025
Same here, running on a 4090. I modified the code according to #1624 (comment) and then met this error
tchang1997 commentedon Feb 7, 2025
Ran into this error while trying to run something locally. I think you need to run
PatchFastRL("GRPO", FastLanguageModel)before importingGRPOTraineror any trainers fromtrl, sincePatchFastRLcalls a bunch of helpers that remove the need forpeft_configin the trainer (see here).When I moved
PatchFastRL("GRPO", FastLanguageModel)before mytrlimport statements, the issue went away.kallewoof commentedon Feb 7, 2025
Gah. Thanks. That's obviously the issue. I did a ruff organize without thinking.
toxahak commentedon Feb 14, 2025
seems like something broke in the latest version. I had to use this to get my script working again:
pip install unsloth==2025.2.5benjamin-marie commentedon Feb 14, 2025
Yes, I have this issue. It was working well yesterday.
cht619 commentedon Apr 22, 2025
how to solve is when do not use peft?