generated from fastai/nbdev_template
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
⚖️ Add vLLM server mode and VLM support to OnlineDPOTrainer #3783
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
qgallouedec
merged 72 commits into
huggingface:main
from
vaelev:online-dpo-vllm-server-mode
Sep 5, 2025
Merged
⚖️ Add vLLM server mode and VLM support to OnlineDPOTrainer #3783
qgallouedec
merged 72 commits into
huggingface:main
from
vaelev:online-dpo-vllm-server-mode
Sep 5, 2025
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR adds support for vLLM server mode to OnlineDPOTrainer, matching the functionality available in GRPO. Previously, OnlineDPO only supported "colocate" mode where vLLM runs in the same process. Now users can use an external vLLM server (launched with `trl vllm-serve`) for generation while keeping the training process separate. Key changes: - Add vLLM server mode configuration parameters to OnlineDPOConfig - Implement VLLMClient integration for server communication - Add weight synchronization between training process and vLLM server - Support both server and colocate modes with proper error handling - Add comprehensive tests for server mode functionality - Handle gracefully the current vLLM colocate mode API limitations The implementation follows the same patterns as GRPO's vLLM integration to ensure consistency across the TRL library.
5 tasks
qgallouedec
reviewed
Aug 9, 2025
qgallouedec
reviewed
Aug 9, 2025
qgallouedec
reviewed
Aug 9, 2025
Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com>
kashif
reviewed
Sep 4, 2025
qgallouedec
approved these changes
Sep 5, 2025
Member
qgallouedec
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ltgm!
SamY724
pushed a commit
to SamY724/trl
that referenced
this pull request
Sep 6, 2025
…ace#3783) Co-authored-by: Kashif Rasul <kashif.rasul@gmail.com> Co-authored-by: Sergio Paniego Blanco <sergiopaniegoblanco@gmail.com> Co-authored-by: Quentin Gallouédec <45557362+qgallouedec@users.noreply.github.com> Co-authored-by: Quentin Gallouédec <gallouedec.quentin@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3782
This PR adds support for vLLM server mode to OnlineDPOTrainer, matching the functionality available in GRPO. Previously, OnlineDPO only supported "colocate" mode where vLLM runs in the same process. Now users can use an external vLLM server (launched with
trl vllm-serve) for generation while keeping the training process separate.Key Changes
OnlineDPOConfig(vllm_mode,vllm_server_base_url,vllm_server_host,vllm_server_port, etc.)VLLMClientclass_move_model_to_vllmImplementation Details
The implementation follows the same patterns as GRPO's vLLM integration to ensure consistency across the TRL library:
VLLMClientto communicate with external vLLM server, synchronizes weights before generationLLMinstanceTest Plan