kvcache-ai-ktransformers/kt-kernel/python
devangpratap 89d30a3d01
Some checks failed
Book-CI / test (push) Has been cancelled
Book-CI / test-1 (push) Has been cancelled
Book-CI / test-2 (push) Has been cancelled
Deploy / deploy (macos-latest) (push) Has been cancelled
Deploy / deploy (ubuntu-latest) (push) Has been cancelled
Deploy / deploy (windows-latest) (push) Has been cancelled
[fix(loader)]: correct off-by-one expert-count guard in load_experts (#2026)
* [fix(loader)]: correct off-by-one expert-count guard in SafeTensorLoader.load_experts

After the discovery loop, max_experts_count is the highest expert index found
(expert count - 1), and is -1 only when the key has no experts. The guard
checked == 0, which falsely rejected single-expert layers and silently returned
empty weight lists for the zero-expert case. Check == -1 instead.

Adds a CPU regression test covering the single-, zero-, and multi-expert cases.

* [test(loader)]: import loader as a top-level module in expert-count guard test

Per review feedback: add python/utils to sys.path and import loader directly
instead of the importlib.util boilerplate. Still bypasses utils/__init__.py
(and the compiled kt_kernel_ext) while keeping the import idiomatic.
2026-06-07 23:41:04 +08:00
..
cli [fix](cli): detect SGLANG_DSV4_2604_SUBMODE conflict before launch (#2025) 2026-05-30 19:20:47 +08:00
sft [feat](kt-lora): add end-to-end Qwen3.5 MoE KT LoRA serving workflow (#2031) 2026-06-05 16:57:14 +08:00
utils [fix(loader)]: correct off-by-one expert-count guard in load_experts (#2026) 2026-06-07 23:41:04 +08:00
__init__.py [fix](kt-kernel): pin torch 2.9.1 wheel baseline 2026-04-30 00:57:24 +08:00
_cpu_detect.py [feat](kt-kernel): Fix CPU instruction set variants for build & install (#1746) 2025-12-24 18:57:45 +08:00
experts.py Release/0.6.2.post3: carry kt-kernel SwiGLU clamp companion missing from post2 2026-05-10 03:55:02 +08:00
experts_base.py Release/0.6.2.post3: carry kt-kernel SwiGLU clamp companion missing from post2 2026-05-10 03:55:02 +08:00