mirror of
https://github.com/kvcache-ai/sglang.git
synced 2026-11-05 01:07:39 +00:00
[PR #84] feat(dsv4): add SGLANG_V4_MARLIN_PARTIAL for partial-expert MoE #84
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#84
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/84
Author: @05yuki
Created: 8/27/2026
Status: 🔄 Open
Base:
main← Head:feat/dsv4-marlin-partial-experts📝 Commits (1)
d2effcbfeat(dsv4): add SGLANG_V4_MARLIN_PARTIAL for partial-expert MoE📊 Changes
2 files changed (+9 additions, -1 deletions)
View changed files
📝
python/sglang/srt/environ.py(+2 -0)📝
python/sglang/srt/layers/quantization/mxfp4_deepseek.py(+7 -1)📄 Description
When KTransformers keeps only a subset of experts resident on the GPU,
the resident partial-expert image is deliberately excluded from the
Marlin W4A16 path and always runs through the triton_kernels matmul_ogs
fallback.
That fallback reserves a fixed device transient at prefill launch,
independent of batch size: measured at roughly 0.5 GB, and about 0.85 GB
in total at 2048-token chunks. A 16 GB card that is also holding a large
KV pool has no room for it, so every prompt long enough to trigger a
real prefill dies with CUDA OOM in the scheduler while short benchmark
prompts keep working. Marlin has no comparable reservation.
Add an opt-in escape hatch: SGLANG_V4_MARLIN_PARTIAL=1 lets the resident
partial-expert image take the Marlin path too. The default is unchanged,
so this cannot affect existing deployments.
Measured on 2x RTX 5070 Ti (SM120, 16 GB each) with DeepSeek-V4-Flash
MXFP4 and KT CPU experts, at a 1M-token pool and 256-token chunks:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.