Skip to content

Conversation

@wcwuwc
Copy link
Contributor

@wcwuwc wcwuwc commented Jul 19, 2025

Essential Elements of an Effective PR Description Checklist

  • The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
  • The test plan, such as providing test command.
  • The test results, such as pasting the results comparison before and after, or e2e results
  • (Optional) The necessary documentation update, such as updating supported_models.md and examples for a new model.
    FIX [Feature]: Add LoRA support for gpt-oss model #23610

Purpose

This PR is an experimental extension to FusedMoE, aiming to support parallel inference with multiple LoRA models.

✅ Completed:

  • Verified to work under both TP and torch.compile modes.
  • Verified correctness on the DeepSeek-V2-Lite-Chat model.
  • Compatible with PackedLoRALayerWeights to load LoRA weights of all experts.
  • With test coverage.

❌ Work in progress:

  • Kernel generalization: experts more than 256, support for quantization and compatibility with various GPU architectures.

Any suggestions are welcome!

Test Plan

vllm serve deepseek-ai/DeepSeek-V2-Lite-Chat --trust-remote-code -tp 2  --enable-lora --max-loras 6 --lora-modules  lora1=wuchen01/DeepSeek-V2-Lite-Chat-All-LoRA --max-lora-rank 64 
curl --location 'http://127.0.0.1:8000/v1/chat/completions' \
--header 'Content-Type: application/json' \
--data '{
    "stream":false,
    "messages": [
        {"role": "system", "content": "You are a helpful assistant."},
        {
            "role": "user",
            "content": "who are you?"
        }
    ],
    "model": "lora1"
    }'

Test Result

(Optional) Documentation Update

@github-actions
Copy link

👋 Hi! Thank you for contributing to the vLLM project.

💬 Join our developer Slack at https://slack.vllm.ai to discuss your PR in #pr-reviews, coordinate on features in #feat- channels, or join special interest groups in #sig- channels.

Just a reminder: PRs would not trigger full CI run by default. Instead, it would only run fastcheck CI which starts running only a small and essential subset of CI tests to quickly catch errors. You can run other CI tests on top of those by going to your fastcheck build on Buildkite UI (linked in the PR checks section) and unblock them. If you do not have permission to unblock, ping simon-mo or khluu to add you in our Buildkite org.

Once the PR is approved and ready to go, your PR reviewer(s) can run CI to test the changes comprehensively before merging.

To run CI, PR reviewers can either: Add ready label to the PR or enable auto-merge.

🚀

@mergify mergify bot added the ci/build label Jul 19, 2025
@mergify
Copy link

mergify bot commented Jul 19, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @CNTRYROA.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added deepseek Related to DeepSeek models needs-rebase labels Jul 19, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces an experimental extension for FusedMoE to support parallel inference with multiple LoRA models. The changes are extensive, touching CUDA kernels, Triton kernels, and various Python layers for model execution and LoRA management. The core idea is to enable LoRA adapters for Mixture-of-Experts layers, which is a significant feature enhancement.

My review focuses on the correctness and robustness of the new kernels and their integration. I've identified a few critical and high-severity issues that should be addressed:

  • A race condition in the new CUDA kernel (moe_lora_align_sum_kernels.cu) could lead to incorrect behavior or memory corruption.
  • Incorrect shared memory calculation in the same CUDA kernel could lead to resource exhaustion and launch failures.
  • Hardcoded values for the number of experts and LoRA rank in the Triton kernels and Python wrappers limit the general applicability of this feature.

These issues are important to fix to ensure the stability and correctness of this new feature. The PR is a work-in-progress, and addressing these points will significantly improve its quality and readiness for merging.

@jeejeelee jeejeelee self-assigned this Jul 20, 2025
@wcwuwc wcwuwc requested a review from WoosukKwon as a code owner July 22, 2025 10:45
@mergify mergify bot removed the needs-rebase label Jul 22, 2025
@mergify
Copy link

mergify bot commented Jul 22, 2025

This pull request has merge conflicts that must be resolved before it can be
merged. Please rebase the PR, @CNTRYROA.

https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/syncing-a-fork

@mergify mergify bot added the needs-rebase label Jul 22, 2025
@mergify mergify bot added documentation Improvements or additions to documentation v1 and removed needs-rebase labels Jul 24, 2025
wcwuwc added 3 commits July 25, 2025 11:27
Signed-off-by: wuchen <[email protected]>
Signed-off-by: wuchen <[email protected]>
jeejeelee and others added 2 commits October 19, 2025 11:05
Signed-off-by: Jee Jee Li <[email protected]>
@mergify mergify bot removed the needs-rebase label Oct 19, 2025
wcwuwc and others added 6 commits October 19, 2025 22:28
Signed-off-by: Chen Wu <[email protected]>
Signed-off-by: Chen Wu <[email protected]>
Signed-off-by: Chen Wu <[email protected]>
enable passing activation func so act_wrapper in lora will be called …
Copy link
Collaborator

