llama : fix device state save/load (#22805)

This commit is contained in:
Georgi Gerganov
2026-05-07 21:43:40 +03:00
committed by GitHub
parent ceb7e14b96
commit e43431b381
3 changed files with 78 additions and 24 deletions
+4
View File
@@ -726,6 +726,10 @@ void llama_memory_recurrent::state_write(llama_io_write_i & io, llama_seq_id seq
cell_ranges.emplace_back(cell_range_begin, size);
}
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");
}
// DEBUG CHECK: Sum of cell counts in ranges should equal the total cell count
uint32_t cell_count_check = 0;
for (const auto & range : cell_ranges) {