mirror of
https://github.com/kvcache-ai/sglang.git
synced 2026-11-05 01:07:39 +00:00
[PR #64] feat(kt): add --kt-skip-gpu-expert-cpu-copy to reclaim host RAM for GPU experts #64
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#64
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/64
Author: @gvr13n
Created: 7/12/2026
Status: 🔄 Open
Base:
main← Head:feat/kt-skip-gpu-expert-cpu-copy📝 Commits (1)
d9a8b1cfeat(kt): add --kt-skip-gpu-expert-cpu-copy to reclaim host RAM for GPU experts📊 Changes
2 files changed (+29 additions, -0 deletions)
View changed files
📝
python/sglang/srt/layers/moe/kt_ep_wrapper.py(+19 -0)📝
python/sglang/srt/server_args.py(+10 -0)📄 Description
Companion to the kt-kernel PR (kvcache-ai/ktransformers#2085); see kvcache-ai/ktransformers#2084 for the full rationale and numbers.
Adds the user-facing
--kt-skip-gpu-expert-cpu-copyserver arg and resolves it into an effective flag passed toKTMoEWrapper:Only paths whose full-GPU prefill fallback is mask-aware may skip: MXFP4's
_prepare_weight_mxfp4→_prepare_weight_fp8copies GPU experts device-to-device fromoriginal_layerand never reads the CPU copies; MXFP4's dynamic-update mask rewrite is unconditionally skipped, so its mask is static even with--kt-enable-dynamic-expert-updateon. If the flag cannot be honored (e.g. MXFP8 + dynamic update), it warns once at layer 0 and falls back to stock behavior — safe by construction.Measured on DeepSeek-V4-Flash (MXFP4, 100–110 GPU experts, RTX PRO 6000 + 123GB RAM): scheduler RSS ~172GB → ~99GB, decode swap io → 0, identical output.
Diff is pure additions (+29, 2 files:
server_args.py,kt_ep_wrapper.py), rebased on current main.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.