whisper.cpp/ggml
AlexCherrypi 4d3ed9d8c9 metal : wind down leftover residency sets at teardown instead of aborting
ggml_metal_rsets_free() did GGML_ASSERT([rsets->data count] == 0) and so called
abort() when the Metal device is torn down (a C++ static destructor at process
exit) while residency sets are still registered. On macOS 15+ this crashes the
app on every quit: a residency set is removed from the collection only by
ggml_metal_buffer_free(), so an app that exits without freeing every buffer
(letting the OS reclaim the model on quit) leaves sets registered.

The device does not own the buffers and cannot free them from its destructor, so
make teardown defensive instead: stop the keep-alive heartbeat, then wind down
residency on any leftover sets (endResidency + removeAllAllocations, mirroring
ggml_metal_buffer_rset_free but without -release, since each set is still owned
by its not-yet-freed buffer) before releasing the collection. The backing
buffers are reclaimed by the OS as the process exits. No behavior change when all
buffers were freed (the array is empty).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-09 17:41:29 +02:00
..
cmake ggml : Parallelize quant LUT init (llama/23595) 2026-05-25 12:26:07 +03:00
include TP: quantized KV cache support (llama/23792) 2026-06-08 14:36:36 +03:00
src metal : wind down leftover residency sets at teardown instead of aborting 2026-06-09 17:41:29 +02:00
.gitignore whisper : reorganize source code + improve CMake (#2256) 2024-06-26 19:34:09 +03:00
CMakeLists.txt ggml : bump version to 0.14.0 (ggml/1533) 2026-06-08 14:36:36 +03:00