abetlen / abetlen/llama-cpp-python

MiniCPM-V 2.6 memory leak occurred !!!

オープン
#1,886 コメント 5 件 リアクション 1 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
10.6k
フォーク
1.4k
PR マージ指標
PR 指標を取得中

説明

# Prerequisites

Please answer the following questions for yourself before submitting an issue.

- [ ] I am running the latest code. Development is very rapid so there are no tagged versions as of now.
- [ ✅] I carefully followed the [README.md](https://github.com/abetlen/llama-cpp-python/blob/main/README.md).
- [ ✅] I [searched using keywords relevant to my issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/filtering-and-searching-issues-and-pull-requests) to make sure that I am creating a new issue that is not already open (or closed).
- [ ✅] I reviewed the [Discussions](https://github.com/abetlen/llama-cpp-python/discussions), and have a new bug or useful enhancement to share.

# Expected Behavior
MiniCPM-V 2.6 memory leak ?

# Current Behavior
I am testing [minicpm-v-2.6](https://huggingface.co/openbmb/MiniCPM-V-2_6-gguf) ,here is part of my test code:
![37a5d00121d9619b47c64c17b35131b](https://github.com/user-attachments/assets/2163bd7a-962f-41e4-8ec5-773fa6a7026d)

when i run code ,it adds 10MB per inference,i use memory_profiler find in https://github.com/abetlen/llama-cpp-python/blob/2bc1d97c9672320828e70dc8293d5f8754682109/llama_cpp/llama_chat_format.py#L2839

![a6879c9732cf5cd576859e126b66faf](https://github.com/user-attachments/assets/070b8d5c-9471-4aa5-9f3d-4272c271ad06)

I thought at first that this variable "embed" wasn't being released,I added the code manual release on line 2856,but the program reported an error.
then I replace "embed" with "self._last_image_embed",Memory leaks continue to occur.
# Environment and Context

Please provide detailed information about your computer setup. This is important in case the issue is not reproducible except for under certain specific conditions.then

Example environment info:
```

Python 3.10.10
ubuntu 18.04
cudatoolkit 12.1
llama-cpp-python 0.2.90

```

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。