Skip to content

grpo lmdeploy warn #3800

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

Merged
merged 2 commits into from
Apr 8, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions swift/trainers/rlhf_trainer/grpo_trainer.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,11 @@ def __init__(self,
cache_max_entry_count=args.lmdeploy_cache_max_entry_count,
reload_weights=True)
self.infer_device = fast_infer_device
from lmdeploy.turbomind.turbomind import TurboMind
lmdeploy_engine = self.engine.engine.engine
assert isinstance(lmdeploy_engine, TurboMind), (
"Currently only LMDeploy's TurboMind backend is supported. "
'The current model is incompatible - please use vLLM or PyTorch backend instead.')
self.engine.default_template = copy(self.template) # Avoid thread-unsafe modifications of the mode.
self._last_loaded_step = 0 # tag to avoid useless loading during grad accumulation

Expand Down
Loading