[GH-ISSUE #1032] [Bug] localhost/v1/chat/completions无响应 #727

Closed
opened 2026-10-29 14:43:36 +00:00 by bsakaguchi · 4 comments
Owner

Originally created by @344303947 on GitHub (Apr 3, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1032

检查清单

  • 1. 我已经搜索过相关问题,但未能获得预期的帮助
  • 2. 该问题在最新版本中尚未修复
  • 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性
  • 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭
  • 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭

问题描述

Image
运行成功但是无响应

复现步骤

python ktransformers/server/main.py
--port 6699
--model_path /home/sean/models/DeepSeek-V3-0324-GGUF/DeepSeek-V3-0324-UD-Q2_K_XL/
--gguf_path /home/sean/models/DeepSeek-V3-0324-GGUF/DeepSeek-V3-0324-UD-Q2_K_XL/
--model_name unsloth/DeepSeek-V3-0324
--optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml
--max_new_tokens 1024
--cache_lens 32768
--chunk_size 256
--max_batch_size 4
--backend_type balance_serve

curl -X POST http://localhost:6699/v1/chat/completions -H "accept: application/json" -H "Content-Type: application/json" -d '{
"messages": [
{"role": "user", "content": "hello"}
],
"model": "DeepSeek-V3-0324",
"temperature": 0.3,
"top_p": 1.0,
}'"stream": true

环境信息

ubuntu 22.04 v2.0.4

Image
Originally created by @344303947 on GitHub (Apr 3, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1032 ### 检查清单 - [x] 1. 我已经搜索过相关问题,但未能获得预期的帮助 - [x] 2. 该问题在最新版本中尚未修复 - [x] 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性 - [ ] 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭 - [ ] 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭 ### 问题描述 ![Image](https://github.com/user-attachments/assets/2f2b2e94-e969-4f81-9236-3fc238f99c4e) 运行成功但是无响应 ### 复现步骤 python ktransformers/server/main.py \ --port 6699 \ --model_path /home/sean/models/DeepSeek-V3-0324-GGUF/DeepSeek-V3-0324-UD-Q2_K_XL/ \ --gguf_path /home/sean/models/DeepSeek-V3-0324-GGUF/DeepSeek-V3-0324-UD-Q2_K_XL/ \ --model_name unsloth/DeepSeek-V3-0324 \ --optimize_config_path ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat-serve.yaml \ --max_new_tokens 1024 \ --cache_lens 32768 \ --chunk_size 256 \ --max_batch_size 4 \ --backend_type balance_serve curl -X POST http://localhost:6699/v1/chat/completions -H "accept: application/json" -H "Content-Type: application/json" -d '{ "messages": [ {"role": "user", "content": "hello"} ], "model": "DeepSeek-V3-0324", "temperature": 0.3, "top_p": 1.0, }'"stream": true ### 环境信息 ubuntu 22.04 v2.0.4 <img width="462" alt="Image" src="https://github.com/user-attachments/assets/8538a072-cf3f-4243-a907-9f988b975475" />
Author
Owner

@qiyuxinlin commented on GitHub (Apr 4, 2025):

您好,可能存在两种情况,显存不足或者 model_path 无法识别,请把 model_path 指定的文件夹命名为 ktransformers/configs/model_configs.json 中的键,这是个 bug,我们今天处理下

<!-- gh-comment-id:2777463623 --> @qiyuxinlin commented on GitHub (Apr 4, 2025): 您好,可能存在两种情况,显存不足或者 model_path 无法识别,请把 model_path 指定的文件夹命名为 ktransformers/configs/model_configs.json 中的键,这是个 bug,我们今天处理下
Author
Owner

@344303947 commented on GitHub (Apr 4, 2025):

修改目录后,能运行了,但是响应很慢,有很多额外的日志打印出来,不知道是否有影响,建议可以不要打印出出来。

add query id: 1, batch.query_lengths: 5, batch_query_tokens: torch.Size([8029]), batch.block_indexes: tensor([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31],
dtype=torch.int32)
prefill_batch_i: 5,
Model execution time (GPU): 756.125 ms
2025-04-04 14:52:03,158 - INFO - flashinfer.jit: Loading JIT ops: sampling
/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/torch/utils/cpp_extension.py:2059: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
/home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/torch/utils/cpp_extension.py:2059: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation.
If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST'].
warnings.warn(
2025-04-04 14:53:12,074 - INFO - flashinfer.jit: Finished loading JIT ops: sampling
30594
decode_batch_i: 1,
Model execution time (GPU): 203.499 ms
1175
decode_batch_i: 1,
Model execution time (GPU): 174.375 ms
28927
decode_batch_i: 1,
Model execution time (GPU): 177.644 ms
235
decode_batch_i: 1,
Model execution time (GPU): 177.389 ms
223
decode_batch_i: 1,
Model execution time (GPU): 179.681 ms
10457
decode_batch_i: 1,
Model execution time (GPU): 177.181 ms
34071
decode_batch_i: 1,
Model execution time (GPU): 175.576 ms
3950
decode_batch_i: 1,
Model execution time (GPU): 176.089 ms
4597
decode_batch_i: 1,
Model execution time (GPU): 177.203 ms
3467
decode_batch_i: 1,
Model execution time (GPU): 174.939 ms
1148
decode_batch_i: 1,
Model execution time (GPU): 176.859 ms
1
decode_batch_i: 1,
Model execution time (GPU): 176.417 ms
0
decode_batch_i: 1,
Model execution time (GPU): 177.240 ms
prefill length: 5, prefill time: 69.75378131866455, prefill tps 0.0716807018268716, decode length: 13, decode time: 2.420722007751465, decode tps 5.370298596192508
5
decode_batch_i: 1,
2025-04-04 14:53:14,733 INFO /home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py[90]: Performance(T/s): prefill 0.07146373016482553, decode 5.42803551052906. Time(s): tokenize 0.04242753982543945, prefill 69.9655613899231, decode 2.3949732780456543

<!-- gh-comment-id:2777713506 --> @344303947 commented on GitHub (Apr 4, 2025): 修改目录后,能运行了,但是响应很慢,有很多额外的日志打印出来,不知道是否有影响,建议可以不要打印出出来。 add query id: 1, batch.query_lengths: 5, batch_query_tokens: torch.Size([8029]), batch.block_indexes: tensor([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31], dtype=torch.int32) prefill_batch_i: 5, Model execution time (GPU): 756.125 ms 2025-04-04 14:52:03,158 - INFO - flashinfer.jit: Loading JIT ops: sampling /home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/torch/utils/cpp_extension.py:2059: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn( /home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/torch/utils/cpp_extension.py:2059: UserWarning: TORCH_CUDA_ARCH_LIST is not set, all archs for visible cards are included for compilation. If this is not desired, please set os.environ['TORCH_CUDA_ARCH_LIST']. warnings.warn( 2025-04-04 14:53:12,074 - INFO - flashinfer.jit: Finished loading JIT ops: sampling 30594 decode_batch_i: 1, Model execution time (GPU): 203.499 ms 1175 decode_batch_i: 1, Model execution time (GPU): 174.375 ms 28927 decode_batch_i: 1, Model execution time (GPU): 177.644 ms 235 decode_batch_i: 1, Model execution time (GPU): 177.389 ms 223 decode_batch_i: 1, Model execution time (GPU): 179.681 ms 10457 decode_batch_i: 1, Model execution time (GPU): 177.181 ms 34071 decode_batch_i: 1, Model execution time (GPU): 175.576 ms 3950 decode_batch_i: 1, Model execution time (GPU): 176.089 ms 4597 decode_batch_i: 1, Model execution time (GPU): 177.203 ms 3467 decode_batch_i: 1, Model execution time (GPU): 174.939 ms 1148 decode_batch_i: 1, Model execution time (GPU): 176.859 ms 1 decode_batch_i: 1, Model execution time (GPU): 176.417 ms 0 decode_batch_i: 1, Model execution time (GPU): 177.240 ms prefill length: 5, prefill time: 69.75378131866455, prefill tps 0.0716807018268716, decode length: 13, decode time: 2.420722007751465, decode tps 5.370298596192508 5 decode_batch_i: 1, 2025-04-04 14:53:14,733 INFO /home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py[90]: Performance(T/s): prefill 0.07146373016482553, decode 5.42803551052906. Time(s): tokenize 0.04242753982543945, prefill 69.9655613899231, decode 2.3949732780456543
Author
Owner

@344303947 commented on GitHub (Apr 4, 2025):

后续继续提问速度倒是正常了点,日志看起来有点长
decode_batch_i: 1,
Model execution time (GPU): 174.469 ms
8725
decode_batch_i: 1,
Model execution time (GPU): 174.656 ms
1939
decode_batch_i: 1,
Model execution time (GPU): 175.267 ms
13491
decode_batch_i: 1,
Model execution time (GPU): 177.075 ms
9574
decode_batch_i: 1,
Model execution time (GPU): 178.370 ms
1148
decode_batch_i: 1,
Model execution time (GPU): 174.270 ms
1227
decode_batch_i: 1,
Model execution time (GPU): 176.466 ms
1
decode_batch_i: 1,
Model execution time (GPU): 176.813 ms
0
decode_batch_i: 1,
Model execution time (GPU): 180.259 ms
prefill length: 8, prefill time: 1.188171148300171, prefill tps 6.733036744281336, decode length: 309, decode time: 56.533483028411865, decode tps 5.465787413888983
5
decode_batch_i: 1,
2025-04-04 14:55:22,546 INFO /home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py[90]: Performance(T/s): prefill 5.831316306169187, decode 5.465283430311012. Time(s): tokenize 0.0010752677917480469, prefill 1.3719029426574707, decode 56.5386962890625
Model execution time (GPU): 180.604 ms
223
decode_batch_i: 1,
Model execution time (GPU): 178.608 ms
939

<!-- gh-comment-id:2777716842 --> @344303947 commented on GitHub (Apr 4, 2025): 后续继续提问速度倒是正常了点,日志看起来有点长 decode_batch_i: 1, Model execution time (GPU): 174.469 ms 8725 decode_batch_i: 1, Model execution time (GPU): 174.656 ms 1939 decode_batch_i: 1, Model execution time (GPU): 175.267 ms 13491 decode_batch_i: 1, Model execution time (GPU): 177.075 ms 9574 decode_batch_i: 1, Model execution time (GPU): 178.370 ms 1148 decode_batch_i: 1, Model execution time (GPU): 174.270 ms 1227 decode_batch_i: 1, Model execution time (GPU): 176.466 ms 1 decode_batch_i: 1, Model execution time (GPU): 176.813 ms 0 decode_batch_i: 1, Model execution time (GPU): 180.259 ms prefill length: 8, prefill time: 1.188171148300171, prefill tps 6.733036744281336, decode length: 309, decode time: 56.533483028411865, decode tps 5.465787413888983 5 decode_batch_i: 1, 2025-04-04 14:55:22,546 INFO /home/sean/miniconda3/envs/kt/lib/python3.10/site-packages/ktransformers/server/backend/interfaces/balance_serve.py[90]: Performance(T/s): prefill 5.831316306169187, decode 5.465283430311012. Time(s): tokenize 0.0010752677917480469, prefill 1.3719029426574707, decode 56.5386962890625 Model execution time (GPU): 180.604 ms 223 decode_batch_i: 1, Model execution time (GPU): 178.608 ms 939
Author
Owner

@344303947 commented on GitHub (Apr 4, 2025):

搞定了 ,~ 【Ktransformers 0.2.4支持DeepSeek-V3-0324并发部署测试】https://www.bilibili.com/video/BV1JLZoYGENu?vd_source=954828d4da44f3115ef5b39efde8a320

<!-- gh-comment-id:2777878413 --> @344303947 commented on GitHub (Apr 4, 2025): 搞定了 ,~ 【Ktransformers 0.2.4支持DeepSeek-V3-0324并发部署测试】https://www.bilibili.com/video/BV1JLZoYGENu?vd_source=954828d4da44f3115ef5b39efde8a320
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#727
No description provided.