54 Commits

Author SHA1 Message Date
github-actions[bot] f7607c0f66 [build]: sync sglang submodule to 541ddc37cbc92c60dc748db5ff1a2aad0b069a80 (#2166)
Co-authored-by: ovowei <80044717+ovowei@users.noreply.github.com>
2026-09-19 11:06:54 +08:00
Pan-Boyi 040a4980ec [feat](kt-kernel): Ascend NPU backend for single-card DeepSeek-V4-Flash offload (#2157) 2026-09-01 20:10:24 +08:00
yyj 21095b9912 [build] sync SGLang for KT LoRA serving (#2182)
Advance third_party/sglang to main@3424f35d, including all-target KT MoE adapter serving, the MXFP4 routed-scaling fix, and the GLM-5.3 MTP metadata fix.
2026-08-31 17:19:23 +08:00
yyj 063500785b build: sync GLM-5.3 config compatibility fix (#2177) 2026-08-27 22:24:50 +08:00
yyj 41613064c7 feat(GLM): add native GLM-5.3-flash support (#2173)
* feat: support SwiGLU limit for block FP8 experts

* perf(fp8): add native layerwise batch transport

* feat(fp8): support layerwise transport for TP1/2/4/8

* release: prepare GLM-5.3-flash support

* docs(glm): refine GLM-5.3-flash documentation

* docs(glm): simplify release announcement
2026-08-26 22:45:12 +08:00
yyj ea81f4e9e5 ci: automate coordinated KT PyPI releases (#2162) 2026-08-18 17:09:59 +08:00
github-actions[bot] eb9b70c411 [build]: sync sglang submodule (#2069) 2026-08-08 18:45:46 +08:00
yyj 1a14f473cc [build] Sync sglang-kt submodule #2117 2026-08-02 20:11:37 +08:00
callmegaga 0c2912a5e2 [feat] Add SYCL backend for intel iGPU (#2089)
* [feat](sycl): add sycl backend for igpu

* [feat](sycl): improve prefill

* [feat](sycl): finish and test sycl gptq int4
2026-07-17 16:24:04 +08:00
callmegaga 7c021b430c [chore](sglang): bump sglang submodule for FP16 FE8M0 Marlin fix (#2082) 2026-07-10 11:18:45 +08:00
github-actions[bot] 459df61262 [build] Sync sglang-kt submodule (v0.6.3) (#2055) 2026-06-25 20:41:04 +08:00
github-actions[bot] ce7c3ddbe9 [build]: sync sglang submodule to 8b636f9008dbad58c0a8e481b03e794739e6c146 (#2047)
Co-authored-by: ovowei <80044717+ovowei@users.noreply.github.com>
2026-06-21 17:37:52 +08:00
github-actions[bot] c1cb22311b [build]: sync sglang submodule to 51032b71279d9038058563f8d2e758d99b278ef4 (#2032)
Co-authored-by: ovowei <80044717+ovowei@users.noreply.github.com>
2026-06-05 19:24:22 +08:00
Jiaheng Dai c9a915e6ac [feat](kt-lora): add end-to-end Qwen3.5 MoE KT LoRA serving workflow (#2031)
* [feat](kt-lora): add KT expert LoRA adapter serving

* [feat]: pin Qwen3.5 non-expert LoRA support

* [feat](kt-lora): add merged SGLang adapter workflow

Document the KT SFT to SGLang serving loop and extend the converter with optional split outputs so users can serve one merged adapter while retaining debug-friendly expert/non-expert artifacts.

Co-authored-by: Cursor <cursoragent@cursor.com>

* [fix](kt-lora): validate adapter conversion

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 16:57:14 +08:00
github-actions[bot] 95e20f9c55 [build]: sync sglang submodule to ebaff7729b9e41c29d94f8d19a53473d321dc566 (#2005)
Co-authored-by: ovowei <80044717+ovowei@users.noreply.github.com>
2026-05-14 22:25:31 +08:00
Benjamin F 37db9a3b83 0.6.2.post2: submodule refactor and update tutorial (#1993)
- sglang submodule -> 43ed1ec77: V4-Flash hybrid SWA chunked-prefill
  hang fix (#44) + DSV4 plugin registry refactor (#47)
- pin sglang-kt==0.6.2.post2
- tutorial: switch V4-Flash launch example from 8x RTX 5090 to
  single-card (decode 20+ tok/s); flip Ada Lovelace SM_89 row to
  validated; update Hardware Requirements GPU line accordingly
2026-05-09 18:53:59 +08:00
Benjamin F 96189972d8 build: bump sglang submodule to c9edb75e0 (V4-Flash GPU prefill fallback fix + perf) (#1975) 2026-05-03 19:42:19 +08:00
Benjamin F bb3b6e8413 build: bump sglang submodule to 40d3a82 (V4-Flash flashinfer guard) (#1972) 2026-05-03 14:06:33 +08:00
Benjamin F 041bdfc636 [New Model] DeepSeek-V4-Flash: kt-kernel MXFP4 MoE + sglang hybrid inference (#1970)
* [feat](kt-kernel): add MXFP4 MoE operator with E2M1 weights × BF16 activations

Implements AMX_FP4_MOE_TP based on the RAWINT4 (k2-moe) CRTP pattern.
FP4 E2M1 weights are nibble-packed and decoded via PSHUFB LUT, then
computed with BF16 activations using _mm512_dpbf16_ps. Supports weight-only
per-kgroup scaling (group_size=32) and tensor parallelism.

Includes a Python validation test covering uniform, alternating, ramp,
and random weight patterns.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* [feat](kt-kernel): adapt MXFP4 MoE backend for DeepSeek-V4-Flash (#1950)

V4-Flash routed experts ship as native MXFP4 (E2M1 nibble + ue8m0 group
scale). Expose AMXFP4_KGroup_MOE through NativeMoEWrapper, add a loader
that handles V4's `layers.{L}.ffn.experts.{i}.{w1,w3,w2}.{weight,scale}`
naming and converts ue8m0 → bf16 via a lossless bit-cast, register the
model entry, and ship an end-to-end numerical validation script.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* [perf](kt-kernel): MXFP4 MoE add mat-mat 4×4 tile, refine mat-vec reduce (#1957)

mat_mul_kgroup previously aliased to fp4_mat_vec_kgroup, leaving large
batches stuck on the per-token path. Implement fp4_mat_mat_kgroup as a
4×4 register tile (MB=NB=4, 16 zmm accumulators) so each PSHUFB decode
of four weight rows is reused across four tokens.

Refactor fp4_mat_vec_kgroup to accumulate four N-rows in parallel and
flush them with a new reduce4 helper, removing per-row reduce_add_ps
calls from the hot loop. Mark mxfp4_to_bf16_32 always_inline.

Add bench/bench_fp4_moe.py with --routing {balanced,concentrated} and
a backend registry so future kernels can be added without changing the
runner.

Dispatch thresholds, derived_init, GeneralMOEConfig handling,
load_weights, write_weights_to_buffer and the TP_MOE specialization are
unchanged.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* fix(loader): avoid uint16 lshift in ue8m0->bf16 conversion

PyTorch CPU has no lshift kernel for UInt16, so the previous
`(scale_t.to(torch.uint16) << 7)` raised NotImplementedError when
loading any V4-Flash MXFP4 routed-expert scale tensor on the host.

Switch to int32 for the shift (kernel exists) and narrow to int16
afterwards. The shifted value max is 255<<7 = 32640, well within
int16 range, so the narrow is lossless. The .view(bfloat16) bit
pattern is identical (bf16 sign bit is always 0 for ue8m0 values).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* docs(v4-flash): hybrid CPU/GPU recipe + bump kt-sglang submodule

Bumps third_party/sglang to kvcache-ai/sglang main (3cbd49c29) which now
contains DeepSeek V4 Flash model support + consumer-GPU (SM_120) portable
Triton/TileLang fallbacks (kt-sglang PR #38).

Adds doc/en/DeepSeek-V4-Flash.md tutorial: 8x RTX 5090 hybrid recipe with
the full launch command, OpenAI-compatible /generate + /v1/chat/completions
examples, and the kt chat CLI client.

---------

Co-authored-by: ouqingliang <1692110604@qq.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-03 10:48:31 +08:00
github-actions[bot] fe06c4d355 [build]: sync sglang submodule to 537eb762b0881071a0e098bd78666fe052b83deb (#1967)
Co-authored-by: ovowei <80044717+ovowei@users.noreply.github.com>
2026-05-02 12:42:04 +08:00
Peilin Li ef5822639f [fix](kt-kernel): pin torch 2.9.1 wheel baseline
Pin kt-kernel torch 2.9.1 metadata, update autosetup for cu130 wheels, register kt_kernel.kt_kernel_ext, and bump the sglang submodule.
2026-04-30 00:57:24 +08:00
Benjamin F 9f34ef46e6 [fix](Qwen3 series): fix gibberish output by correcting RoPE write-back (#31) (#1959) 2026-04-27 22:04:29 +08:00
Peilin Li bc7afff13b [chore]: sync sglang-kt packaging fix
Update third_party/sglang to the merged sglang-kt 0.6.1 dependency metadata fix so the release workflow builds the corrected inference package.
2026-04-25 21:02:25 +08:00
Oql ad19a3e653 Chore/kt layerwise prefill main (#1920)
* [chore]: sync sglang submodule with KT layerwise prefill log rename

* [chore]: use sglang main with KT layerwise prefill logs
2026-04-09 11:28:37 +08:00
Oql 9e6484a538 [fix]: fix --numa-nodes handling (#1904)
* [fix]: fix --numa-nodes handling
2026-03-31 17:50:22 +08:00
Oql cdc867c864 [chore]: sync sglang submodule (#1903) 2026-03-31 11:21:09 +08:00
github-actions[bot] 7a4b9b0e87 [build]: sync sglang submodule to f6adb4f473ba9a767cd60237ef8325cfcd97eba9 (#1876)
Co-authored-by: ovowei <80044717+ovowei@users.noreply.github.com>
2026-03-04 17:18:08 +08:00
Jianwei Dong 15c624dcae Fix/sglang kt detection (#1875)
* [feat]: simplify sglang installation with submodule, auto-sync CI, and version alignment

- Add kvcache-ai/sglang as git submodule at third_party/sglang (branch = main)
- Add top-level install.sh for one-click source installation (sglang + kt-kernel)
- Add sglang-kt as hard dependency in kt-kernel/pyproject.toml
- Add CI workflow to auto-sync sglang submodule daily and create PR
- Add CI workflow to build and publish sglang-kt to PyPI
- Integrate sglang-kt build into release-pypi.yml (version.py bump publishes both packages)
- Align sglang-kt version with ktransformers via SGLANG_KT_VERSION env var injection
- Update Dockerfile to use submodule and inject aligned version
- Update all 13 doc files, CLI hints, and i18n strings to reference new install methods

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [build]: bump version to 0.5.2

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [build]: rename PyPI package from kt-kernel to ktransformers

Users can now `pip install ktransformers` to get everything
(sglang-kt is auto-installed as a dependency).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* Revert "[build]: rename PyPI package from kt-kernel to ktransformers"

This reverts commit e0cbbf6364.

* [build]: add ktransformers meta-package for PyPI

`pip install ktransformers` now works as a single install command.
It pulls kt-kernel (which in turn pulls sglang-kt).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [fix]: show sglang-kt package version in kt version command

- Prioritize sglang-kt package version (aligned with ktransformers)
  over sglang internal __version__
- Update display name from "sglang" to "sglang-kt"

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [fix]: improve sglang-kt detection in kt doctor and kt version

Recognize sglang-kt package name as proof of kvcache-ai fork installation.
Previously both commands fell through to "PyPI (not recommended)" for
non-editable local source installs. Now version.py reuses the centralized
check_sglang_installation() logic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

* [build]: bump version to 0.5.2.post1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-04 16:54:48 +08:00
Jiaqi Liao e69c67713f [refactor] fix third_party issue (#1632)
* [refactor]: relocate third_party directory

* [fix]: fix custom_flashinfer for kt-sft
2025-11-20 13:55:55 +08:00
Jiaqi Liao 57d14d22bc Refactor: restructure repository to focus on kt-kernel and KT-SFT modulesq recon (#1581)
* refactor: move legacy code to archive/ directory

  - Moved ktransformers, csrc, third_party, merge_tensors to archive/
  - Moved build scripts and configurations to archive/
  - Kept kt-kernel, KT-SFT, doc, and README files in root
  - Preserved complete git history for all moved files

* refactor: restructure repository to focus on kt-kernel and KT-SFT modules

* fix README

* fix README

* fix README

* fix README

* docs: add performance benchmarks to kt-kernel section

Add comprehensive performance data for kt-kernel to match KT-SFT's presentation:
- AMX kernel optimization: 21.3 TFLOPS (3.9× faster than PyTorch)
- Prefill phase: up to 20× speedup vs baseline
- Decode phase: up to 4× speedup
- NUMA optimization: up to 63% throughput improvement
- Multi-GPU (8×L20): 227.85 tokens/s total throughput with DeepSeek-R1 FP8

Source: https://lmsys.org/blog/2025-10-22-KTransformers/

This provides users with concrete performance metrics for both core modules,
making it easier to understand the capabilities of each component.

* refactor: improve kt-kernel performance data with specific hardware and models

Replace generic performance descriptions with concrete benchmarks:
- Specify exact hardware: 8×L20 GPU + Xeon Gold 6454S, Single/Dual-socket Xeon + AMX
- Include specific models: DeepSeek-R1-0528 (FP8), DeepSeek-V3 (671B)
- Show detailed metrics: total throughput, output throughput, concurrency details
- Match KT-SFT presentation style for consistency

This provides users with actionable performance data they can use to evaluate
hardware requirements and expected performance for their use cases.

* fix README

* docs: clean up performance table and improve formatting

* add pic for README

* refactor: simplify .gitmodules and backup legacy submodules

- Remove 7 legacy submodules from root .gitmodules (archive/third_party/*)
- Keep only 2 active submodules for kt-kernel (llama.cpp, pybind11)
- Backup complete .gitmodules to archive/.gitmodules
- Add documentation in archive/README.md for researchers who need legacy submodules

This reduces initial clone size by ~500MB and avoids downloading unused dependencies.

* refactor: move doc/ back to root directory

Keep documentation in root for easier access and maintenance.

* refactor: consolidate all images to doc/assets/

- Move kt-kernel/assets/heterogeneous_computing.png to doc/assets/
- Remove KT-SFT/assets/ (images already in doc/assets/)
- Update KT-SFT/README.md image references to ../doc/assets/
- Eliminates ~7.9MB image duplication
- Centralizes all documentation assets in one location

* fix pic path for README
2025-11-10 17:42:26 +08:00
wanghanqingLYT e7e2c2bd70 merge arm branch for sgemm.cpp, tinyblas_cpu_sgemm.inc and iqk_mul_mat.inc 2025-09-08 14:11:17 +08:00
ouqingliang 3b4a1c7532 add prefix cache support for kvc2. 2025-06-26 04:57:25 +00:00
Atream 753075728c update-custom-flashinfer 2025-04-30 10:45:25 +00:00
qiyuxinlin 74bb7fdcf6 Merge remote-tracking branch 'dev/support-amx-2' 2025-04-28 18:46:51 +00:00
djw 3f9bbf1181 support qwen3, dont speak human language 2025-04-28 08:44:47 +00:00
PC-DOS 5379e68f19 Replaced Chinese comments with English to avoid breaking MSVC compiling 2025-04-26 03:20:23 +08:00
PC-DOS 5b4d9c41ac Replaced Chinese comments with English to avoid breaking MSVC compiling 2025-04-26 03:18:01 +08:00
qiyuxinlin 03a65d6bea roll back ktransformers backend, add max_tokens, max_completion_tokens param 2025-04-21 12:55:37 +00:00
Iwan Kawrakow 99a247e167 Spelling 2025-04-11 10:15:42 +03:00
Iwan Kawrakow c46b0c59d0 Add missing references to ik_llama.cpp 2025-04-11 09:39:57 +03:00
Atream 80c5cbecdd add nlohmann 2025-04-01 10:38:45 +08:00
Atream 9360d1e3c8 add submodules 2025-03-31 23:20:29 +08:00
liu.shen 26bd889ff8 fix #829: 兼容Intel Cascade Lake架构的CPU 2025-03-09 19:26:12 +08:00
liam 8eeb6dd432 ⚡ update compile option for avx512vpopcntdq 2025-03-06 12:18:04 +08:00
Azure dd390835ca Add compile condition 2025-03-06 03:25:39 +00:00
Azure 8068018504 fix gcc compilation 2025-03-05 15:59:56 +00:00
moonshadow-25 d24d369332 iq1s files 2025-03-01 22:44:06 +08:00
moonshadow-25 c513ae59c3 iq1s files 2025-03-01 22:38:04 +08:00
moonshadow-25 9781d1e6f4 iq1s core 2025-03-01 21:48:25 +08:00
godrosev 93c5b75716 rem 2025-03-01 21:25:18 +08:00