mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1859] SGLang main passes num_gpu_experts but kt-kernel expects gpu_experts_mask #1157
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#1157
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?
Originally created by @vshortt73 on GitHub (Feb 22, 2026).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1859
Reminder
System Info
main@16a8b98(support qwen3.5 #1846)main@ 45095bac7Reproduction
Repository: kvcache-ai/ktransformers
Summary
Latest SGLang
main(45095bac7) passesnum_gpu_experts(int) toKTMoEWrapper.__new__(), but latest kt-kernelmain(16a8b98) expectsgpu_experts_mask(torch.Tensor). This causes aTypeErroron any model using KTransformers expert offloading.Error
Root Cause
SGLang's
kt_ep_wrapper.pyline 225:But
kt_kernel.KTMoEWrapper.__new__()signature expects:Others
Workaround
Patch
kt_ep_wrapper.pyto convert the int to a boolean mask:Suggestion
Either:
num_gpu_expertsas an alternative parameter, orThis affects any model using KTransformers offloading, not just gpt-oss.
@ErvinXie commented on GitHub (Feb 28, 2026):
This API mismatch occurs because you are using SGLang upstream
mainbranch, which is not synchronized with kt-kernel's interface. Please use the KTransformers fork of SGLang (https://github.com/kvcache-ai/sglang) instead, where the API contract between SGLang and kt-kernel is kept in sync.This reply was generated by an AI agent and reviewed by a human.
@ErvinXie commented on GitHub (Feb 28, 2026):
This is caused by using SGLang upstream main instead of the KTransformers fork. Please use https://github.com/kvcache-ai/sglang. Closing.