]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
metal : use autoreleasepool to avoid memory leaks (#5437)
authorIan Bull <redacted>
Sat, 10 Feb 2024 10:53:28 +0000 (02:53 -0800)
committerGitHub <redacted>
Sat, 10 Feb 2024 10:53:28 +0000 (12:53 +0200)
commitf026f8120f97090d34a52b3dc023c82e0ede3f7d
treeb451139bb3d80868b5f5d3b32aba1cefcf499f39
parentcd9aea63b577a83def84dbd6dcd90a6fa02af745
metal : use autoreleasepool to avoid memory leaks (#5437)

There appears to be a known memory leak when using the
`MLTCommandBuffer`. It is suggested to use `@autoreleasepool` in
[1,2]

[1] https://developer.apple.com/forums/thread/662721
[2] https://forums.developer.apple.com/forums/thread/120931

This change-set wraps the `ggml_metal_graph_compute` in a
`@autoreleasepool`.

This commit addresses https://github.com/ggerganov/llama.cpp/issues/5436
ggml-metal.m