Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cuda增加,直到溢出报错 #789

Open
sevenandseven opened this issue May 15, 2024 · 6 comments
Open

cuda增加,直到溢出报错 #789

sevenandseven opened this issue May 15, 2024 · 6 comments

Comments

@sevenandseven
Copy link

Hello, I am using the officially provided method of loading the reranker to perform similarity calculations. During the calculation process, I found that after the cache stabilizes for a period of time, it gradually increases until there is not enough video memory left.
How can I solve this problem?
I tried using (torch.cuda.empty_cache())this method, but it didn’t work very well, and there was still not enough video memory.

@staoxiao
Copy link
Collaborator

@sevenandseven , which reranker do you use?

@sevenandseven
Copy link
Author

@sevenandseven , which reranker do you use?

bge-reranker-large、bge-reranker-base、bge-reranker-v2-m3、bge-reranker-v2-gemma、bge-reranker-v2-minicpm-layerwise。
The above models all exhibit this behavior.

@staoxiao
Copy link
Collaborator

You can reduce the batch size and max_length to reduce memory cost.

@sevenandseven
Copy link
Author

You can reduce the batch size and max_length to reduce memory cost.

I encountered this situation while inference, without the above parameters.

@staoxiao
Copy link
Collaborator

@sevenandseven , you can pass batch size and max_length to compute_score(batch size=?, max_length=?) function: https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/flag_reranker.py#L194

@sevenandseven
Copy link
Author

@sevenandseven , you can pass batch size and max_length to compute_score(batch size=?, max_length=?) function: https://github.com/FlagOpen/FlagEmbedding/blob/master/FlagEmbedding/flag_reranker.py#L194

ok,thanks。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants