mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2026-11-05 01:07:28 +00:00
[GH-ISSUE #1618] [GLM-4.6 + KT-Kernel] TypeError in unquant.create_weights: w13_weight_n is None when enabling kt_ep_wrapper #1052
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
kvcache-ai/ktransformers#1052
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 @EonHao on GitHub (Nov 15, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1618
Originally assigned to: @ouqingliang, @SkqLiao, @ovowei on GitHub.
I’m trying to run GLM-4.6 with KT-Kernel (CPU experts) via SGLang, using the official GLM-4.6 weights and the official
convert_cpu_weights.pyscript. The model loads fine without KT-Kernel, but as soon as I enable--kt-methodand--kt-weight-path, the scheduler fails during model initialization with:The stack trace points to
unquant.pyandkt_ep_wrapper.py, wherew13_weight_nappears to beNone.I’d like to confirm whether GLM-4.6 is expected to work with the KT-Kernel MoE EP backend right now, and if so, what the correct configuration / conversion steps are.
Environment
Machine:
GPUs:
OS: Linux x86_64 (root@10-0-0-14, Ubuntu-like environment)
Python: 3.11 (Conda env
kt-kernel)SGLang: installed from GitHub
KT-Kernel:
Built in the same environment, with:
PyTorch / NCCL:
sglang is using nccl==2.27.3andcudaDriverVersion 12040Model & Weights
Base model: GLM-4.6, from ZhipuAI’s official release on ModelScope.
GPU weights path:
/home/ubuntu/GLM-4.6CPU weights conversion (official script):
So the CPU weights directory is:
/root/GLM-4.6-cpu-weightsLaunch Command (with KT-Kernel, where it fails)
What works
If I remove all
--kt-*arguments, GLM-4.6 loads and serves correctly on the same machine with the same SGLang build, e.g.:So the base GLM-4.6 + SGLang setup seems fine; the issue only appears once KT-Kernel MoE is enabled.
Error Log (truncated)
After torch distributed init and “Load weight begin”, I get the following exception from multiple TP ranks:
The same stack trace appears on TP1/TP2/TP3.
Questions
kt_ep_wrapper)?convert_cpu_weights.pyscript need additional arguments for GLM-4.6, or are there known missing metadata fields (likew13_weight_n) for this model?kt-method, or a temporary patch) to get GLM-4.6 running with CPU experts?Happy to provide more logs (full
sglangstdout,config.json,quant_config, etc.) if needed.@EonHao commented on GitHub (Nov 16, 2025):
After further debugging, the error does not come from GLM-4.6 weights or from KT-Kernel conversion.
The actual root cause is that SGLang receives
kt_num_gpu_experts=None, because the launch command did not explicitly specify:Inside
KTEPWrapperMethod.create_weights, SGLang forwards this parameter into:Since
self.num_gpu_experts = None, the call becomes:which produces the exact error seen:
So the
Noneoriginates beforeunquant.py, not from a shape inference failure.@ovowei commented on GitHub (Nov 17, 2025):
try passing --kt-num-gpu-experts explicitly in your launch arguments.