ktransformers: [Bug] v0.2.4post1 runs, but does not open port

Checklist

  • 1. I have searched related issues but cannot get the expected help.
  • 2. The bug has not been fixed in the latest version.
  • 3. Please note that if the bug-related issue you submitted lacks corresponding environment info and a minimal reproducible demo, it will be challenging for us to reproduce and resolve the issue, reducing the likelihood of receiving feedback.
  • 4. If the issue you raised is not a bug but a question, please raise a discussion at https://github.com/kvcache-ai/ktransformers/discussions. Otherwise, it will be closed.
  • 5. To help the community, I will use Chinese/English or attach an Chinese/English translation if using another language. Non-Chinese/English content without translation may be closed.

Describe the bug

I run:

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3-0324 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \
  --max_new_tokens 1000 \
  --cache_lens 32768 \
  --chunk_size 256 \
  --max_batch_size 4 \
  --backend_type balance_serve

result:

2025-04-05 19:51:53,699 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend
found flashinfer
sched_rpc started with PID: 7129
set start method
Connected to server at tcp://localhost:48033
2025-04-05 19:51:55,945 - INFO - flashinfer.jit: Prebuilt kernels not found, using JIT backend
found flashinfer
start method already set to spawn
Connected to server at tcp://localhost:48033
Getting inference context from sched_client.

Then nothing happens.

Reproduction

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3-0324 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \
  --max_new_tokens 1000 \
  --cache_lens 32768 \
  --chunk_size 256 \
  --max_batch_size 4 \
  --backend_type balance_serve

Environment

OS: ubuntu 24.04.02 cuda:

nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2025 NVIDIA Corporation
Built on Fri_Feb_21_20:23:50_PST_2025
Cuda compilation tools, release 12.8, V12.8.93
Build cuda_12.8.r12.8/compiler.35583870_0

I have a 24gb 3090 gpu.

I have 768gb ram.

I’m running dual 9355 epyc CPUs, but I didn’t specify USE_NUMA=1 during build because I have less than 1TB ram.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 21 (1 by maintainers)

Most upvoted comments

Try to download DeepSeek/deepseek-v3-0324 directory small size files into a directory, which must use “DeepSeek-V3” as the end part of your model_path like this one:

“–model_path /data/DeepSeek-V3”,

Otherwise the server process look likes blocked forever.

Ok, I got this working:

python ktransformers/server/main.py \
  --port 11434 \
  --model_path deepseek-ai/DeepSeek-V3-0324 \
  --model_name "DeepSeek-V3-0324:671b-q4_k_m" \
  --gguf_path /data/DeepSeek-V3-0324/q4_files/Q4_K_M \
  --temperature 0.3 \
  --backend_type ktransformers

I had to do this first:

pip3 install flash_attn-2.7.4.post1+cu12torch2.6cxx11abiTRUE-cp311-cp311-linux_x86_64.whl
export CUDA_HOME=/usr/local/cuda
export TORCH_CUDA_ARCH_LIST="8.6"

Then I re-ran the above and it worked.

(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ cmake --version
cmake version 3.28.3

CMake suite maintained and supported by Kitware (kitware.com/cmake).
(ktransformers_mc) jesse@larry:~/ktransformers/ktransformers$ 

--backend_type balance_serve is still not working though.