Skip to content

Commit 978a720

Browse files
kmbandyclaude
andcommitted
fix(wp): disable weight paging in the memory-fit dry-run
common_get_device_memory_data's no_alloc dry-run measures device buffer sizes; with weight paging enabled the paged tensors get a null buffer and ggml_gallocr asserts (buffer_id >= 0) during graph_reserve, so any paged model crashed on load through the auto-fit path (hit on DeepSeek V4 Flash). Clear weight_paging_enabled for the dry-run alongside mmap/mlock/direct_io. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014ZRfPpL8XFzk1hep9MMg9P
1 parent f255637 commit 978a720

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

common/fit.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ static std::vector<llama_device_memory_data> common_get_device_memory_data_impl(
5757
mparams_copy.use_mmap = false;
5858
mparams_copy.use_mlock = false;
5959
mparams_copy.use_direct_io = false;
60+
// The memory-fit dry-run only measures device buffer sizes; it must not
61+
// enable weight paging. With paging on, paged tensors get a null buffer and
62+
// the graph allocator asserts (ggml-alloc.c: buffer_id >= 0) during the
63+
// no_alloc reserve. Measure the model as non-paged here.
64+
mparams_copy.weight_paging_enabled = false;
6065

6166
llama_model * model = llama_model_load_from_file(path_model, mparams_copy);
6267
if (model == nullptr) {

0 commit comments

Comments
 (0)