[bugfix][LoRA] Fix the lora accuracy issue introduced by the upstream vLLM changed.#6958
Conversation
Signed-off-by: paulyu12 <507435917@qq.com>
Summary of ChangesHello, 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 addresses a LoRA accuracy regression that emerged from an upstream vLLM change. It refines the internal handling of active LoRA adapters within the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
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.
Code Review
This pull request aims to fix a LoRA accuracy issue by refining how the number of active LoRAs is handled, especially for CUDA graph capturing. The changes introduce a num_active_loras parameter and propagate it through _determine_batch_execution_and_padding and _dummy_run. While the overall direction is correct, I've identified a critical inconsistency in _dummy_run that could lead to incorrect graph capture and replay behavior.
| num_active_loras=( | ||
| self.lora_config.max_loras | ||
| if self.lora_config is not None | ||
| else num_active_loras | ||
| ), |
There was a problem hiding this comment.
There's an inconsistency in how num_active_loras is used within the _dummy_run function. Here, num_active_loras is conditionally set to self.lora_config.max_loras for the maybe_dummy_run_with_lora context manager. However, the call to _determine_batch_execution_and_padding on lines 2101-2102 uses the original num_active_loras argument passed to _dummy_run. This discrepancy can cause a mismatch between the CUDA graph captured (based on one number of LoRAs) and the dummy run setup (based on another), potentially leading to correctness issues or runtime errors during graph replay.
To ensure consistency, the same value for num_active_loras should be used for both determining the batch descriptor and for the dummy LoRA setup. If the intention is to use max_loras for graph capture, this should be reflected in both places. The simplest fix to ensure consistency is to use the num_active_loras parameter from the function signature in both calls.
num_active_loras=num_active_loras,Signed-off-by: paulyu12 <507435917@qq.com>
|
👋 Hi! Thank you for contributing to the vLLM Ascend project. The following points will speed up your PR merge:
If CI fails, you can run linting and testing checks locally according Contributing and Testing. |
Signed-off-by: paulyu12 <507435917@qq.com>
Signed-off-by: paulyu12 <507435917@qq.com>
|
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
Signed-off-by: yupeng <507435917@qq.com>
da16d65 to
f9197f9
Compare
Signed-off-by: paulyu12 <507435917@qq.com>
f9197f9 to
2ce61cb
Compare
… vLLM changed. (vllm-project#6958) ### What this PR does / why we need it? Fix the LoRA e2e test accuracy issue that introduced by the upstream PR vllm-project/vllm#32005 ### How was this patch tested? pytest -sv tests/e2e/singlecard/test_llama32_lora.py - vLLM version: v0.16.0 - vLLM main: vllm-project/vllm@15d76f7 --------- Signed-off-by: paulyu12 <507435917@qq.com> Signed-off-by: yupeng <507435917@qq.com>
What this PR does / why we need it?
Fix the LoRA e2e test accuracy issue that introduced by the upstream PR vllm-project/vllm#32005
Does this PR introduce any user-facing change?
No.
How was this patch tested?
pytest -sv tests/e2e/singlecard/test_llama32_lora.py