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

common: free ctx_gguf when exiting llama_control_vector_load_one #7285

Closed
wants to merge 1 commit into from

Conversation

stevegrubb
Copy link
Contributor

ctx_gguf is initialized by gguf_init_from_file. It appears to be otherwise unused throughout the function. Someone more familar with the code might want to consider if gguf_init_from_file is necessary at all. But in the mean time, free the context when exiting so we don't leak memory.

ctx_gguf is initialized by gguf_init_from_file. It appears to be otherwise
unused throughout the function. Someone more familar with the code might
want to consider if gguf_init_from_file is necessary at all. But in the
mean time, free the context when exiting so we don't leak memory.
@slaren
Copy link
Collaborator

slaren commented May 14, 2024

There are more leaks in this function. #6289 has the fixes.

@mofosyne mofosyne added bugfix fixes an issue or bug Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix labels May 14, 2024
@mofosyne
Copy link
Collaborator

do we use valgrind here and should we?

@stevegrubb
Copy link
Contributor Author

This particular one was found by static analysis. The others I sent recently were found by ASAN. It's a lot faster than valgrind.

@mofosyne
Copy link
Collaborator

@stevegrubb looks like it might take a while for #6289 to be merged in.

You may want to check if any of the leaks fixes from there is directly related to this PR and move it over, then it would make sense to merge this in.

@stevegrubb
Copy link
Contributor Author

@mofosyne looks like the referenced patch contains the fix. My personal taste is not to mix features and bug fixes so that bug fixes can be cherry picked if needed. I'll close this.

@stevegrubb stevegrubb closed this May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix fixes an issue or bug Review Complexity : Low Trivial changes to code that most beginner devs (or those who want a break) can tackle. e.g. UI fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants