From 3ac6e1e332ca4ea7cfe6114f17f5997e09aa1467 Mon Sep 17 00:00:00 2001 From: Petr Vasilev Date: Wed, 2 Sep 2026 01:10:07 +0300 Subject: [PATCH] memory : return an error instead of aborting on multi-range on-device state save state_write aborted the process when an on-device sequence state spans more than one cell range. Throw instead; state_seq_get_size/get_data already catch and return 0. --- src/llama-memory-recurrent.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/llama-memory-recurrent.cpp b/src/llama-memory-recurrent.cpp index 57919accf09..0110491a045 100644 --- a/src/llama-memory-recurrent.cpp +++ b/src/llama-memory-recurrent.cpp @@ -822,7 +822,8 @@ void llama_memory_recurrent::state_write(llama_io_write_i & io, llama_seq_id seq } if ((flags & LLAMA_STATE_SEQ_FLAGS_ON_DEVICE) && cell_ranges.size() > 1) { - GGML_ABORT("cannot save/load multiple ranges of cells to/from device memory\n"); + // throw instead of aborting: state_seq_get_size/get_data catch this and return 0 + throw std::runtime_error("cannot save/load multiple ranges of cells to/from device memory"); } // DEBUG CHECK: Sum of cell counts in ranges should equal the total cell count