Fix compute buffer sizing for 128+ token generation

Increase safety margin from 1.2x to 1.5x. The previous margin was too
tight for 128 generated tokens (deficit of ~1.4 MB on a 2.76 GB buffer).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
iafiscal1212andClaude Opus 4.6 committed 2026-03-19 14:34:14 +01:00
1 parent 00243730eb
commit 054a80afda
1 file changed
+1 -1
+1 -1
View File
@@ -154,7 +154,7 @@ bool diffuse_forward(diffuse_context * ctx,
size_t buf_size = per_layer * hp.n_layer; size_t buf_size = per_layer * hp.n_layer;
buf_size += (size_t)n_tokens * hp.n_vocab * sizeof(float) * 2; // logits buf_size += (size_t)n_tokens * hp.n_vocab * sizeof(float) * 2; // logits
buf_size += 256ull * 1024 * 1024; // graph nodes + execution plan overhead buf_size += 256ull * 1024 * 1024; // graph nodes + execution plan overhead
buf_size = (size_t)(buf_size * 1.2); // 20% safety margin buf_size = (size_t)(buf_size * 1.5); // 50% safety margin (handles 128+ tokens)
struct ggml_init_params cparams = { struct ggml_init_params cparams = {
/*.mem_size = */ buf_size, /*.mem_size = */ buf_size,