mirror of
https://github.com/kvcache-ai/sglang.git
synced 2026-11-05 01:07:39 +00:00
[PR #91] kt: plumb --kt-mmap-experts-dir through to the KT MoE wrapper #93
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#93
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/91
Author: @tim-odonnell
Created: 9/7/2026
Status: 🔄 Open
Base:
main← Head:kt-mmap-experts-dir📝 Commits (1)
f8bf78bkt: plumb --kt-mmap-experts-dir through to the KT MoE wrapper📊 Changes
2 files changed (+15 additions, -0 deletions)
View changed files
📝
python/sglang/srt/layers/moe/kt_ep_wrapper.py(+3 -0)📝
python/sglang/srt/server_args.py(+12 -0)📄 Description
What
Companion to kvcache-ai/ktransformers#2190 — plumbs
--kt-mmap-experts-dirthrough to the KT MoE wrapper.
When set, the kt-kernel CPU MoE kernels keep each CPU-resident expert's
BufferBweight block in a
MAP_SHAREDfile under this directory instead of anonymous RAM,so a host whose CPU expert working set is close to total RAM can serve the model
(cold experts reclaim without swap, refault from the file). Unset (default) →
unchanged anonymous behaviour.
How
server_args.py:--kt-mmap-experts-dir/ServerArgs.kt_mmap_experts_dir.kt_ep_wrapper.py: carried onKTConfig, passed to the inferenceKTMoEWrapper(the SFT wrapper path is unchanged).Requires the matching kt-kernel change (
KTMoEWrappermmap_experts_dirkwarg →GeneralMOEConfig.mmap_weights_dir, kvcache-ai/ktransformers#2190). Akt_kernelbuild without it simply ignores the flag.
Testing
End-to-end with kvcache-ai/ktransformers#2190 on 1× CMP-170HX (sm_80) + 128 GB
DDR5, DeepSeek-V4-Flash-0731 native MXFP4/FP8:
--kt-mmap-experts-dirflows toKTConfig→KTMoEWrapper→MOEConfig.mmap_weights_dir; scheduler processanonymous RSS drops from ~105 GiB to ~2.4 GiB; decode throughput, VRAM, and
greedy outputs unchanged.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KW36fR7syvcTaG7Yqqq8pP
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.