Commit Graph

1336 Commits

Author SHA1 Message Date
yyj 74f87116c0 fix(ci): preserve setup-python shared library path during release 2026-09-11 01:16:35 +08:00
yyj 5632f7197e release: align post4 stack and allow CI artifact-only builds (#2197) v0.7.0.post4 2026-09-11 01:11:26 +08:00
yyj a3695f1a83 ci(release): gate four-main PyPI publishing on immutable wheels and model E2E (#2194)
* ci(release): prepare source builds from four main snapshots

* docs(release): add verified Kimi RAWINT4 LoRA smoke configs

* ci(release): gate four-main PyPI promotion on immutable wheels and model E2E
2026-09-11 00:52:24 +08:00
yyj 7c35863f62 ci: add model E2E acceptance for community PRs and PyPI releases (#2195)
* ci: add isolated model E2E acceptance for PR wheels and PyPI

* ci: recheck GPU occupancy before each model starts

* ci: disable inherited container healthchecks during acceptance

* ci: wait for free GPUs before native import validation

* docs: record qj5090 acceptance infrastructure validation

* ci: add immutable candidate and public PyPI release acceptance gates
2026-09-11 00:50:36 +08:00
yyj 61cb5cded5 fix(kt-kernel): restore MXFP4 decode fallback without AVX512 BF16 (#2196)
* fix(kt-kernel): restore MXFP4 decode fallback without AVX512 BF16

* Delete kt-kernel/test/per_commit/test_mxfp4_decode_bf16_guard.py
2026-09-10 23:14:05 +08:00
yyj aa2cd3072f [feat] Add native RAWINT4 routed-expert LoRA SFT for Kimi K2.5/K2.6 (#2186)
* [feat](sft): add K2 MoE SFT backend

* [feat](sft): enable packed KGroup backward for K2 SFT

* [feat](serving): add KT LoRA to SGLang adapter converter

* [test]: cover KT SFT and composite LoRA serving paths

* [perf](bench): add reusable KT E2E benchmark harness

* [test](sft): add K2 MoE AMX and real Kimi load smoke cases

* [perf](bench): add K2 SFT packed backward profile harness

* [test](sglang): cover Qwen3.5 LoRA shape filters

* [perf](sft): add K2 forward profiling logs

* [docs](sft): clarify K2 packed backward flow

* [docs](sft): number K2 backward comment steps

* chore: mirror sap4 loader baseline

* Add K2 SFT profiling ranges

* Add backward NVTX ranges for K2 SFT profiling

* perf(sft): add rank8 LoRA backward vector paths

* perf(sft): reuse down LoRA bprop cache

* [perf]: add K2 RAWINT4 prefill mat-mat dispatch

* [perf] Refactor K2 RAWINT4 prefill accumulation

* [perf]: add blocked RAWINT4 prefill backend

Cherry-picked from be40f8e with local amx.py conflict resolution.

* Optimize blocked RAWINT4 decode vecmul

* perf(sft): checkpoint qj5090 packed backward baseline

* perf(sft): batch expert LoRA backward as matmul

* perf(sft): align K2 base backward with BF16 matmul

* Optimize K2 SFT backward workspace path

* docs(sft): hand off RAWINT4 KGroup build and Kimi configs

* [feat](kt-kernel): add Kimi RAWINT4 LoRA SFT kernels

* [feat](kt-kernel): integrate Kimi RAWINT4 LoRA SFT

* [fix](sft): preserve input gradients through frozen routers

Build the routing graph when either activations or router parameters require gradients, while respecting the ambient grad mode. Keep frozen router parameters frozen and reject detached routing weights whenever gradients are needed.

Correct the existing frozen-router expectation and cover input-gradient equivalence for linear, DeepSeek/Kimi and GLM routing, checkpoint reuse, grad modes and detached-output failures.

Validated 62 routing/shared-expert/checkpoint tests on PyTorch 2.9.1 and a two-step Kimi K2.5 RAWINT4 four-GPU S512 LoRA smoke with per-rank routing-input gradient audits.

* [perf](kt-kernel): accelerate RAWINT4 prefill and backward

Reuse decoded weight columns across prefill rows and prepack BF16 backward coefficients into bounded per-worker panels. Use AMX BF16 tiles when available, retaining the AVX512-BF16 path and frozen base weights.

Balance expert work, parallelize cache copies and router reductions, and correct the signed INT4 -8 dot-product boundary. Add a CPU replay benchmark and forward/backward panel regressions.

Validated on sap4 with Kimi K2.5, TP1/TP2 replay, AMX and AVX-512 multi-GPU training, gradient windows, and saved LoRA artifacts. User-facing clean builds and AMD hardware remain separate validation work.

* [fix](sft): limit default OpenMP pools to the CPU owner

Keep the affinity-visible physical-core budget on rank 0 and default non-owner distributed ranks to one thread. Preserve explicit generic and KT-specific thread overrides, including intentional single-thread settings.

Cover single-process behavior, non-owner ranks, repeated configuration, and explicit overrides. The 109 configuration, activation-policy, and backend-dispatch tests pass.

---------

Co-authored-by: yyj <yyj@qj5090.local>
Co-authored-by: djh <jd4136@columbia.edu>
2026-09-10 17:05:16 +08:00
yyj 9b0da97c91 [feat](docker): add docker image and API guide (#2191) 2026-09-09 18:57:11 +08:00
Huang Wensen 6d460cc107 [feat](kt-kernel): packed-int4-resident AVX-VNNI-256 GPTQ INT4 backend (#2187) 2026-09-07 20:20:04 +08:00
yyj 308200c940 perf(sft): defer backward repack wait to CPU consumer (#2188) 2026-09-07 17:39:26 +08:00
Pan-Boyi 31985f40bc [docs](kt-kernel): DeepSeek-V4-Flash single-NPU deployment tutorial for Ascend (#2159) 2026-09-01 20:11:02 +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 3a19fd6d88 [perf](kt-kernel): make AVX512 MXFP4 decode memory-bound (#2181) 2026-09-01 11:45:25 +08:00
AY_novel 7c17c96503 [feat](kt-kernel): NVFP4 routed experts on the AVX2 FP4 backend (#2176) 2026-09-01 11:44:36 +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
AY_novel 948129159a [perf](kt-kernel): AVX2 MXFP4 grouped fast path for decode and prefill (#2175)
The AVX2 MXFP4 MoE kernel decoded FP4 weights with 128-bit SSSE3 PSHUFB
and converted the BF16 activations per row, costing roughly 28
shuffle-port uops per 32 weights. On Zen 2, whose two shuffle pipes are
the binding resource here, that left the kernel compute-bound at about
39-45 GB/s per socket, well under the 83.6 GB/s STREAM ceiling of the
same socket.

Add a fast path for the common group_size == 32 layout:

- decode a whole 32-value k-group with one 256-bit VPSHUFB pair,
- fuse the BF16->FP32 widen and shift into unpack(zero, u16), which is a
  single shuffle,
- drop the reordering shuffles entirely by converting each activation
  row once into the decoder's natural in-lane emission order
  ({0,2,4,6,1,3,5,7,...} per 32-group) instead of permuting the weights,
- process tokens in blocks of 4 so each decoded group is amortized over
  4 accumulators, with a single-row remainder loop that also serves
  decode (m == 1).

This is about 9 shuffle uops per 32 weights, which makes the kernel
memory-bound. Large per-expert batches fall back to the generic path so
the per-thread FP32 staging buffer stays bounded.

Measured on 2x EPYC 7452 (AVX2, 2x30 threads) with DeepSeek-V4-Flash
MXFP4:

- microbench per layer-token: m=1 989 -> 440 us (2.25x),
  m=4 1713 -> 1002 us, m=16 6567 -> 3829 us, m=64 25651 -> 19361 us
- end-to-end 512-token decode: 18.4 -> 29.5 tok/s at 65K context, and
  18.3 -> 32.3 tok/s on a 1M-context serving profile
- NUMA pool scaling verified unchanged (1937 us 1 pool -> 968 us 2 pools)

Output stays coherent in generation smoke tests on both profiles.

Co-authored-by: 05yuki <ceu.azul.samu@gmail.com>
2026-08-28 14:48:22 +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
v0.7.0.post1
2026-08-26 22:45:12 +08:00
Peilin Li c40d37c63c docs: add fine-tuning milestones to README updates (#2171)
Co-authored-by: JimmyPeilinLi <lipeilin@mail.nwpu.edu.cn>
2026-08-25 01:48:41 +08:00
Peilin Li 62d7b69e75 [docs]: add English fine-tuning cookbook (#2170)
Co-authored-by: JimmyPeilinLi <lipeilin@mail.nwpu.edu.cn>
2026-08-25 01:35:14 +08:00
Peilin Li 902ab98d46 [docs]: add easy-to-use fine-tuning cookbook (#2169)
Co-authored-by: JimmyPeilinLi <lipeilin@mail.nwpu.edu.cn>
2026-08-25 01:13:41 +08:00
Octopus 95009ea685 Add MiniMax-M3 and MiniMax-M2.7 to the kt-cli model registry (#2112) 2026-08-21 17:53:58 +08:00
liyuemathematician 41e54fd44c [docs]: use official LlamaFactory repository in VLM guide (#2165) 2026-08-18 20:10:50 +08:00
yyj 517e7a4368 fix(build): keep AVX2 wheel free of AVX512 flags (#2164) 2026-08-18 17:28:00 +08:00
yyj d406efc848 ci: run release jobs on self-hosted runner (#2163) 2026-08-18 17:15:40 +08:00
yyj ea81f4e9e5 ci: automate coordinated KT PyPI releases (#2162) 2026-08-18 17:09:59 +08:00
yyj e80614fc2d [feat](kt-sft): Activation reuse & Int8 kernel refactor & native block-FP8 LoRA SFT (#2141)
* feat(sft): support distributed activation reuse policies

* feat(sft): add frozen-base INT8 LoRA training

* fix(sft): make INT8 expert LoRA rank-zero authoritative

* fix(sft): preserve DeepSeek router LoRA routing

* feat(sft): enable persistent INT8 LoRA training

* perf(sft): accelerate INT8 VNNI with oneDNN BRGEMM

* perf(int8): fuse oneDNN compensation into backward repack

* [feat]: support BF16 expert LoRA training

* [fix]: honor forwarded activation policy in SFT workers

* feat(sft): add native block-FP8 routed expert LoRA

* feat(sft): expose explicit expert placeholder ownership

* fix(sft): publish fused adapter artifacts atomically

* feat(sft): own artifact and adapter lifecycle contracts

* fix(sft): harden artifact and rank-local contracts

* fix(sft): auto-adapt owner before adapter restore

* style(sft): keep lifecycle comments concise

* fix(sft): require fused adapter manifests

* test(sft): use spawn for distributed workers

* fix(sft): preserve runtime checkpoint metadata

* fix(sft): validate wrapped runtime configuration

* fix(sft): preserve expert format provenance

* fix(sft): own routed experts during device dispatch

* test(sft): lock explicit quantization conflict

* fix(cpu): make shared memory buffers lifetime-safe

* release: prepare v0.7.0
v0.7.0
2026-08-17 16:25:14 +08:00
liyuemathematician 168f581676 [feat](sft): support Qwen VLM MoE fine-tuning (#2156) 2026-08-17 10:51:55 +08:00
github-actions[bot] eb9b70c411 [build]: sync sglang submodule (#2069) 2026-08-08 18:45:46 +08:00
yyj f5ee50d4cf [docs] dsv4 tutorial update(#2140)
* docs: clarify DSV4 Docker runtime defaults
2026-08-05 18:01:01 +08:00
yyj e03cf1cefe docs: add DeepSeek V4 Flash Docker guide (#2136) 2026-08-05 00:11:27 +08:00
yyj 1a14f473cc [build] Sync sglang-kt submodule #2117 2026-08-02 20:11:37 +08:00
yyj a8062bfa7e release: bump version to 0.6.4 (#2105) 2026-07-23 22:42:28 +08:00
yyj 924754a00b [feat](kt-kernel): end-to-end full-parameter and LoRA SFT(#2094)
* Add full FT development snapshot

* [fix](kt-kernel): fix Full FT TP base weight gradients

* [fix]: bug fix of 2d81e86

* [fix](kt-kernel): fix AMX BF16 full-weight gradients

* [docs](kt-kernel): document Full FT fork changes and debug history

* [docs](kt-kernel): align fork remote terminology

* [chore](kt-kernel): keep agent notes local

* [fix](kt-kernel): configure SFT OpenMP threads

* [perf](kt-kernel): optimize AMX Full-FT weight gradients

Coarsen base-weight gradient work from individual output tiles to fixed-intermediate strips so each task reuses packed panels across the hidden dimension.

Keep aligned thread-local BF16 panels across tasks and retain FP32 AMX accumulator tiles for the full K reduction. Gate and up run separate K passes while sharing the packed input panel.

On the matched Qwen3-30B-A3B 1-GPU test, stable Full-FT backward drops from 9.281s to 6.792s (-26.82%), step time drops from 19.252s to 16.140s, and TPS rises from 212.76 to 253.78. The LoRA-only backward control changes by -2.74%.

Validated with clang-format, the Release AMX/CUDA extension build, TP1/TP2 reference gradients across boundary token counts, and the 15-step Full-then-LoRA performance run.

* [feat](kt-kernel): add staged SFT profiling

* [fix](kt-kernel): reuse inference BF16 kernel for SFT

* [perf](kt-kernel): add fine-grained Full-FT profiling

* [perf](kt-kernel): batch BF16 Full-FT weight gradients

Use one expert-aggregated tile driver for AVX512-BF16 and AMX base-weight gradients, and pack updated full-precision weights directly into TP BufferB layouts without temporary partitions. Add worker-local profiling and focused dWeight/strided-repack coverage.

* [test](kt-kernel): benchmark BF16 dWeight AMX driver

* [fix](kt-kernel): label dWeight store as worker CPU time

* [docs](sft): record BF16 Full-FT performance

* [docs](sft): remove Qwen3 Full-FT performance report

* [perf](kt-kernel): reduce BF16 Full-FT checkpoint overhead

Retain the first CPU MoE forward state across non-reentrant checkpoint recomputation, write BF16 activations directly into the backward cache, and reduce dWeight packing and gradient-clear traffic. Extend staged profiling and cover checkpoint reuse plus AMX/AVX dWeight paths.

* [perf](kt-kernel): make SFT optimizer gradients authoritative

Bind Full-FT and LoRA Parameter.grad directly to the KT-managed BF16 gradient buffers, avoiding PyTorch duplicate accumulation.

Accumulate microbatch gradients in C++, lazily clear expert buffers between optimizer windows, preserve rank-0 distributed ownership, and add lifecycle and AMX dWeight coverage.

* [perf](kt-kernel): avoid eager Full-FT gradient zeroing

Allocate authoritative Full-FT gradient buffers with torch.empty. The C++ state machine performs the mandatory full clear before first use, avoiding redundant Python-side first touch.

* perf(sft): enable checkpoint forward reuse for LoRA

* fix(sft): serialize checkpoint recompute with async repack

* fix(sft): persist authoritative full weights

* fix(sft): normalize legacy distributed gradients

* [fix](sft): train gated shared experts

* fix(sft): preserve expert placeholders across state dict loads

* ci: publish ktransformers sdist in release workflow

* fix(sft): preserve router autograd for LoRA training

Determine routing graph tracking from the router's trainable parameters instead of the Full-FT mode flag, so PEFT LoRA adapters on MoE gates receive routing-weight gradients. Fail fast when a trainable router returns detached weights and cover frozen, TopK, checkpoint-reuse, and two-step optimizer behavior.

---------

Co-authored-by: illu <wubowen03@foxmail.com>
v0.6.4
2026-07-23 21:23:34 +08:00
yyj d1a3ed8a30 [perf]: add K2 RAWINT4 prefill mat-mat dispatch (#2080)
* [perf]: add K2 RAWINT4 prefill mat-mat dispatch

* [perf] Refactor K2 RAWINT4 prefill accumulation

---------

Co-authored-by: yyj6666667 <yyj6666667@users.noreply.github.com>
2026-07-19 21:43:01 +08:00
Aaryan Mehta 937f61c988 [fix](kt-kernel): AVX-VNNI-256 RAWINT4 per-expert weight loading (#2092) 2026-07-19 17:24:52 +08:00
Tai An def0f9313d fix(security): bind balance_serve scheduler ZMQ socket to loopback (#2087) (#2091) 2026-07-19 11:38:22 +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
Graham 01fdfa609e docs(DSV4): add supplementary deployment and tuning notes
* docs(DSV4-Flash): AMXINT4 on Skylake (no AMX), dual-Xeon tuning + single-stream negative results

Adds a section based on a validated single-workstation deployment (1x RTX 5090 +
2x Xeon Gold 6138 / Skylake-SP): AMXINT4 runs on AVX512F+BW without an AMX tile;
dual-socket tuning notes; and a table of configs that reduced single-stream
throughput here (notably EAGLE going net-negative on a CPU-bandwidth-bound box,
vs the 8x-RTX-5090 speedup the guide cites).

* Fix command syntax in DeepSeek-V4-Flash.md

---------

Co-authored-by: yyj <159887351+yyj6666667@users.noreply.github.com>
2026-07-15 13:06:58 +08:00
callmegaga 7c021b430c [chore](sglang): bump sglang submodule for FP16 FE8M0 Marlin fix (#2082) 2026-07-10 11:18:45 +08:00
VectorPeak cb9f47d142 [fix](cli): detect bound ports before launch (#2071)
* [fix](cli): detect bound ports before launch

* [fix](cli): align port reuse check by platform
2026-07-06 18:25:31 +08:00
lutianshu824 79b265b2f6 fix: normalize compressed RAWINT4 weights (#2075)
* fix: normalize compressed RAWINT4 weights

* docs: add Hygon DCU ROCm notes

---------

Co-authored-by: lutianshu824 <lutianshu824@users.noreply.github.com>
2026-07-06 18:06:52 +08:00
Benjamin 8e46e5896c release: bump version to 0.6.3.post1 (#2063) v0.6.3.post1 2026-06-25 22:42:55 +08:00
github-actions[bot] 459df61262 [build] Sync sglang-kt submodule (v0.6.3) (#2055) 2026-06-25 20:41:04 +08:00
Benjamin a0c7431187 ci(release-pypi): make release pipeline self-consistent (#2062) 2026-06-25 20:05:06 +08:00
Willow Lopez 983a88b620 docs: add FAQ entry about SGLang MoE kernel config warning (#2029) 2026-06-24 15:12:54 +08:00
Hermann Hans Klie 08d70e8605 [fix](kt-kernel): enable -mavx512vl for AVX512_VBMI/BF16 multi-variant builds (#2021) 2026-06-24 15:05:36 +08:00
Jiaheng Dai 1ed332b6ea [docs]: clean up Qwen3.5 KT LoRA serving guide (#2057)
* [docs]: clean up Qwen3.5 KT LoRA serving guide

* Update doc/zh/Qwen3.5-SGLang-LoRA-Serving_zh.md

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
2026-06-23 20:52:23 +08:00
Benjamin c884dbd221 release: bump version to 0.6.3 (#2054) 2026-06-21 17:55:24 +08:00
github-actions[bot] ce7c3ddbe9 [build]: sync sglang submodule to 8b636f9008dbad58c0a8e481b03e794739e6c146 (#2047)
Co-authored-by: ovowei <80044717+ovowei@users.noreply.github.com>
v0.6.3
2026-06-21 17:37:52 +08:00
Benjamin 6c9c95601d [fix](kt-kernel): CudaGraph replay fix and Add MoE startup log (#2037)
CudaGraph replay fix and Add MoE startup log
2026-06-18 17:15:37 +08:00