@jeejeelee jeejeelee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thank you to everyone who contributed to this PR

@github-project-automation github-project-automation bot moved this from To Triage to Ready in gpt-oss Issues & Enhancements Oct 19, 2025
@jeejeelee jeejeelee added the ready ONLY add when PR is ready to merge/full CI is needed label Oct 19, 2025
@jeejeelee
Copy link
Collaborator

@Yikun @xuechendi @vanbasten23 this PR might affect LoRA in your backend

@xuechendi
Copy link
Contributor

@jeejeelee , oh, Thanks for the info, will check from our backend

@ywang96 ywang96 enabled auto-merge (squash) October 20, 2025 21:03
@ywang96 ywang96 merged commit 5f6cbf6 into vllm-project:main Oct 21, 2025
87 checks passed
Zhuul pushed a commit to Zhuul/vllm that referenced this pull request Oct 21, 2025
Signed-off-by: wuchen <[email protected]>
Signed-off-by: banjuede <[email protected]>
Signed-off-by: Chen Wu <[email protected]>
Signed-off-by: Danielle Robinson <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
Signed-off-by: bk-201 <[email protected]>
Co-authored-by: wuchen <[email protected]>
Co-authored-by: Nathan Van Gheem <[email protected]>
Co-authored-by: banjuede <[email protected]>
Co-authored-by: Danielle Robinson <[email protected]>
Co-authored-by: Jee Jee Li <[email protected]>
Co-authored-by: bk-201 <[email protected]>
albertoperdomo2 pushed a commit to albertoperdomo2/vllm that referenced this pull request Oct 23, 2025
Signed-off-by: wuchen <[email protected]>
Signed-off-by: banjuede <[email protected]>
Signed-off-by: Chen Wu <[email protected]>
Signed-off-by: Danielle Robinson <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
Signed-off-by: bk-201 <[email protected]>
Co-authored-by: wuchen <[email protected]>
Co-authored-by: Nathan Van Gheem <[email protected]>
Co-authored-by: banjuede <[email protected]>
Co-authored-by: Danielle Robinson <[email protected]>
Co-authored-by: Jee Jee Li <[email protected]>
Co-authored-by: bk-201 <[email protected]>
Signed-off-by: Alberto Perdomo <[email protected]>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: wuchen <[email protected]>
Signed-off-by: banjuede <[email protected]>
Signed-off-by: Chen Wu <[email protected]>
Signed-off-by: Danielle Robinson <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
Signed-off-by: bk-201 <[email protected]>
Co-authored-by: wuchen <[email protected]>
Co-authored-by: Nathan Van Gheem <[email protected]>
Co-authored-by: banjuede <[email protected]>
Co-authored-by: Danielle Robinson <[email protected]>
Co-authored-by: Jee Jee Li <[email protected]>
Co-authored-by: bk-201 <[email protected]>
Signed-off-by: 0xrushi <[email protected]>
0xrushi pushed a commit to 0xrushi/vllm that referenced this pull request Oct 26, 2025
Signed-off-by: wuchen <[email protected]>
Signed-off-by: banjuede <[email protected]>
Signed-off-by: Chen Wu <[email protected]>
Signed-off-by: Danielle Robinson <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
Signed-off-by: bk-201 <[email protected]>
Co-authored-by: wuchen <[email protected]>
Co-authored-by: Nathan Van Gheem <[email protected]>
Co-authored-by: banjuede <[email protected]>
Co-authored-by: Danielle Robinson <[email protected]>
Co-authored-by: Jee Jee Li <[email protected]>
Co-authored-by: bk-201 <[email protected]>
Signed-off-by: 0xrushi <[email protected]>
Chenyaaang pushed a commit to Chenyaaang/vllm that referenced this pull request Oct 28, 2025
Signed-off-by: wuchen <[email protected]>
Signed-off-by: banjuede <[email protected]>
Signed-off-by: Chen Wu <[email protected]>
Signed-off-by: Danielle Robinson <[email protected]>
Signed-off-by: Jee Jee Li <[email protected]>
Signed-off-by: bk-201 <[email protected]>
Co-authored-by: wuchen <[email protected]>
Co-authored-by: Nathan Van Gheem <[email protected]>
Co-authored-by: banjuede <[email protected]>
Co-authored-by: Danielle Robinson <[email protected]>
Co-authored-by: Jee Jee Li <[email protected]>
Co-authored-by: bk-201 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci/build deepseek Related to DeepSeek models documentation Improvements or additions to documentation gpt-oss Related to GPT-OSS models qwen Related to Qwen models ready ONLY add when PR is ready to merge/full CI is needed v1

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

[Feature]: Add LoRA support for gpt-oss model