fix: detect allocation failures as out-of-memory errors (#6459)
The Llama.cpp backend can emit the phrase “failed to allocate” when it runs out of memory. Adding this check ensures such messages are correctly classified as out‑of‑memory errors, providing more accurate error handling CPU backends.
This commit is contained in:
parent
55edc7129e
commit
e80a865def
@ -48,6 +48,7 @@ impl LlamacppError {
|
||||
let lower_stderr = stderr.to_lowercase();
|
||||
// TODO: add others
|
||||
let is_out_of_memory = lower_stderr.contains("out of memory")
|
||||
|| lower_stderr.contains("failed to allocate")
|
||||
|| lower_stderr.contains("insufficient memory")
|
||||
|| lower_stderr.contains("erroroutofdevicememory") // vulkan specific
|
||||
|| lower_stderr.contains("kiogpucommandbuffercallbackerroroutofmemory") // Metal-specific error code
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user