-
Notifications
You must be signed in to change notification settings - Fork 243
[Feat] XCCL-updates for single LoRA functionality for ascend-vLLM #679
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
Summary of ChangesHello @gursimar, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the LoRA weight update mechanism for the vLLM backend by introducing XCCL-based in-memory broadcasts. This change allows for direct and efficient transfer of LoRA tensors from FSDP training processes to vLLM workers, bypassing disk I/O and enabling quicker activation of LoRA adapters. It represents a crucial first milestone in the broader MultiLoRA initiative, laying the groundwork for more advanced LoRA management capabilities. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
This PR introduces XCCL-based weight updates for single LoRA models in the vLLM backend, which is a great feature. The implementation looks mostly correct, but I've found a critical bug in the example code and have some suggestions to improve maintainability and robustness.
My main concerns are:
- A critical logic swap in the example file that will cause it to fail.
- Heavy reliance on vLLM's private APIs, which is risky for future compatibility.
- Some opportunities for refactoring to reduce code duplication and improve clarity.
Please see my detailed comments below.
d7fe5d5 to
fab0f8f
Compare
|
@gursimar Hi, sorry for the late review, but could your update the PR and resolve the conflict first? |
Description
This PR continues the MultiLoRA work (RFC #609, PR #621) and implements single-LoRA XCCL-based weight updates for the vLLM backend. Previously we supported only disk-based LoRA updates (PR #621) for vLLM; this change enables an in-memory XCCL broadcast flow to push LoRA tensors from an FSDP training process to vLLM workers, and to materialize an active LoRA adapter inside vLLM.
This is Milestone 1: single-LoRA over XCCL. It is a follow-up to the earlier PR #621 that enabled disk-based LoRA updates.
High level flow added
FSDP side prepares a
WeightUpdateMetathat includes a smallpeft_configdescribing LoRA hyperparams/target modules.FSDP broadcasts parameter tensors via XCCL (existing distributed broadcast), but when
use_lorais true we:vLLM worker receives the broadcast LoRA tensors, normalizes names, constructs a
LoRAModelfrom the received tensors usingPEFTHelper/LoRAModel.from_lora_tensors(...)helper primitives and registers/activates the adapter in vLLM's LoRA manager.Key user-visible capabilities
Backward-compatible behavior
meta.use_lorais true and vLLM backend is used.Files changed
areal/api/io_struct.py— addpeft_configtoWeightUpdateMeta.areal/engine/fsdp_engine.py— populatepeft_config; LoRA-only param iteration.areal/engine/vllm_remote.py— include LoRA metadata fields in vLLM requests.areal/thirdparty/vllm/areal_vllm_server.py— new LoRA request model and endpoints wiring.areal/thirdparty/vllm/vllm_worker_extension.py— full LoRA XCCL receive & adapter creation implementation.examples/lora/gsm8k_grpo_lora_vllm.py&.yaml— example wiring and config forweight_update_mode=xccl.Running instructions
Start a local test as shown in the example:
Testing
Type of Change
work as expected)
Checklist
jb build docs/gemini review)Breaking Change Details (if applicable):
Need help? Check the Contributing Guide or ask in
GitHub Discussions!