[GH-ISSUE #133] 模型推理完成后怎么一直占用显存呢? #115

Open
opened 2026-10-26 21:03:43 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @chris-rong on GitHub (Mar 5, 2024).
Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-Coder/issues/133

加载模型只占用14G显存,为什么推理完成后显存一直飙到27G,且一直不释放。使用torch.cuda.empty_cache()也没用。

  1. 请问这是什么原因呢?
  2. 模型会一直保存最后一轮对话的内容吗?
  3. 怎么在每一轮对话后释放显存呢?
    使用的模型是deepseek-coder-6.7b-instruct
    image
Originally created by @chris-rong on GitHub (Mar 5, 2024). Original GitHub issue: https://github.com/deepseek-ai/DeepSeek-Coder/issues/133 加载模型只占用14G显存,为什么推理完成后显存一直飙到27G,且一直不释放。使用torch.cuda.empty_cache()也没用。 1. 请问这是什么原因呢? 2. 模型会一直保存最后一轮对话的内容吗? 3. 怎么在每一轮对话后释放显存呢? 使用的模型是deepseek-coder-6.7b-instruct ![image](https://github.com/deepseek-ai/DeepSeek-Coder/assets/85501211/7e70fe5c-df10-416e-848b-0f3fff6c4113)
Author
Owner

@guoday commented on GitHub (Mar 12, 2024):

这个跟模型无关,主要还是代码问题。不太确定你用的是什么代码

<!-- gh-comment-id:1989819856 --> @guoday commented on GitHub (Mar 12, 2024): 这个跟模型无关,主要还是代码问题。不太确定你用的是什么代码
Author
Owner

@Tendo33 commented on GitHub (May 21, 2024):

可能得原因有哪些呢?存中间结果的话为什么不能立即释放呢

<!-- gh-comment-id:2121597385 --> @Tendo33 commented on GitHub (May 21, 2024): 可能得原因有哪些呢?存中间结果的话为什么不能立即释放呢
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
deepseek-ai/DeepSeek-Coder#115
No description provided.