mirror of
https://github.com/kvcache-ai/sglang.git
synced 2026-11-05 01:07:39 +00:00
[PR #82] [MERGED] fix(lora): support all-target KT MoE adapters #81
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/sglang#81
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/kvcache-ai/sglang/pull/82
Author: @yyj6666667
Created: 8/27/2026
Status: ✅ Merged
Merged: 8/31/2026
Merged by: @yyj6666667
Base:
main← Head:fix/kt-lora-all-model-serving📝 Commits (6)
9a4de96fix(lora): enforce KT composite adapter contract9405729feat(lora): support all-target Qwen MoE adaptersadf32b0feat(lora): serve DeepSeek adapters with native FP8 experts45058c3fix(lora): avoid registry refs for static KT adapters6820dfcfix(lora): harden mixed-shape Qwen3.5 execution5047631fix(lora): preserve DeepSeek deltas in optimized paths📊 Changes
24 files changed (+2930 additions, -235 deletions)
View changed files
📝
python/sglang/srt/entrypoints/grpc_server.py(+29 -0)📝
python/sglang/srt/layers/moe/kt_ep_wrapper.py(+135 -5)📝
python/sglang/srt/lora/layers.py(+58 -0)📝
python/sglang/srt/lora/lora_manager.py(+275 -10)📝
python/sglang/srt/lora/mem_pool.py(+112 -114)📝
python/sglang/srt/lora/triton_ops/chunked_sgmv_expand.py(+10 -1)📝
python/sglang/srt/lora/triton_ops/chunked_sgmv_shrink.py(+8 -1)📝
python/sglang/srt/lora/utils.py(+30 -8)📝
python/sglang/srt/managers/tokenizer_communicator_mixin.py(+57 -0)📝
python/sglang/srt/managers/tokenizer_manager.py(+80 -4)📝
python/sglang/srt/model_executor/cuda_graph_runner.py(+1 -3)📝
python/sglang/srt/model_executor/model_runner.py(+1 -1)📝
python/sglang/srt/model_executor/piecewise_cuda_graph_runner.py(+2 -4)📝
python/sglang/srt/models/deepseek_common/deepseek_weight_loader.py(+4 -2)📝
python/sglang/srt/models/deepseek_v2.py(+240 -17)📝
python/sglang/srt/models/qwen2_moe.py(+4 -2)📝
python/sglang/srt/models/qwen3_5.py(+14 -15)📝
python/sglang/srt/models/qwen3_moe.py(+30 -0)📝
python/sglang/srt/server_args.py(+284 -48)📝
python/sglang/srt/utils/common.py(+14 -0)...and 4 more files
📄 Description
What does this PR do?
This PR completes the static KT composite LoRA serving path for supported MoE models.
A merged adapter is loaded once, split into GPU non-expert and KT routed-expert tensors, and exposed under one immutable adapter ID.
Main changes
kv_b_projLoRA in MLA absorb paths without merging or requantizing the native FP8 base weight.Tests
65 passedacross the common contract, request-policy, Qwen MoE, and DeepSeek suites, including a real CUDA regression for mixed-width CSGMV launches.Real adapters were validated on sap4 with startup, generation, chat completion, request-policy checks, graceful shutdown, and TP1/TP2 comparison:
TP parity is a tolerance-based distribution check under fixed prompts: exact input top-1 token IDs, bounded selected-token log-probability differences, top-20 overlap, a non-empty common output prefix, and successful generation. It does not claim bit-exact output across TP sizes. Qwen3.5 additionally produced identical TP1/TP2 greedy tokens, generation text, and chat text.
black --check,isort --check-only,ruff --select F401,F821,py_compile, andgit diff --checkpass for all changed Python files. The sap4 validation source matches the submitted files by SHA256.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.