fix: torch-native LoRA for multi-adapter case#20564
Merged
Fridge003 merged 6 commits intosgl-project:mainfrom Mar 26, 2026
Merged
fix: torch-native LoRA for multi-adapter case#20564Fridge003 merged 6 commits intosgl-project:mainfrom
Fridge003 merged 6 commits intosgl-project:mainfrom
Conversation
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
added 3 commits
March 16, 2026 23:53
…ging Use weight_indices=[0,0,1] with batch_size=3 so unique_consecutive merges into 2 segments, covering the num_segments != batch_size path.
output_offset had 4 slices but run_qkv_lora hardcodes num_slices=3 for lora_a, causing shape mismatch when lora_b reads the 4th slice.
Collaborator
|
/tag-and-rerun-ci |
🔍 SGLang Domain Expert ReviewPR: fix: torch-native LoRA for multi-adapter case (#20564) Routing
lora ReviewRisk Level: Low Summary: Correct and minimal fix for a real bug where Issues Found:
Suggestions:
Looks Good:
Generated by SGLang domain expert review agents. |
Contributor
Author
|
/rerun-failed-ci try again 3 |
zminglei
approved these changes
Mar 24, 2026
Collaborator
|
/rerun-failed-ci |
1 similar comment
Contributor
Author
|
/rerun-failed-ci |
Fridge003
approved these changes
Mar 26, 2026
satyamk7054
added a commit
to satyamk7054/sglang
that referenced
this pull request
Apr 3, 2026
Co-authored-by: Satyam Kumar <satyamk@linkedin.com>
JustinTong0323
pushed a commit
to JustinTong0323/sglang
that referenced
this pull request
Apr 7, 2026
Co-authored-by: Satyam Kumar <satyamk@linkedin.com>
yhyang201
pushed a commit
to yhyang201/sglang
that referenced
this pull request
Apr 22, 2026
Co-authored-by: Satyam Kumar <satyamk@linkedin.com>
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
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.
Motivation
Fix
RuntimeErrorintorch_nativeLoRA backend when a batch contains multiple requests where some (but not all) consecutive requests share the same adapter.prepare_lora_batchusestorch.unique_consecutiveto deduplicate consecutive weight indices, but then usesbatch_sizeinstead of the unique count for theweight_indicescopy andnum_segments.Modifications
Accuracy Tests
Updated unit test
Benchmarking and Profiling
Checklist
Review Process
/tag-run-ci-label,/rerun-failed-ci,/tag-and-rerun-ci