[GH-ISSUE #1003] [Bug] 海光K100A速度非常慢 #710

Closed
opened 2026-10-29 14:43:13 +00:00 by bsakaguchi · 1 comment
Owner

Originally created by @yeungtuzi on GitHub (Mar 31, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1003

检查清单

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

问题描述

推理速度非常慢(~1 token/s),GPU和CPU均基本满载

复现步骤

export HF_ENDPOINT="https://hf-mirror.com/"
export TORCH_BLAS_PREFER_HIPBLASLT=0 (使用或者不使用此参数速度无明显变化)
ktransformers --force_think --model_path deepseek-ai/DeepSeek-R1 --gguf_path /opt/DeepSeek-R1-Q4_K_M --cpu_infer 30 --port 10002 --max_new_tokens=16384 --cache_lens=16384 --max_response_tokens 16384 --model_name "DeepSeek-R1" --optimize_config_path ktransformers/optimize/optimize_rules/rocm/DeepSeek-V3-Chat.yaml

环境信息

硬件 环境
AMD Ryzen Threadripper PRO 7975WX 32-Cores
512G RAM
软件 环境
ubuntu 22.04 server lts
anaconda create -n kt python=3.11
cuda-toolkit-11-7

编译前安装了hygon驱动6.3.3,以及官方提供的以下预编译包

torch-2.4.1+das.opt2.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl
torchaudio-2.1.2+das.opt1.dtk24043-cp311-cp311-manylinux_2_28_x86_64.whl
torchvision-0.19.1+das.opt2.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl
flash_attn-2.6.1+das.opt4.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl
fastpt-2.0.0+das.dtk2504-py3-none-any.whl
triton-3.0.0+das.opt4.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl
xformers-0.0.25+das.opt1.dtk24043-cp311-cp311-manylinux_2_28_x86_64.whl(这个会自动安装numpy-1.24.3 xformers-0.0.25+das.opt1.dtk24042)

源代码编译方式安装了flashinfer

git最新版ktransformers编译后完成安装,安装信息为

Successfully installed ktransformers-0.2.3.post2+torch24fancy

Originally created by @yeungtuzi on GitHub (Mar 31, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/1003 ### 检查清单 - [x] 1. 我已经搜索过相关问题,但未能获得预期的帮助 - [x] 2. 该问题在最新版本中尚未修复 - [x] 3. 请注意,如果您提交的BUG相关 issue 缺少对应环境信息和最小可复现示例,我们将难以复现和定位问题,降低获得反馈的可能性 - [x] 4. 如果您提出的不是bug而是问题,请在讨论区发起讨论 https://github.com/kvcache-ai/ktransformers/discussions。否则该 issue 将被关闭 - [x] 5. 为方便社区交流,我将使用中文/英文或附上中文/英文翻译(如使用其他语言)。未附带翻译的非中文/英语内容可能会被关闭 ### 问题描述 推理速度非常慢(~1 token/s),GPU和CPU均基本满载 ### 复现步骤 export HF_ENDPOINT="https://hf-mirror.com/" export TORCH_BLAS_PREFER_HIPBLASLT=0 (使用或者不使用此参数速度无明显变化) ktransformers --force_think --model_path deepseek-ai/DeepSeek-R1 --gguf_path /opt/DeepSeek-R1-Q4_K_M --cpu_infer 30 --port 10002 --max_new_tokens=16384 --cache_lens=16384 --max_response_tokens 16384 --model_name "DeepSeek-R1" --optimize_config_path ktransformers/optimize/optimize_rules/rocm/DeepSeek-V3-Chat.yaml ### 环境信息 硬件 环境 AMD Ryzen Threadripper PRO 7975WX 32-Cores 512G RAM 软件 环境 ubuntu 22.04 server lts anaconda create -n kt python=3.11 cuda-toolkit-11-7 编译前安装了hygon驱动6.3.3,以及官方提供的以下预编译包 torch-2.4.1+das.opt2.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl torchaudio-2.1.2+das.opt1.dtk24043-cp311-cp311-manylinux_2_28_x86_64.whl torchvision-0.19.1+das.opt2.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl flash_attn-2.6.1+das.opt4.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl fastpt-2.0.0+das.dtk2504-py3-none-any.whl triton-3.0.0+das.opt4.dtk2504-cp311-cp311-manylinux_2_28_x86_64.whl xformers-0.0.25+das.opt1.dtk24043-cp311-cp311-manylinux_2_28_x86_64.whl(这个会自动安装numpy-1.24.3 xformers-0.0.25+das.opt1.dtk24042) 源代码编译方式安装了flashinfer git最新版ktransformers编译后完成安装,安装信息为 Successfully installed ktransformers-0.2.3.post2+torch24fancy
Author
Owner

@yeungtuzi commented on GitHub (Apr 1, 2025):

换成torch的算子后,提升了一倍,到了1.8tps 😂,已经放弃

<!-- gh-comment-id:2769435756 --> @yeungtuzi commented on GitHub (Apr 1, 2025): 换成torch的算子后,提升了一倍,到了1.8tps 😂,已经放弃
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#710
No description provided.