[GH-ISSUE #973] 显存占用是否存在优化方式 #693

Closed
opened 2026-10-29 14:42:57 +00:00 by bsakaguchi · 3 comments
Owner

Originally created by @sunhaoyu-1990 on GitHub (Mar 25, 2025).
Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/973

Originally assigned to: @KMSorSMS on GitHub.

目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型
硬件配置如下:
显卡:3080Ti(12GB) * 8
内存:512GB

运行命令为
ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full
其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容

Image

刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示

Image

Image

Image

开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。

Image

当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped)

请问这是什么原因,或者怎么解决

Originally created by @sunhaoyu-1990 on GitHub (Mar 25, 2025). Original GitHub issue: https://github.com/kvcache-ai/ktransformers/issues/973 Originally assigned to: @KMSorSMS on GitHub. 目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型 硬件配置如下: 显卡:3080Ti(12GB) * 8 内存:512GB 运行命令为 `ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full` 其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容 ![Image](https://github.com/user-attachments/assets/588d750d-4e14-4a22-9493-34d2f842b229) 刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示 ![Image](https://github.com/user-attachments/assets/e1a71a4a-911e-4449-9855-9f8a6fa575e9) ![Image](https://github.com/user-attachments/assets/cc2e3606-a5c0-4f59-8f7b-0e6300ab27a2) ![Image](https://github.com/user-attachments/assets/d9ab5259-4f94-41f7-8fd1-6c0e64870ff7) 开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。 ![Image](https://github.com/user-attachments/assets/a317b93a-4aa8-46ee-8e76-b94336bed3cf) 当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped) 请问这是什么原因,或者怎么解决
Author
Owner

@KMSorSMS commented on GitHub (Mar 25, 2025):

目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型 硬件配置如下: 显卡:3080Ti(12GB) * 8 内存:512GB

运行命令为 ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full 其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容

Image

刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示

Image

Image

Image

开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。

Image

当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped)

请问这是什么原因,或者怎么解决

应该是server端有历史记录信息,但是第二次沟通直接暴涨的情况应该是之前版本的遗留bug,请问您是用的就是v0.2版本吗?有试试更高版本的吗?

<!-- gh-comment-id:2750094332 --> @KMSorSMS commented on GitHub (Mar 25, 2025): > 目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型 硬件配置如下: 显卡:3080Ti(12GB) * 8 内存:512GB > > 运行命令为 `ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full` 其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容 > > ![Image](https://github.com/user-attachments/assets/588d750d-4e14-4a22-9493-34d2f842b229) > > 刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示 > > ![Image](https://github.com/user-attachments/assets/e1a71a4a-911e-4449-9855-9f8a6fa575e9) > > ![Image](https://github.com/user-attachments/assets/cc2e3606-a5c0-4f59-8f7b-0e6300ab27a2) > > ![Image](https://github.com/user-attachments/assets/d9ab5259-4f94-41f7-8fd1-6c0e64870ff7) > > 开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。 > > ![Image](https://github.com/user-attachments/assets/a317b93a-4aa8-46ee-8e76-b94336bed3cf) > > 当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped) > > 请问这是什么原因,或者怎么解决 应该是server端有历史记录信息,但是第二次沟通直接暴涨的情况应该是之前版本的遗留bug,请问您是用的就是v0.2版本吗?有试试更高版本的吗?
Author
Owner

@sunhaoyu-1990 commented on GitHub (Mar 25, 2025):

目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型 硬件配置如下: 显卡:3080Ti(12GB) * 8 内存:512GB
运行命令为 ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full 其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容
Image
刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示
Image
Image
Image
开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。
Image
当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped)
请问这是什么原因,或者怎么解决

应该是server端有历史记录信息,但是第二次沟通直接暴涨的情况应该是之前版本的遗留bug,请问您是用的就是v0.2版本吗?有试试更高版本的吗?

对,目前用的就是v0.2的版本,高版本还没有试,那具体哪一个版本解决了这个bug嘞

