[GH-ISSUE #1816] Kimi 2.5 Bug and Performance #1135

Open
opened 2026-10-29 14:49:01 +00:00 by bsakaguchi · 17 comments
Owner

Originally created by @trilog-inc on GitHub (Jan 27, 2026).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1816

Reminder

  • I have read the above rules and searched the existing issues.

System Info

ktransformers - kimi_k2.5 branch
kvcache-ai/sglang - kimi_k2.5 branch

CPU: w7-3465x ( 28 physical cores, AMX enabled, 2 NUMA )
RAM: 768GB DDR5 5600
GPU: RTX 6000 pro

Reproduction

Congrats on the team for the day 0 support for Kimi 2.5! The multimodal feature is amazing.

I wanted to compare notes with other users running similar hardware ( RTX 6000 Pro, Xeon Sapphire Rapids ) and offer my feedback.

When I run the server with kt-cpuinfer matching the number of physical cores ( 28 ), I get about 10.3 token/s generation. When I go above the physical core counts, with for example 52, I get 11.8 token/s. Is this normal? I noticed in the log when I got above the number of physical cores, the logs print out "Core 14 inside NUMA node 0 not found ... to Core 25".
Are there any consequences to configuring the server this way?

Other note, the --kt-enable-dynamic-expert-update paramter increases the token generation to about 14token/s ( + 30-40%). I am looking forward to having this in the new kimi_2.5 branch!

Another note, the sglang server never outputs the opening tag. I imagine this is something to be fixed on the sglang side of the system. Will the kvcache-ai branch be able to be merged to the main one in the near term?

CUDA_DEVICE_ORDER="PCI_BUS_ID" CUDA_VISIBLE_DEVICES=0 python -m sglang.launch_server --host 0.0.0.0 --port 60000 --model /mnt/home_extend/models/kimi25/ --kt-weight-path /mnt/home_extend/models/kimi25/ --kt-cpuinfer 28 --kt-threadpool-count 2 --kt-num-gpu-experts 28 --kt-method RAWINT4 --attention-backend flashinfer --kt-gpu-prefill-token-threshold 400 --kt-max-deferred-experts-per-token 1 --trust-remote-code --mem-fraction-static 0.94 --chunked-prefill-size 16384 --max-running-requests 10 --max-total-tokens 115000 --enable-mixed-chunk --tensor-parallel-size 1 --enable-p2p-check --disable-shared-experts-fusion --served-model-name kimi --tool-call-parser kimi_k2 --reasoning-parser kimi_k2

Others

No response

Originally created by @trilog-inc on GitHub (Jan 27, 2026). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1816 ### Reminder - [x] I have read the above rules and searched the existing issues. ### System Info ktransformers - kimi_k2.5 branch kvcache-ai/sglang - kimi_k2.5 branch CPU: w7-3465x ( 28 physical cores, AMX enabled, 2 NUMA ) RAM: 768GB DDR5 5600 GPU: RTX 6000 pro ### Reproduction Congrats on the team for the day 0 support for Kimi 2.5! The multimodal feature is amazing. I wanted to compare notes with other users running similar hardware ( RTX 6000 Pro, Xeon Sapphire Rapids ) and offer my feedback. When I run the server with kt-cpuinfer matching the number of physical cores ( 28 ), I get about 10.3 token/s generation. When I go above the physical core counts, with for example 52, I get 11.8 token/s. Is this normal? I noticed in the log when I got above the number of physical cores, the logs print out "Core 14 inside NUMA node 0 not found ... to Core 25". Are there any consequences to configuring the server this way? Other note, the --kt-enable-dynamic-expert-update paramter increases the token generation to about 14token/s ( + 30-40%). I am looking forward to having this in the new kimi_2.5 branch! Another note, the sglang server never outputs the opening <think> tag. I imagine this is something to be fixed on the sglang side of the system. Will the kvcache-ai branch be able to be merged to the main one in the near term? CUDA_DEVICE_ORDER="PCI_BUS_ID" CUDA_VISIBLE_DEVICES=0 python -m sglang.launch_server --host 0.0.0.0 --port 60000 --model /mnt/home_extend/models/kimi25/ --kt-weight-path /mnt/home_extend/models/kimi25/ --kt-cpuinfer 28 --kt-threadpool-count 2 --kt-num-gpu-experts 28 --kt-method RAWINT4 --attention-backend flashinfer --kt-gpu-prefill-token-threshold 400 --kt-max-deferred-experts-per-token 1 --trust-remote-code --mem-fraction-static 0.94 --chunked-prefill-size 16384 --max-running-requests 10 --max-total-tokens 115000 --enable-mixed-chunk --tensor-parallel-size 1 --enable-p2p-check --disable-shared-experts-fusion --served-model-name kimi --tool-call-parser kimi_k2 --reasoning-parser kimi_k2 ### Others _No response_
Author
Owner

@KebobZ commented on GitHub (Jan 28, 2026):

Another note, the sglang server never outputs the opening tag. I imagine this is something to be fixed on the sglang side of the system. Will the kvcache-ai branch be able to be merged to the main one in the near term?

I have a similar setup (RTX 6000 Pro, 1TB DDR5, Xeon Sapphire Rapids).

Are you referring to the opening thinking tag? I noticed the same thing, but if I explicitly pass {"chat_template_kwargs": {"thinking": true}}, it works fine. It's strange because if I don't, I see the closing </think> tag without the opening tag. Disabling thinking works as you would expect (no thinking and no opening or closing think tags).

I am seeing another weird issue right now when I send a large prompt (like from Kimi Code or OpenCode), I am getting back a non-sensical response (the tokens are coherent in the sense that it seems related to the same topic, and I even see it trying to do tool calls sometimes, but it is completely unrelated to my prompt).

<!-- gh-comment-id:3808324938 --> @KebobZ commented on GitHub (Jan 28, 2026): > Another note, the sglang server never outputs the opening tag. I imagine this is something to be fixed on the sglang side of the system. Will the kvcache-ai branch be able to be merged to the main one in the near term? I have a similar setup (RTX 6000 Pro, 1TB DDR5, Xeon Sapphire Rapids). Are you referring to the opening thinking tag? I noticed the same thing, but if I explicitly pass `{"chat_template_kwargs": {"thinking": true}}`, it works fine. It's strange because if I don't, I see the closing `</think>` tag without the opening tag. Disabling thinking works as you would expect (no thinking and no opening or closing think tags). I am seeing another weird issue right now when I send a large prompt (like from Kimi Code or OpenCode), I am getting back a non-sensical response (the tokens are coherent in the sense that it seems related to the same topic, and I even see it trying to do tool calls sometimes, but it is completely unrelated to my prompt).
Author
Owner

@trilog-inc commented on GitHub (Jan 28, 2026):

Yes exactly! Noted. I will try that as well.

I have noticed this as well. When I lower the kt-cpuinfer parameter to 20 or lower, I sometimes get garbled output ( ex "A B C D ..." or some unrelated output that eventually repeats itself.

@KebobZ What is your token generation speed like?

<!-- gh-comment-id:3808398570 --> @trilog-inc commented on GitHub (Jan 28, 2026): Yes exactly! Noted. I will try that as well. I have noticed this as well. When I lower the kt-cpuinfer parameter to 20 or lower, I sometimes get garbled output ( ex "A B C D ..." or some unrelated output that eventually repeats itself. @KebobZ What is your token generation speed like?
Author
Owner

@KebobZ commented on GitHub (Jan 28, 2026):

Yes exactly! Noted. I will try that as well.

I have noticed this as well. When I lower the kt-cpuinfer parameter to 20 or lower, I sometimes get garbled output ( ex "A B C D ..." or some unrelated output that eventually repeats itself.

@KebobZ What is your token generation speed like?

I have 2x Xeon 8480+ (the QYFS ES) and the RTX 6000 Pro Max-Q, and I'm getting ~16.5t/s tg512. I'm in the process of testing Unsloth's UD-Q4_K_XL quant to compare. This is how I'm running:

uv run -m sglang.launch_server \
  --host 0.0.0.0 \
  --port 60000 \
  --model /mnt/data/models/HF/moonshotai_Kimi-K2.5/ \
  --kt-weight-path /mnt/data/models/HF/moonshotai_Kimi-K2.5/ \
  --kt-cpuinfer 56 \
  --kt-threadpool-count 2 \
  --kt-num-gpu-experts 24 \
  --kt-method RAWINT4 \
  --kt-gpu-prefill-token-threshold 400 \
  --trust-remote-code \
  --mem-fraction-static 0.94 \
  --enable-mixed-chunk \
  --tensor-parallel-size 1 \
  --enable-p2p-check \
  --disable-shared-experts-fusion \
  --chunked-prefill-size 16384 \
  --max-total-tokens 131072 \
  --max-running-requests 8 \
  --attention-backend flashinfer \
  --tool-call-parser kimi_k2 \
  --reasoning-parser kimi_k2

That's how I was running Kimi K2 Thining. I haven't tried tweaking things yet.

<!-- gh-comment-id:3808417537 --> @KebobZ commented on GitHub (Jan 28, 2026): > Yes exactly! Noted. I will try that as well. > > I have noticed this as well. When I lower the kt-cpuinfer parameter to 20 or lower, I sometimes get garbled output ( ex "A B C D ..." or some unrelated output that eventually repeats itself. > > [@KebobZ](https://github.com/KebobZ) What is your token generation speed like? I have 2x Xeon 8480+ (the QYFS ES) and the RTX 6000 Pro Max-Q, and I'm getting ~16.5t/s tg512. I'm in the process of testing Unsloth's `UD-Q4_K_XL` quant to compare. This is how I'm running: ```bash uv run -m sglang.launch_server \ --host 0.0.0.0 \ --port 60000 \ --model /mnt/data/models/HF/moonshotai_Kimi-K2.5/ \ --kt-weight-path /mnt/data/models/HF/moonshotai_Kimi-K2.5/ \ --kt-cpuinfer 56 \ --kt-threadpool-count 2 \ --kt-num-gpu-experts 24 \ --kt-method RAWINT4 \ --kt-gpu-prefill-token-threshold 400 \ --trust-remote-code \ --mem-fraction-static 0.94 \ --enable-mixed-chunk \ --tensor-parallel-size 1 \ --enable-p2p-check \ --disable-shared-experts-fusion \ --chunked-prefill-size 16384 \ --max-total-tokens 131072 \ --max-running-requests 8 \ --attention-backend flashinfer \ --tool-call-parser kimi_k2 \ --reasoning-parser kimi_k2 ``` That's how I was running Kimi K2 Thining. I haven't tried tweaking things yet.
Author
Owner

@trilog-inc commented on GitHub (Jan 28, 2026):

Amazing. Please let me know what the UD quant yields. Otherwise, can you try increasing your cpuinfer count to ~78 to see how the performance changes? It boosted my tg by 20-30% for me.

<!-- gh-comment-id:3808492334 --> @trilog-inc commented on GitHub (Jan 28, 2026): Amazing. Please let me know what the UD quant yields. Otherwise, can you try increasing your cpuinfer count to ~78 to see how the performance changes? It boosted my tg by 20-30% for me.
Author
Owner

@KebobZ commented on GitHub (Jan 28, 2026):

Amazing. Please let me know what the UD quant yields. Otherwise, can you try increasing your cpuinfer count to ~78 to see how the performance changes? It boosted my tg by 20-30% for me.

A modest gain for me. My tg512 went from 16.5 t/s -> 18 t/s going from cpuinfer 56 -> 78.

<!-- gh-comment-id:3808734255 --> @KebobZ commented on GitHub (Jan 28, 2026): > Amazing. Please let me know what the UD quant yields. Otherwise, can you try increasing your cpuinfer count to ~78 to see how the performance changes? It boosted my tg by 20-30% for me. A modest gain for me. My tg512 went from 16.5 t/s -> 18 t/s going from cpuinfer 56 -> 78.
Author
Owner

@trilog-inc commented on GitHub (Jan 28, 2026):

@KebobZ I've got a repository on my profile which proxies the request and modifies them if needed. In any case, it injects the thinking parameter to true when the model name contains "kimi", fixes the thinking tag bug for me when using Kilo Code etc

<!-- gh-comment-id:3811871871 --> @trilog-inc commented on GitHub (Jan 28, 2026): @KebobZ I've got a [repository](https://github.com/trilog-inc/LLmProxy) on my profile which proxies the request and modifies them if needed. In any case, it injects the thinking parameter to true when the model name contains "kimi", fixes the thinking tag bug for me when using Kilo Code etc
Author
Owner

@KebobZ commented on GitHub (Jan 29, 2026):

@KebobZ I've got a repository on my profile which proxies the request and modifies them if needed. In any case, it injects the thinking parameter to true when the model name contains "kimi", fixes the thinking tag bug for me when using Kilo Code etc

Ah, we must think alike because I had to build something similar. I'll check it out! I did try out ik_llama.cpp and it worked well with OpenCode. Unfortunately it is quite a bit slower than using sglang + kt-kernel (~13t/s).

<!-- gh-comment-id:3815584020 --> @KebobZ commented on GitHub (Jan 29, 2026): > [@KebobZ](https://github.com/KebobZ) I've got a [repository](https://github.com/trilog-inc/LLmProxy) on my profile which proxies the request and modifies them if needed. In any case, it injects the thinking parameter to true when the model name contains "kimi", fixes the thinking tag bug for me when using Kilo Code etc Ah, we must think alike because I had to build something similar. I'll check it out! I did try out `ik_llama.cpp` and it worked well with OpenCode. Unfortunately it is quite a bit slower than using sglang + kt-kernel (~13t/s).
Author
Owner

@KebobZ commented on GitHub (Jan 30, 2026):

I am seeing another weird issue right now when I send a large prompt (like from Kimi Code or OpenCode), I am getting back a non-sensical response (the tokens are coherent in the sense that it seems related to the same topic, and I even see it trying to do tool calls sometimes, but it is completely unrelated to my prompt).

I did some more testing, and it seemed like it was related to --kt-gpu-prefill-token-threshold, specifically when the prompt was above the threshold was when I could reliably reproduce the corruption issue. I tested running with CUDA_LAUNCH_BLOCKING=1 and so far, that seems to have "fixed" the issue for me - at a performance penalty (though a lot faster than disabling the GPU-only fallback completely). It is much faster than ik_llama.cpp was though. I suspect there is a potential synchronization bug with the GPU-only fallback.

<!-- gh-comment-id:3824834607 --> @KebobZ commented on GitHub (Jan 30, 2026): > I am seeing another weird issue right now when I send a large prompt (like from Kimi Code or OpenCode), I am getting back a non-sensical response (the tokens are coherent in the sense that it seems related to the same topic, and I even see it trying to do tool calls sometimes, but it is completely unrelated to my prompt). I did some more testing, and it seemed like it was related to `--kt-gpu-prefill-token-threshold`, specifically when the prompt was above the threshold was when I could reliably reproduce the corruption issue. I tested running with `CUDA_LAUNCH_BLOCKING=1` and so far, that seems to have "fixed" the issue for me - at a performance penalty (though a lot faster than disabling the GPU-only fallback completely). It is much faster than `ik_llama.cpp` was though. I suspect there is a potential synchronization bug with the GPU-only fallback.
Author
Owner

@usrlocalben commented on GitHub (Feb 1, 2026):

I did some more testing, and it seemed like it was related to --kt-gpu-prefill-token-threshold, specifically when the prompt was above the threshold was when I could reliably reproduce the corruption issue. I tested running with

I observed the same. If the layer-offload prefill mechanism is used, it executes impossibly fast (3000 tok/sec) and the output is gibberish.

<!-- gh-comment-id:3830522744 --> @usrlocalben commented on GitHub (Feb 1, 2026): > I did some more testing, and it seemed like it was related to `--kt-gpu-prefill-token-threshold`, specifically when the prompt was above the threshold was when I could reliably reproduce the corruption issue. I tested running with I observed the same. If the layer-offload prefill mechanism is used, it executes impossibly fast (3000 tok/sec) and the output is gibberish.
Author
Owner

@sousekd commented on GitHub (Mar 19, 2026):

It took me a while to make Kimi-K2.5 work on EPYC 9355 + 2x RTX PRO 6000.
For those who are still struggling, this is what worked for me:

Dockerfile

# syntax=docker/dockerfile:1.7
# SGLang + KTransformers for CUDA 13 on EPYC Turin

ARG BASE_IMAGE=lmsysorg/sglang:dev-cu13
FROM ${BASE_IMAGE}

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG DEBIAN_FRONTEND=noninteractive
ARG KTRANSFORMERS_REF=main
ARG KT_CUDA_ARCHS=120
ARG KT_BUILD_JOBS=64
ARG SGL_KERNEL_CU130_WHL=https://github.com/sgl-project/whl/releases/download/v0.3.21/sgl_kernel-0.3.21%2Bcu130-cp312-abi3-manylinux2014_x86_64.whl

# Build/runtime settings for Turin + Blackwell
ENV CUDA_HOME=/usr/local/cuda \
    TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas \
    HF_HUB_ENABLE_HF_TRANSFER=1 \
    CUDA_MODULE_LOADING=LAZY \
    PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    PIP_NO_CACHE_DIR=1 \
    PIP_ROOT_USER_ACTION=ignore \
    CPUINFER_CPU_INSTRUCT=FANCY \
    CPUINFER_ENABLE_AMX=OFF \
    CPUINFER_ENABLE_AVX512_VNNI=ON \
    CPUINFER_ENABLE_AVX512_BF16=ON \
    CPUINFER_ENABLE_AVX512_VBMI=ON \
    CPUINFER_USE_CUDA=1 \
    CPUINFER_CUDA_ARCHS=${KT_CUDA_ARCHS} \
    CPUINFER_PARALLEL=${KT_BUILD_JOBS}

# Native build dependencies for kt-kernel
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    ninja-build \
    git \
    git-lfs \
    curl \
    wget \
    ca-certificates \
    pkg-config \
    python3-dev \
    libhwloc-dev \
    libnuma-dev \
    numactl \
    pciutils \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install --system

WORKDIR /opt

# KTransformers repo and submodules
RUN git clone --recursive https://github.com/kvcache-ai/ktransformers.git \
    && cd /opt/ktransformers \
    && git checkout "${KTRANSFORMERS_REF}" \
    && git submodule update --init --recursive

# Remove base-package metadata first, then install the KTransformers fork
# without dependency resolution so the CUDA 13 stack is not downgraded.
RUN (python3 -m pip uninstall -y sglang sglang-kt kt-kernel sgl-kernel || true) \
    && python3 -m pip install --upgrade pip setuptools wheel packaging \
    && cd /opt/ktransformers/third_party/sglang \
    && python3 -m pip install --no-deps "./python[all]" \
    && python3 -m pip install --no-deps "${SGL_KERNEL_CU130_WHL}" \
    && python3 -m pip install --no-deps decord2

# Build kt-kernel against the prepared CUDA 13 / SM120 environment.
RUN cd /opt/ktransformers/kt-kernel \
    && python3 -m pip install --no-deps --no-build-isolation -v .

WORKDIR /workspace
CMD ["bash"]

Run command

docker run --rm \
  --name g3-kimi-k2.5-rawint4-kt-192k-p2 \
  --ipc=host \
  --cap-add=SYS_NICE \
  --runtime nvidia \
  --gpus device=all \
  -v /mnt/hot/hfhub:/root/.cache/huggingface/hub \
  -v /mnt/bulk/config/parsers:/opt/parsers:ro \
  -e 'NCCL_IB_DISABLE=1' \
  -e 'PYTORCH_ALLOC_CONF=expandable_segments:True' \
  -e 'SGLANG_ENABLE_JIT_DEEPGEMM=0' \
  -e 'OMP_NUM_THREADS=8' \
  -e 'SAFETENSORS_FAST_GPU=1' \
  -p 8000:8000 \
  sglang-kt:cu13 \
  python -m sglang.launch_server \
    --model-path /root/.cache/huggingface/hub/models--moonshotai--Kimi-K2.5/snapshots/54383e83fa343a1331754112fb9e3410c55efa2f \
    --kt-weight-path /root/.cache/huggingface/hub/models--moonshotai--Kimi-K2.5/snapshots/54383e83fa343a1331754112fb9e3410c55efa2f \
    --served-model-name g3-kimi-k2.5-rawint4-kt-192k-p2 \
    --host 0.0.0.0 \
    --port 8000 \
    --mem-fraction-static 0.94 \
    --trust-remote-code \
    --context-length 196608 \
    --max-running-requests 2 \
    --prefill-max-requests 2 \
    --max-total-tokens 393216 \
    --kt-cpuinfer 24 \
    --kt-threadpool-count 1 \
    --kt-num-gpu-experts 64 \
    --kt-method RAWINT4 \
    --kt-gpu-prefill-token-threshold 400 \
    --kt-max-deferred-experts-per-token 1 \
    --kt-enable-dynamic-expert-update \
    --enable-mixed-chunk \
    --tensor-parallel-size 2 \
    --enable-p2p-check \
    --disable-shared-experts-fusion \
    --disable-custom-all-reduce \
    --chunked-prefill-size 16384 \
    --attention-backend flashinfer \
    --reasoning-parser kimi_k2 \
    --tool-call-parser kimi_k2 \
    --sampling-defaults model

Performance (single user)

  • TFT: 1015.78 ms
  • TTS: 50.79 ms
  • Request latency: 12537.97 ms
  • ITL: 45.19 ms
  • Output TPS/user: 22.14 tok/s
                                               NVIDIA AIPerf | LLM Metrics                                               
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┓
┃                               Metric ┃       avg ┃       min ┃       max ┃       p99 ┃       p90 ┃       p50 ┃    std ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━┩
│             Time to First Token (ms) │  1,015.78 │    938.80 │  1,069.26 │  1,060.36 │  1,037.79 │  1,018.81 │  23.20 │
│            Time to Second Token (ms) │     50.79 │     44.03 │    117.95 │    115.51 │     53.98 │     46.87 │  14.36 │
│                 Request Latency (ms) │ 12,537.97 │ 12,135.71 │ 12,888.58 │ 12,873.09 │ 12,763.19 │ 12,581.80 │ 199.38 │
│             Inter Token Latency (ms) │     45.19 │     43.70 │     46.63 │     46.59 │     46.09 │     45.36 │   0.80 │
│     Output Token Throughput Per User │     22.14 │     21.45 │     22.88 │     22.88 │     22.76 │     22.05 │   0.39 │
│                    (tokens/sec/user) │           │           │           │           │           │           │        │
│      Output Sequence Length (tokens) │    256.00 │    256.00 │    256.00 │    256.00 │    256.00 │    256.00 │   0.00 │
│       Input Sequence Length (tokens) │    179.96 │     32.00 │    329.00 │    329.00 │    299.10 │    180.00 │  94.48 │
│ Output Token Throughput (tokens/sec) │     17.31 │       N/A │       N/A │       N/A │       N/A │       N/A │    N/A │
│    Request Throughput (requests/sec) │      0.07 │       N/A │       N/A │       N/A │       N/A │       N/A │    N/A │
│             Request Count (requests) │     50.00 │       N/A │       N/A │       N/A │       N/A │       N/A │    N/A │
└──────────────────────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴────────┘

CLI Command: aiperf profile --model 'g3-kimi-k2.5-rawint4-kt-192k-p2' --tokenizer 'moonshotai/Kimi-K2.5' --tokenizer-trust-remote-code --url 
'http://localhost:8000' --endpoint-type 'chat' --endpoint '/v1/chat/completions' --streaming --concurrency 1 --conversation-num 5 
--conversation-turn-mean 10 --conversation-turn-stddev 0 --conversation-turn-delay-mean 2500 --conversation-turn-delay-stddev 0 
--synthetic-input-tokens-mean 32 --synthetic-input-tokens-stddev 0 --output-tokens-mean 256 --num-dataset-entries 50 --num-warmup-sessions 1 
--random-seed 42 --connection-reuse-strategy 'sticky-user-sessions'

Performance (two concurrent users)

  • TTFT: 1796.66 ms
  • TTS: 237.60 ms
  • Request latency: 20643.53 ms
  • ITL: 73.91 ms
  • Output TPS/user: 13.54 tok/s
                                               NVIDIA AIPerf | LLM Metrics                                               
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┓
┃                               Metric ┃       avg ┃       min ┃       max ┃       p99 ┃       p90 ┃       p50 ┃    std ┃
┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━┩
│             Time to First Token (ms) │  1,796.66 │  1,569.23 │  2,045.10 │  2,030.98 │  1,976.02 │  1,824.26 │ 169.10 │
│            Time to Second Token (ms) │    237.60 │     65.60 │    427.46 │    426.71 │    418.46 │    101.53 │ 169.24 │
│                 Request Latency (ms) │ 20,643.53 │ 19,634.48 │ 21,393.07 │ 21,392.48 │ 21,277.87 │ 20,685.79 │ 525.87 │
│             Inter Token Latency (ms) │     73.91 │     69.28 │     77.51 │     77.46 │     76.73 │     74.29 │   2.21 │
│     Output Token Throughput Per User │     13.54 │     12.90 │     14.43 │     14.40 │     14.09 │     13.46 │   0.41 │
│                    (tokens/sec/user) │           │           │           │           │           │           │        │
│      Output Sequence Length (tokens) │    256.00 │    256.00 │    256.00 │    256.00 │    256.00 │    256.00 │   0.00 │
│       Input Sequence Length (tokens) │    180.35 │     32.00 │    329.00 │    329.00 │    299.20 │    180.00 │  94.68 │
│ Output Token Throughput (tokens/sec) │     22.36 │       N/A │       N/A │       N/A │       N/A │       N/A │    N/A │
│    Request Throughput (requests/sec) │      0.09 │       N/A │       N/A │       N/A │       N/A │       N/A │    N/A │
│             Request Count (requests) │     40.00 │       N/A │       N/A │       N/A │       N/A │       N/A │    N/A │
└──────────────────────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴────────┘

CLI Command: aiperf profile --model 'g3-kimi-k2.5-rawint4-kt-192k-p2' --tokenizer 'moonshotai/Kimi-K2.5' --tokenizer-trust-remote-code --url 
'http://localhost:8000' --endpoint-type 'chat' --endpoint '/v1/chat/completions' --streaming --concurrency 2 --conversation-num 4 
--conversation-turn-mean 10 --conversation-turn-stddev 0 --conversation-turn-delay-mean 2500 --conversation-turn-delay-stddev 0 
--synthetic-input-tokens-mean 32 --synthetic-input-tokens-stddev 0 --output-tokens-mean 256 --num-dataset-entries 40 --num-warmup-sessions 1 
--random-seed 42 --connection-reuse-strategy 'sticky-user-sessions'

Both reasoning and function calling works well, but I have not tried on long context yet.
This is my first experience with SGLang + KT (and aiperf).
Tips to improve my "recipe to run" for better performance would be very welcome.

<!-- gh-comment-id:4086587492 --> @sousekd commented on GitHub (Mar 19, 2026): It took me a while to make Kimi-K2.5 work on EPYC 9355 + 2x RTX PRO 6000. For those who are still struggling, this is what worked for me: ## Dockerfile ```dockerfile # syntax=docker/dockerfile:1.7 # SGLang + KTransformers for CUDA 13 on EPYC Turin ARG BASE_IMAGE=lmsysorg/sglang:dev-cu13 FROM ${BASE_IMAGE} SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG DEBIAN_FRONTEND=noninteractive ARG KTRANSFORMERS_REF=main ARG KT_CUDA_ARCHS=120 ARG KT_BUILD_JOBS=64 ARG SGL_KERNEL_CU130_WHL=https://github.com/sgl-project/whl/releases/download/v0.3.21/sgl_kernel-0.3.21%2Bcu130-cp312-abi3-manylinux2014_x86_64.whl # Build/runtime settings for Turin + Blackwell ENV CUDA_HOME=/usr/local/cuda \ TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas \ HF_HUB_ENABLE_HF_TRANSFER=1 \ CUDA_MODULE_LOADING=LAZY \ PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_NO_CACHE_DIR=1 \ PIP_ROOT_USER_ACTION=ignore \ CPUINFER_CPU_INSTRUCT=FANCY \ CPUINFER_ENABLE_AMX=OFF \ CPUINFER_ENABLE_AVX512_VNNI=ON \ CPUINFER_ENABLE_AVX512_BF16=ON \ CPUINFER_ENABLE_AVX512_VBMI=ON \ CPUINFER_USE_CUDA=1 \ CPUINFER_CUDA_ARCHS=${KT_CUDA_ARCHS} \ CPUINFER_PARALLEL=${KT_BUILD_JOBS} # Native build dependencies for kt-kernel RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ ninja-build \ git \ git-lfs \ curl \ wget \ ca-certificates \ pkg-config \ python3-dev \ libhwloc-dev \ libnuma-dev \ numactl \ pciutils \ && rm -rf /var/lib/apt/lists/* \ && git lfs install --system WORKDIR /opt # KTransformers repo and submodules RUN git clone --recursive https://github.com/kvcache-ai/ktransformers.git \ && cd /opt/ktransformers \ && git checkout "${KTRANSFORMERS_REF}" \ && git submodule update --init --recursive # Remove base-package metadata first, then install the KTransformers fork # without dependency resolution so the CUDA 13 stack is not downgraded. RUN (python3 -m pip uninstall -y sglang sglang-kt kt-kernel sgl-kernel || true) \ && python3 -m pip install --upgrade pip setuptools wheel packaging \ && cd /opt/ktransformers/third_party/sglang \ && python3 -m pip install --no-deps "./python[all]" \ && python3 -m pip install --no-deps "${SGL_KERNEL_CU130_WHL}" \ && python3 -m pip install --no-deps decord2 # Build kt-kernel against the prepared CUDA 13 / SM120 environment. RUN cd /opt/ktransformers/kt-kernel \ && python3 -m pip install --no-deps --no-build-isolation -v . WORKDIR /workspace CMD ["bash"] ``` ## Run command ```bash docker run --rm \ --name g3-kimi-k2.5-rawint4-kt-192k-p2 \ --ipc=host \ --cap-add=SYS_NICE \ --runtime nvidia \ --gpus device=all \ -v /mnt/hot/hfhub:/root/.cache/huggingface/hub \ -v /mnt/bulk/config/parsers:/opt/parsers:ro \ -e 'NCCL_IB_DISABLE=1' \ -e 'PYTORCH_ALLOC_CONF=expandable_segments:True' \ -e 'SGLANG_ENABLE_JIT_DEEPGEMM=0' \ -e 'OMP_NUM_THREADS=8' \ -e 'SAFETENSORS_FAST_GPU=1' \ -p 8000:8000 \ sglang-kt:cu13 \ python -m sglang.launch_server \ --model-path /root/.cache/huggingface/hub/models--moonshotai--Kimi-K2.5/snapshots/54383e83fa343a1331754112fb9e3410c55efa2f \ --kt-weight-path /root/.cache/huggingface/hub/models--moonshotai--Kimi-K2.5/snapshots/54383e83fa343a1331754112fb9e3410c55efa2f \ --served-model-name g3-kimi-k2.5-rawint4-kt-192k-p2 \ --host 0.0.0.0 \ --port 8000 \ --mem-fraction-static 0.94 \ --trust-remote-code \ --context-length 196608 \ --max-running-requests 2 \ --prefill-max-requests 2 \ --max-total-tokens 393216 \ --kt-cpuinfer 24 \ --kt-threadpool-count 1 \ --kt-num-gpu-experts 64 \ --kt-method RAWINT4 \ --kt-gpu-prefill-token-threshold 400 \ --kt-max-deferred-experts-per-token 1 \ --kt-enable-dynamic-expert-update \ --enable-mixed-chunk \ --tensor-parallel-size 2 \ --enable-p2p-check \ --disable-shared-experts-fusion \ --disable-custom-all-reduce \ --chunked-prefill-size 16384 \ --attention-backend flashinfer \ --reasoning-parser kimi_k2 \ --tool-call-parser kimi_k2 \ --sampling-defaults model ``` ## Performance (single user) - TFT: 1015.78 ms - TTS: 50.79 ms - Request latency: 12537.97 ms - ITL: 45.19 ms - Output TPS/user: 22.14 tok/s <details> ``` NVIDIA AIPerf | LLM Metrics ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┓ ┃ Metric ┃ avg ┃ min ┃ max ┃ p99 ┃ p90 ┃ p50 ┃ std ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━┩ │ Time to First Token (ms) │ 1,015.78 │ 938.80 │ 1,069.26 │ 1,060.36 │ 1,037.79 │ 1,018.81 │ 23.20 │ │ Time to Second Token (ms) │ 50.79 │ 44.03 │ 117.95 │ 115.51 │ 53.98 │ 46.87 │ 14.36 │ │ Request Latency (ms) │ 12,537.97 │ 12,135.71 │ 12,888.58 │ 12,873.09 │ 12,763.19 │ 12,581.80 │ 199.38 │ │ Inter Token Latency (ms) │ 45.19 │ 43.70 │ 46.63 │ 46.59 │ 46.09 │ 45.36 │ 0.80 │ │ Output Token Throughput Per User │ 22.14 │ 21.45 │ 22.88 │ 22.88 │ 22.76 │ 22.05 │ 0.39 │ │ (tokens/sec/user) │ │ │ │ │ │ │ │ │ Output Sequence Length (tokens) │ 256.00 │ 256.00 │ 256.00 │ 256.00 │ 256.00 │ 256.00 │ 0.00 │ │ Input Sequence Length (tokens) │ 179.96 │ 32.00 │ 329.00 │ 329.00 │ 299.10 │ 180.00 │ 94.48 │ │ Output Token Throughput (tokens/sec) │ 17.31 │ N/A │ N/A │ N/A │ N/A │ N/A │ N/A │ │ Request Throughput (requests/sec) │ 0.07 │ N/A │ N/A │ N/A │ N/A │ N/A │ N/A │ │ Request Count (requests) │ 50.00 │ N/A │ N/A │ N/A │ N/A │ N/A │ N/A │ └──────────────────────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴────────┘ CLI Command: aiperf profile --model 'g3-kimi-k2.5-rawint4-kt-192k-p2' --tokenizer 'moonshotai/Kimi-K2.5' --tokenizer-trust-remote-code --url 'http://localhost:8000' --endpoint-type 'chat' --endpoint '/v1/chat/completions' --streaming --concurrency 1 --conversation-num 5 --conversation-turn-mean 10 --conversation-turn-stddev 0 --conversation-turn-delay-mean 2500 --conversation-turn-delay-stddev 0 --synthetic-input-tokens-mean 32 --synthetic-input-tokens-stddev 0 --output-tokens-mean 256 --num-dataset-entries 50 --num-warmup-sessions 1 --random-seed 42 --connection-reuse-strategy 'sticky-user-sessions' ``` </details> ## Performance (two concurrent users) - TTFT: 1796.66 ms - TTS: 237.60 ms - Request latency: 20643.53 ms - ITL: 73.91 ms - Output TPS/user: 13.54 tok/s <details> ``` NVIDIA AIPerf | LLM Metrics ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━━━━┳━━━━━━━━┓ ┃ Metric ┃ avg ┃ min ┃ max ┃ p99 ┃ p90 ┃ p50 ┃ std ┃ ┡━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━━━━╇━━━━━━━━┩ │ Time to First Token (ms) │ 1,796.66 │ 1,569.23 │ 2,045.10 │ 2,030.98 │ 1,976.02 │ 1,824.26 │ 169.10 │ │ Time to Second Token (ms) │ 237.60 │ 65.60 │ 427.46 │ 426.71 │ 418.46 │ 101.53 │ 169.24 │ │ Request Latency (ms) │ 20,643.53 │ 19,634.48 │ 21,393.07 │ 21,392.48 │ 21,277.87 │ 20,685.79 │ 525.87 │ │ Inter Token Latency (ms) │ 73.91 │ 69.28 │ 77.51 │ 77.46 │ 76.73 │ 74.29 │ 2.21 │ │ Output Token Throughput Per User │ 13.54 │ 12.90 │ 14.43 │ 14.40 │ 14.09 │ 13.46 │ 0.41 │ │ (tokens/sec/user) │ │ │ │ │ │ │ │ │ Output Sequence Length (tokens) │ 256.00 │ 256.00 │ 256.00 │ 256.00 │ 256.00 │ 256.00 │ 0.00 │ │ Input Sequence Length (tokens) │ 180.35 │ 32.00 │ 329.00 │ 329.00 │ 299.20 │ 180.00 │ 94.68 │ │ Output Token Throughput (tokens/sec) │ 22.36 │ N/A │ N/A │ N/A │ N/A │ N/A │ N/A │ │ Request Throughput (requests/sec) │ 0.09 │ N/A │ N/A │ N/A │ N/A │ N/A │ N/A │ │ Request Count (requests) │ 40.00 │ N/A │ N/A │ N/A │ N/A │ N/A │ N/A │ └──────────────────────────────────────┴───────────┴───────────┴───────────┴───────────┴───────────┴───────────┴────────┘ CLI Command: aiperf profile --model 'g3-kimi-k2.5-rawint4-kt-192k-p2' --tokenizer 'moonshotai/Kimi-K2.5' --tokenizer-trust-remote-code --url 'http://localhost:8000' --endpoint-type 'chat' --endpoint '/v1/chat/completions' --streaming --concurrency 2 --conversation-num 4 --conversation-turn-mean 10 --conversation-turn-stddev 0 --conversation-turn-delay-mean 2500 --conversation-turn-delay-stddev 0 --synthetic-input-tokens-mean 32 --synthetic-input-tokens-stddev 0 --output-tokens-mean 256 --num-dataset-entries 40 --num-warmup-sessions 1 --random-seed 42 --connection-reuse-strategy 'sticky-user-sessions' ``` </details> Both reasoning and function calling works well, but I have not tried on long context yet. This is my first experience with SGLang + KT (and `aiperf`). Tips to improve my "recipe to run" for better performance would be **very welcome**.
Author
Owner

@usrlocalben commented on GitHub (Mar 30, 2026):

@sousekd thanks for posting. I'm not sure if it's due to cuda13 or a couple of new params I took from your invocation but I get a 5% bump in decode throughput over my cuda12 setup (epyc 9b14 + 1x rtx 6000 pro).

<!-- gh-comment-id:4158783351 --> @usrlocalben commented on GitHub (Mar 30, 2026): @sousekd thanks for posting. I'm not sure if it's due to cuda13 or a couple of new params I took from your invocation but I get a 5% bump in decode throughput over my cuda12 setup (epyc 9b14 + 1x rtx 6000 pro).
Author
Owner

@ErvinXie commented on GitHub (Mar 31, 2026):

Thanks for the detailed report and for sharing your setup!

On kt-cpuinfer above physical core count: The "Core not found" warnings are expected when you set kt-cpuinfer higher than the number of physical cores in a NUMA node — the system simply skips the invalid core IDs. It's generally fine to go above the physical core count up to a reasonable limit; the thread scheduler will handle it. That said, setting it to match physical cores per NUMA node is the cleaner configuration.

On --kt-enable-dynamic-expert-update: This feature is currently on the Kimi K2.5 branch. We plan to upstream it to the main branch — no specific timeline yet, but it's on our radar.

On the missing <think> opening tag: As @KebobZ noted, passing {"chat_template_kwargs": {"thinking": true}} in your request resolves this. This is a known behavior with the current chat template handling.

On garbled output with large prompts (@KebobZ): This could be related to the prefill token threshold — when a very long prompt triggers the CPU-side prefill fallback, there can be edge cases. Could you share your full launch command and an example of the garbled output? That would help us narrow it down.


This reply was co-authored by an AI agent and a human.

<!-- gh-comment-id:4159392338 --> @ErvinXie commented on GitHub (Mar 31, 2026): Thanks for the detailed report and for sharing your setup! **On kt-cpuinfer above physical core count:** The "Core not found" warnings are expected when you set kt-cpuinfer higher than the number of physical cores in a NUMA node — the system simply skips the invalid core IDs. It's generally fine to go above the physical core count up to a reasonable limit; the thread scheduler will handle it. That said, setting it to match physical cores per NUMA node is the cleaner configuration. **On `--kt-enable-dynamic-expert-update`:** This feature is currently on the Kimi K2.5 branch. We plan to upstream it to the main branch — no specific timeline yet, but it's on our radar. **On the missing `<think>` opening tag:** As @KebobZ noted, passing `{"chat_template_kwargs": {"thinking": true}}` in your request resolves this. This is a known behavior with the current chat template handling. **On garbled output with large prompts (@KebobZ):** This could be related to the prefill token threshold — when a very long prompt triggers the CPU-side prefill fallback, there can be edge cases. Could you share your full launch command and an example of the garbled output? That would help us narrow it down. --- *This reply was co-authored by an AI agent and a human.*
Author
Owner

@usrlocalben commented on GitHub (Mar 31, 2026):

@ErvinXie

On --kt-enable-dynamic-expert-update: This feature is currently on the Kimi K2.5 branch.

Does this feature work? Does one just checkout the branch? branch kimi_k2.5 is 2 months old, 45 commits behind main at this time.

<!-- gh-comment-id:4163381075 --> @usrlocalben commented on GitHub (Mar 31, 2026): @ErvinXie > **On `--kt-enable-dynamic-expert-update`:** This feature is currently on the Kimi K2.5 branch. Does this feature work? Does one just checkout the branch? branch kimi_k2.5 is 2 months old, 45 commits behind main at this time.
Author
Owner

@ErvinXie commented on GitHub (Apr 9, 2026):

The --kt-enable-dynamic-expert-update feature has already been merged into main. You can use it directly on the main branch, no need to checkout the kimi_k2.5 branch.


This reply was co-authored by an AI agent and a human.

<!-- gh-comment-id:4211319207 --> @ErvinXie commented on GitHub (Apr 9, 2026): The `--kt-enable-dynamic-expert-update` feature has already been merged into main. You can use it directly on the main branch, no need to checkout the kimi_k2.5 branch. --- *This reply was co-authored by an AI agent and a human.*
Author
Owner

@kz0ltan commented on GitHub (Apr 26, 2026):

Before downloading and setting all this up, could somebody tell me if this will work with 512GB RAM and 2xRTX 6000 Pro (so the question is whether RAM is a hard requirement or RAM+VRAM works as well)? Thanks!

<!-- gh-comment-id:4322699153 --> @kz0ltan commented on GitHub (Apr 26, 2026): Before downloading and setting all this up, could somebody tell me if this will work with 512GB RAM and 2xRTX 6000 Pro (so the question is whether RAM is a hard requirement or RAM+VRAM works as well)? Thanks!
Author
Owner

@sousekd commented on GitHub (Apr 26, 2026):

Before downloading and setting all this up, could somebody tell me if this will work with 512GB RAM and 2xRTX 6000 Pro (so the question is whether RAM is a hard requirement or RAM+VRAM works as well)? Thanks!

I don't think so. I see 600 GB RAM used after loading the model on one GPU with --kt-num-gpu-experts 8. You can increase the number of offloaded experts with two PRO's 6000, but I don't think it will bypass the loading to RAM.

That said, if you want to try, here is my current Dockerfile, updated just a couple of days ago:

# syntax=docker/dockerfile:1.7
# SGLang + KTransformers for CUDA 13 on RTX PRO 6000 Blackwell + EPYC Turin

ARG BASE_IMAGE=lmsysorg/sglang:dev-cu13
FROM ${BASE_IMAGE}

SHELL ["/bin/bash", "-o", "pipefail", "-c"]

ARG DEBIAN_FRONTEND=noninteractive
ARG KTRANSFORMERS_REF=v0.5.3
ARG KT_CUDA_ARCHS=120
ARG KT_BUILD_JOBS=64
ARG SGL_KERNEL_VERSION=0.3.21

# Build/runtime settings for Turin + Blackwell
ENV CUDA_HOME=/usr/local/cuda \
    TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas \
    HF_HUB_ENABLE_HF_TRANSFER=1 \
    CUDA_MODULE_LOADING=LAZY \
    PYTORCH_ALLOC_CONF=expandable_segments:True \
    PIP_DISABLE_PIP_VERSION_CHECK=1 \
    PIP_NO_CACHE_DIR=1 \
    PIP_ROOT_USER_ACTION=ignore \
    CPUINFER_CPU_INSTRUCT=FANCY \
    CPUINFER_ENABLE_AMX=OFF \
    CPUINFER_ENABLE_AVX512_VNNI=ON \
    CPUINFER_ENABLE_AVX512_BF16=ON \
    CPUINFER_ENABLE_AVX512_VBMI=ON \
    CPUINFER_USE_CUDA=1 \
    CPUINFER_CUDA_ARCHS=${KT_CUDA_ARCHS} \
    CPUINFER_PARALLEL=${KT_BUILD_JOBS}

# Native build dependencies for kt-kernel and system topology support
RUN apt-get update && apt-get install -y --no-install-recommends \
    build-essential \
    cmake \
    ninja-build \
    git \
    git-lfs \
    curl \
    wget \
    ca-certificates \
    pkg-config \
    python3-dev \
    libhwloc-dev \
    libnuma-dev \
    numactl \
    pciutils \
    && rm -rf /var/lib/apt/lists/* \
    && git lfs install --system

WORKDIR /opt

# KTransformers source and submodules
RUN git clone --branch "${KTRANSFORMERS_REF}" --recursive \
      https://github.com/kvcache-ai/ktransformers.git /opt/ktransformers \
    && cd /opt/ktransformers \
    && git submodule update --init --recursive

# KTransformers SGLang fork + CUDA 13 kernel package
RUN (python3 -m pip uninstall -y sglang sglang-kt kt-kernel sglang-kernel sgl-kernel || true) \
    && python3 -m pip install --upgrade pip setuptools wheel packaging html5lib six \
    && cd /opt/ktransformers/third_party/sglang \
    && python3 -m pip install --no-deps "./python[all]" \
    && python3 -m pip install --force-reinstall --no-deps \
       "https://github.com/sgl-project/whl/releases/download/v${SGL_KERNEL_VERSION}/sgl_kernel-${SGL_KERNEL_VERSION}%2Bcu130-cp312-abi3-manylinux2014_$(uname -m).whl" \
    && python3 -m pip install --no-deps decord2

# kt-kernel build for Turin CPU + Blackwell GPU
RUN cd /opt/ktransformers/kt-kernel \
    && python3 -m pip install --no-deps --no-build-isolation -v .

# Triton PTXAS path aligned with system CUDA toolkit
RUN if [ -d /usr/local/lib/python3.12/dist-packages/triton/backends/nvidia/bin ]; then \
      rm -f /usr/local/lib/python3.12/dist-packages/triton/backends/nvidia/bin/ptxas && \
      ln -sf /usr/local/cuda/bin/ptxas /usr/local/lib/python3.12/dist-packages/triton/backends/nvidia/bin/ptxas; \
    fi

WORKDIR /workspace
CMD ["bash"]

If it doesn't work, use llama.cpp or ik_llama.cpp. The latter actually runs this model faster than KTransformers for a single user. I posted some comparison of inference engines here: https://huggingface.co/ubergarm/Kimi-K2.6-GGUF/discussions/3

<!-- gh-comment-id:4322838573 --> @sousekd commented on GitHub (Apr 26, 2026): > Before downloading and setting all this up, could somebody tell me if this will work with 512GB RAM and 2xRTX 6000 Pro (so the question is whether RAM is a hard requirement or RAM+VRAM works as well)? Thanks! I don't think so. I see 600 GB RAM used after loading the model on one GPU with `--kt-num-gpu-experts 8`. You can increase the number of offloaded experts with two PRO's 6000, but I don't think it will bypass the loading to RAM. That said, if you want to try, here is my current Dockerfile, updated just a couple of days ago: ``` # syntax=docker/dockerfile:1.7 # SGLang + KTransformers for CUDA 13 on RTX PRO 6000 Blackwell + EPYC Turin ARG BASE_IMAGE=lmsysorg/sglang:dev-cu13 FROM ${BASE_IMAGE} SHELL ["/bin/bash", "-o", "pipefail", "-c"] ARG DEBIAN_FRONTEND=noninteractive ARG KTRANSFORMERS_REF=v0.5.3 ARG KT_CUDA_ARCHS=120 ARG KT_BUILD_JOBS=64 ARG SGL_KERNEL_VERSION=0.3.21 # Build/runtime settings for Turin + Blackwell ENV CUDA_HOME=/usr/local/cuda \ TRITON_PTXAS_PATH=/usr/local/cuda/bin/ptxas \ HF_HUB_ENABLE_HF_TRANSFER=1 \ CUDA_MODULE_LOADING=LAZY \ PYTORCH_ALLOC_CONF=expandable_segments:True \ PIP_DISABLE_PIP_VERSION_CHECK=1 \ PIP_NO_CACHE_DIR=1 \ PIP_ROOT_USER_ACTION=ignore \ CPUINFER_CPU_INSTRUCT=FANCY \ CPUINFER_ENABLE_AMX=OFF \ CPUINFER_ENABLE_AVX512_VNNI=ON \ CPUINFER_ENABLE_AVX512_BF16=ON \ CPUINFER_ENABLE_AVX512_VBMI=ON \ CPUINFER_USE_CUDA=1 \ CPUINFER_CUDA_ARCHS=${KT_CUDA_ARCHS} \ CPUINFER_PARALLEL=${KT_BUILD_JOBS} # Native build dependencies for kt-kernel and system topology support RUN apt-get update && apt-get install -y --no-install-recommends \ build-essential \ cmake \ ninja-build \ git \ git-lfs \ curl \ wget \ ca-certificates \ pkg-config \ python3-dev \ libhwloc-dev \ libnuma-dev \ numactl \ pciutils \ && rm -rf /var/lib/apt/lists/* \ && git lfs install --system WORKDIR /opt # KTransformers source and submodules RUN git clone --branch "${KTRANSFORMERS_REF}" --recursive \ https://github.com/kvcache-ai/ktransformers.git /opt/ktransformers \ && cd /opt/ktransformers \ && git submodule update --init --recursive # KTransformers SGLang fork + CUDA 13 kernel package RUN (python3 -m pip uninstall -y sglang sglang-kt kt-kernel sglang-kernel sgl-kernel || true) \ && python3 -m pip install --upgrade pip setuptools wheel packaging html5lib six \ && cd /opt/ktransformers/third_party/sglang \ && python3 -m pip install --no-deps "./python[all]" \ && python3 -m pip install --force-reinstall --no-deps \ "https://github.com/sgl-project/whl/releases/download/v${SGL_KERNEL_VERSION}/sgl_kernel-${SGL_KERNEL_VERSION}%2Bcu130-cp312-abi3-manylinux2014_$(uname -m).whl" \ && python3 -m pip install --no-deps decord2 # kt-kernel build for Turin CPU + Blackwell GPU RUN cd /opt/ktransformers/kt-kernel \ && python3 -m pip install --no-deps --no-build-isolation -v . # Triton PTXAS path aligned with system CUDA toolkit RUN if [ -d /usr/local/lib/python3.12/dist-packages/triton/backends/nvidia/bin ]; then \ rm -f /usr/local/lib/python3.12/dist-packages/triton/backends/nvidia/bin/ptxas && \ ln -sf /usr/local/cuda/bin/ptxas /usr/local/lib/python3.12/dist-packages/triton/backends/nvidia/bin/ptxas; \ fi WORKDIR /workspace CMD ["bash"] ``` If it doesn't work, use llama.cpp or ik_llama.cpp. The latter actually runs this model faster than KTransformers for a single user. I posted some comparison of inference engines here: https://huggingface.co/ubergarm/Kimi-K2.6-GGUF/discussions/3
Author
Owner

@shrould8888 commented on GitHub (May 16, 2026):

you have to take advantage of the Intel AMX instructions which makes the prefill speed 10x faster.
but first you have to convert the INT4 weights to AMXINT4 weights.

I have found the solution to do the converstion and hope it could be useful to someone:

  1. convert Kimi K2.X’s native INT4 weights to BF16 by using the script int4_cast_bf16_fixed.py from this project: https://github.com/csabakecskemeti/DQ_int4-to-bf16_dequant

  2. using ktransformers/kt-kernel/scripts/convert_cpu_weights.py to convert bf16 weights to AMXINT4 weights.

I have successfully converted Kimi K2.6 INT4 weights to AMXINT4, it works flawlessly.

<!-- gh-comment-id:4466486472 --> @shrould8888 commented on GitHub (May 16, 2026): you have to take advantage of the Intel AMX instructions which makes the prefill speed 10x faster. but first you have to convert the INT4 weights to AMXINT4 weights. I have found the solution to do the converstion and hope it could be useful to someone: 1. convert Kimi K2.X’s native INT4 weights to BF16 by using the script int4_cast_bf16_fixed.py from this project: https://github.com/csabakecskemeti/DQ_int4-to-bf16_dequant 2. using ktransformers/kt-kernel/scripts/convert_cpu_weights.py to convert bf16 weights to AMXINT4 weights. I have successfully converted Kimi K2.6 INT4 weights to AMXINT4, it works flawlessly.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
kvcache-ai/ktransformers#1135
No description provided.