-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[online trainers] add vllm lora adapter support #4590
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
base: main
Are you sure you want to change the base?
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
| if self.vllm_use_lora: | ||
| # Cycle through 2 adapter IDs to force vLLM to reload updated weights while keeping memory usage bounded | ||
| # vLLM uses lora_int_id as the cache key (see WorkerLoRAManager.add_adapter) | ||
| # By alternating between 2 IDs, we ensure the adapter is reloaded each step without accumulating N adapters |
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.
nice!
| if self.vllm_use_lora: | ||
| import tempfile | ||
|
|
||
| # Create a temporary directory to save the LoRA adapter (only once) |
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.
any edge case in case it's training on a distributed/multi-node setup?
|
Could you explain the context of this PR? In my understanding, if you use LoRA for vLLM the generation is expected to be slower. Why not just merging the adapter before the training? |
What does this PR do?
Fixes # (issue)
Before submitting
Pull Request section?
to it if that's the case.
Who can review?
Anyone in the community is free to review the PR once the tests have passed. Feel free to tag
members/contributors who may be interested in your PR.