<!-- gh-comment-id:2750139500 --> @sunhaoyu-1990 commented on GitHub (Mar 25, 2025): > > 目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型 硬件配置如下: 显卡:3080Ti(12GB) * 8 内存:512GB > > 运行命令为 `ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full` 其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容 > > ![Image](https://github.com/user-attachments/assets/588d750d-4e14-4a22-9493-34d2f842b229) > > 刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示 > > ![Image](https://github.com/user-attachments/assets/e1a71a4a-911e-4449-9855-9f8a6fa575e9) > > ![Image](https://github.com/user-attachments/assets/cc2e3606-a5c0-4f59-8f7b-0e6300ab27a2) > > ![Image](https://github.com/user-attachments/assets/d9ab5259-4f94-41f7-8fd1-6c0e64870ff7) > > 开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。 > > ![Image](https://github.com/user-attachments/assets/a317b93a-4aa8-46ee-8e76-b94336bed3cf) > > 当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped) > > 请问这是什么原因,或者怎么解决 > > 应该是server端有历史记录信息,但是第二次沟通直接暴涨的情况应该是之前版本的遗留bug,请问您是用的就是v0.2版本吗?有试试更高版本的吗? 对,目前用的就是v0.2的版本,高版本还没有试,那具体哪一个版本解决了这个bug嘞
Author
Owner

@KMSorSMS commented on GitHub (Mar 25, 2025):

目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型 硬件配置如下: 显卡:3080Ti(12GB) * 8 内存:512GB
运行命令为 ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full 其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容
Image
刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示
Image
Image
Image
开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。
Image
当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped)
请问这是什么原因,或者怎么解决

应该是server端有历史记录信息,但是第二次沟通直接暴涨的情况应该是之前版本的遗留bug,请问您是用的就是v0.2版本吗?有试试更高版本的吗?

对,目前用的就是v0.2的版本,高版本还没有试,那具体哪一个版本解决了这个bug嘞

应该是在这里https://github.com/kvcache-ai/ktransformers/releases/tag/v0.2.3,
因为这里解决了显存大的开销,从而支持了长文本

<!-- gh-comment-id:2750287068 --> @KMSorSMS commented on GitHub (Mar 25, 2025): > > > 目前通过Ktransformer 0.2版本,已经运行起来了DeepSeek-R1-671B-Q4-K-M的模型 硬件配置如下: 显卡:3080Ti(12GB) * 8 内存:512GB > > > 运行命令为 `ktransformers --optimize_config_path /ktransformers/ktransformers/optimize/optimize_rules/DeepSeek-V3-Chat.yaml --model_path /mount/DeepSeek-R1-671B --gguf_path /mount/DeepSeek-R1-671B-GGUF --cpu_infer 56 --max_new_tokens 1024 --model_name DeepSeek-R1-full` 其中DeepSeek-V3-Chat.yaml配置文件内容进行了更改,权重分到了6个卡上,以下是其中一部分内容 > > > ![Image](https://github.com/user-attachments/assets/588d750d-4e14-4a22-9493-34d2f842b229) > > > 刚布上去时显存总占用16GB,内存占用381GB,推理速度为7t/s,如下图所示 > > > ![Image](https://github.com/user-attachments/assets/e1a71a4a-911e-4449-9855-9f8a6fa575e9) > > > ![Image](https://github.com/user-attachments/assets/cc2e3606-a5c0-4f59-8f7b-0e6300ab27a2) > > > ![Image](https://github.com/user-attachments/assets/d9ab5259-4f94-41f7-8fd1-6c0e64870ff7) > > > 开启接口后,通过open webUI进行调用。目前问题是第一次请求,显存占用没有什么变化,但是继续请求沟通问题之后,显存直接暴涨到50GB,基本上吧5张卡占满了。 > > > ![Image](https://github.com/user-attachments/assets/a317b93a-4aa8-46ee-8e76-b94336bed3cf) > > > 当再多次请求后,程序直接强退,并报错:Segmentation fault (core dumped) > > > 请问这是什么原因,或者怎么解决 > > > > > > 应该是server端有历史记录信息,但是第二次沟通直接暴涨的情况应该是之前版本的遗留bug,请问您是用的就是v0.2版本吗?有试试更高版本的吗? > > 对,目前用的就是v0.2的版本,高版本还没有试,那具体哪一个版本解决了这个bug嘞 应该是在这里https://github.com/kvcache-ai/ktransformers/releases/tag/v0.2.3, 因为这里解决了显存大的开销,从而支持了长文本
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#693
No description provided.