[GH-ISSUE #1877] 我用8张L40S跑glm-5,第一个问题速度正常,第二个问题开始就急剧下降到初始速度的四分之一以下。 #1167

Open
opened 2026-10-29 14:49:31 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @su400 on GitHub (Mar 6, 2026).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1877

Reminder

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

System Info

没有启用 --fp8-gemm-backend cutlass 因为GPU不支持。
第一个问题,[2026-03-06 00:54:14 TP0] Decode batch, #running-req: 1, #token: 1344, token usage: 0.01, cuda graph: True, gen throughput (token/s): 8.32, #queue-req: 0
第二、三个问题
[2026-03-06 08:45:41 TP0] Decode batch, #running-req: 1, #token: 4480, token usage: 0.02, cuda graph: True, gen throughput (token/s): 1.85, #queue-req: 0
[2026-03-06 09:08:08 TP0] Decode batch, #running-req: 1, #token: 5952, token usage: 0.03, cuda graph: True, gen throughput (token/s): 1.93, #queue-req: 0

conda activate kt
export PYTORCH_ALLOC_CONF=expandable_segments:True
export SGLANG_ENABLE_JIT_DEEPGEMM=0

python -m sglang.launch_server
--host 0.0.0.0
--port 9997
--model /media/kkk/dat/GLM-5-FP8
--kt-weight-path /media/kkk/dat/GLM-5-FP8
--kt-cpuinfer 48
--kt-threadpool-count 4
--kt-num-gpu-experts 30
--kt-method FP8
--kt-gpu-prefill-token-threshold 1024
--kt-enable-dynamic-expert-update
--kt-expert-placement-strategy uniform
--trust-remote-code
--mem-fraction-static 0.85
--served-model-name GLM5
--enable-mixed-chunk
--tensor-parallel-size 8
--enable-p2p-check
--disable-shared-experts-fusion
--chunked-prefill-size 16384
--max-running-requests 4
--max-total-tokens 200000
--attention-backend flashinfer
--kv-cache-dtype bf16
--tool-call-parser glm47
--reasoning-parser glm45
--watchdog-timeout 3000

Reproduction

Put your message here.

Others

No response

Originally created by @su400 on GitHub (Mar 6, 2026). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1877 ### Reminder - [x] I have read the above rules and searched the existing issues. ### System Info 没有启用 --fp8-gemm-backend cutlass 因为GPU不支持。 第一个问题,[2026-03-06 00:54:14 TP0] Decode batch, #running-req: 1, #token: 1344, token usage: 0.01, cuda graph: True, gen throughput (token/s): 8.32, #queue-req: 0 第二、三个问题 [2026-03-06 08:45:41 TP0] Decode batch, #running-req: 1, #token: 4480, token usage: 0.02, cuda graph: True, gen throughput (token/s): 1.85, #queue-req: 0 [2026-03-06 09:08:08 TP0] Decode batch, #running-req: 1, #token: 5952, token usage: 0.03, cuda graph: True, gen throughput (token/s): 1.93, #queue-req: 0 conda activate kt export PYTORCH_ALLOC_CONF=expandable_segments:True export SGLANG_ENABLE_JIT_DEEPGEMM=0 python -m sglang.launch_server \ --host 0.0.0.0 \ --port 9997 \ --model /media/kkk/dat/GLM-5-FP8 \ --kt-weight-path /media/kkk/dat/GLM-5-FP8 \ --kt-cpuinfer 48 \ --kt-threadpool-count 4 \ --kt-num-gpu-experts 30 \ --kt-method FP8 \ --kt-gpu-prefill-token-threshold 1024 \ --kt-enable-dynamic-expert-update \ --kt-expert-placement-strategy uniform \ --trust-remote-code \ --mem-fraction-static 0.85 \ --served-model-name GLM5 \ --enable-mixed-chunk \ --tensor-parallel-size 8 \ --enable-p2p-check \ --disable-shared-experts-fusion \ --chunked-prefill-size 16384 \ --max-running-requests 4 \ --max-total-tokens 200000 \ --attention-backend flashinfer \ --kv-cache-dtype bf16 \ --tool-call-parser glm47 \ --reasoning-parser glm45 \ --watchdog-timeout 3000 ### Reproduction ```text Put your message here. ``` ### Others _No response_
Author
Owner

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

你好 @su400,

从日志来看有几个值得注意的点:

1. Token 数在累积

  • 第一个问题:#token: 1344
  • 第二个问题:#token: 4480
  • 第三个问题:#token: 5952

token 数在不断增长,说明前面对话的 KV cache 没有被释放。请确认你是否在使用多轮对话(聊天界面保持上下文)?如果是,每次新请求都需要处理累积的上下文,这会拖慢速度。

建议测试:重启服务后,单独发送一个新问题,看 decode 速度是否恢复到 8+ tok/s。

如果你在使用多轮对话,建议确保 radix cache(前缀缓存)已开启(SGLang 默认开启,除非你加了 --disable-radix-cache)。这样多轮对话时前面轮次的 KV cache 可以被复用,不需要每次重新计算,decode 速度不会因为上下文变长而大幅下降。

2. CPU 信息

请提供你的 CPU 型号。--kt-method FP8 的 CPU 后端需要 AVX512_BF16 + AVX512_VBMI 支持。如果 CPU 不完全支持,可能会 fallback 到慢路径。

3. L40S + FP8

L40S 是 SM89(Ada Lovelace),不支持 CUTLASS block FP8。请确认 GPU 侧的 FP8 计算使用的是什么 backend:

grep -i "fp8\|gemm\|backend" your_launch.log

此回复由 AI agent 与人类共同撰写。

<!-- gh-comment-id:4053529964 --> @ErvinXie commented on GitHub (Mar 13, 2026): 你好 @su400, 从日志来看有几个值得注意的点: ### 1. Token 数在累积 - 第一个问题:`#token: 1344` - 第二个问题:`#token: 4480` - 第三个问题:`#token: 5952` token 数在不断增长,说明前面对话的 KV cache 没有被释放。请确认你是否在使用**多轮对话**(聊天界面保持上下文)?如果是,每次新请求都需要处理累积的上下文,这会拖慢速度。 建议测试:**重启服务后,单独发送一个新问题**,看 decode 速度是否恢复到 8+ tok/s。 如果你在使用多轮对话,建议确保 **radix cache(前缀缓存)已开启**(SGLang 默认开启,除非你加了 `--disable-radix-cache`)。这样多轮对话时前面轮次的 KV cache 可以被复用,不需要每次重新计算,decode 速度不会因为上下文变长而大幅下降。 ### 2. CPU 信息 请提供你的 CPU 型号。`--kt-method FP8` 的 CPU 后端需要 AVX512_BF16 + AVX512_VBMI 支持。如果 CPU 不完全支持,可能会 fallback 到慢路径。 ### 3. L40S + FP8 L40S 是 SM89(Ada Lovelace),不支持 CUTLASS block FP8。请确认 GPU 侧的 FP8 计算使用的是什么 backend: ```bash grep -i "fp8\|gemm\|backend" your_launch.log ``` --- *此回复由 AI agent 与人类共同撰写。*
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#1167
No description provided.