Skip to content

Redesign multi-LoRA - #33299

Merged
yushengsu-thu merged 3 commits into
sglang-milesfrom
sglang-redesign-multi-lora
Aug 4, 2026
Merged

yushengsu-thu merged 3 commits into
sglang-milesfrom
sglang-redesign-multi-lora

Conversation

@yushengsu-thu

@yushengsu-thu yushengsu-thu commented Aug 2, 2026 •

Copy link
Copy Markdown
Collaborator

Hardening for miles multi-LoRA serving (slot oversubscription with registration-scoped adapters):

  • Exactly-once lease release: _finalize_lora_lease + ReqState.lora_lease_released close both the lease leak on abort/error paths and the finish+abort double-release; either wedges wait_for_zero_leases.
  • Atomic acquire: registry lookup + counter increment now run inside the writer lock.
  • LoRARef.reloadable: eviction keeps the catalog entry; implicit reload of a non-reloadable (distributed-loaded) adapter is a hard error instead of silently serving stale weights; explicit unload drops lora_ref_cache.
  • API-key check on the two LoRA control endpoints.
  • 14 new lease unit tests + abort-prefix stub fixes for upstream scheduler fields.

Used by miles PR: radixark/miles#2137


CI States

Latest PR Test (Base): ❌ Run #30865020522
Latest PR Test (Extra): ❌ Run #30865020325

Copilot AI review requested due to automatic review settings August 2, 2026 23:10
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Lease release now goes through a single _finalize_lora_lease guarded by
ReqState.lora_lease_released, closing both the leak (aborted/errored
requests never releasing) and the double-release (finish + abort both
decrementing) that each wedge wait_for_zero_leases. Registry acquire
performs its lookup and counter increment inside the writer lock,
removing the lookup/increment race. 14 unit tests cover the lease state
machine.
Distributed-loaded adapters register as reloadable=False: eviction keeps
the catalog entry but implicit reload of a non-reloadable adapter is a
hard error instead of silently serving stale weights, and explicit
unload drops the lora_ref_cache entry. The two LoRA control endpoints
now run the API-key check. Abort-prefix unit-test stubs track upstream
scheduler fields (dllm_config, pp_size, last_batch).
@github-actions github-actions Bot added the lora label Aug 4, 2026
@yushengsu-thu
yushengsu-thu force-pushed the sglang-redesign-multi-lora branch from a0f40e5 to fa4caa8 Compare August 4, 2026 00:15
@yushengsu-thu
yushengsu-thu merged commit e22f56c into sglang-miles Aug 4, 2026
73 of 82 checks passed
@yushengsu-thu
yushengsu-thu deleted the sglang-redesign-multi-lora branch August 4, 2026 00:33
yueming-yuan pushed a commit that referenced this pull request Aug 25, 2026
Kh4L pushed a commit to Kh4L/sglang that referenced this pull request Sep 8, 2026
Zhichenzzz pushed a commit that referenced this pull request Sep 19, 2026
(cherry picked from commit 642106b)
(cherry picked from commit 3069f6f)
HJSang pushed a commit to HJSang/sglang that referenced this pull request Sep 21, 2026
ziang-and pushed a commit to zianglih/sglang that referenced this pull request Oct 2, 2026
…lication (sgl-project#27268, sgl-project#31759, sgl-project#30913, sgl-project#30912, sgl-project#33299, sgl-project#36384, sgl-project#38165)

Register adapter identities, stream their tensors within weight-update sessions, and publish checksum-verified fresh versions alongside generation. Preserve per-rank failure cleanup and request-prefix cancellation for adapter lifecycle management.

Co-authored-by: Mathew Han <mathewjhan@gmail.com>
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.com>
nv-hwoo pushed a commit to nv-hwoo/sglang that referenced this pull request Oct 20, 2026
…lication (sgl-project#27268, sgl-project#31759, sgl-project#30913, sgl-project#30912, sgl-project#33299, sgl-project#36384, sgl-project#38165)

Register adapter identities, stream their tensors within weight-update sessions, and publish checksum-verified fresh versions alongside generation. Preserve per-rank failure cleanup and request-prefix cancellation for adapter lifecycle management.

Co-authored-by: Mathew Han <mathewjhan@gmail.com>
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.com>
nanjiangwill pushed a commit to modal-projects/sglang that referenced this pull request Oct 21, 2026
…lication (sgl-project#27268, sgl-project#31759, sgl-project#30913, sgl-project#30912, sgl-project#33299, sgl-project#36384, sgl-project#38165)

Register adapter identities, stream their tensors within weight-update sessions, and publish checksum-verified fresh versions alongside generation. Preserve per-rank failure cleanup and request-prefix cancellation for adapter lifecycle management.

Co-authored-by: Mathew Han <mathewjhan@gmail.com>
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.com>
(cherry picked from commit c40cd81)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VDwTQn4gGFgVhzGXFs4aJx
Rockdu pushed a commit that referenced this pull request Oct 30, 2026
…lication (#27268, #31759, #30913, #30912, #33299, #36384, #38165)

Register adapter identities, stream their tensors within weight-update sessions, and publish checksum-verified fresh versions alongside generation. Preserve per-rank failure cleanup and request-prefix cancellation for adapter lifecycle management.

Co-authored-by: Mathew Han <mathewjhan@gmail.com>
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.com>
Rockdu pushed a commit that referenced this pull request Oct 30, 2026
…lication (#27268, #31759, #30913, #30912, #33299, #36384, #38165)

Register adapter identities, stream their tensors within weight-update sessions, and publish checksum-verified fresh versions alongside generation. Preserve per-rank failure cleanup and request-prefix cancellation for adapter lifecycle management.

Co-authored-by: Mathew Han <mathewjhan@gmail.com>
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.com>
Rockdu pushed a commit that referenced this pull request Oct 31, 2026
…lication (#27268, #31759, #30913, #30912, #33299, #36384, #38165)

Register adapter identities, stream their tensors within weight-update sessions, and publish checksum-verified fresh versions alongside generation. Preserve per-rank failure cleanup and request-prefix cancellation for adapter lifecycle management.

Co-authored-by: Mathew Han <mathewjhan@gmail.com>
Co-authored-by: Ethan (Yusheng) Su <yushengsu.thu@gmail.com>
Co-authored-by: Yueming Yuan <yym022502@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants