]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
llama_context: synchronize before reallocating output buffer (#17974)
authorJeff Bolz <redacted>
Sat, 13 Dec 2025 15:19:51 +0000 (09:19 -0600)
committerGitHub <redacted>
Sat, 13 Dec 2025 15:19:51 +0000 (09:19 -0600)
src/llama-context.cpp

index 2692297dcaba20116e49a601d4135c238ce4f596..9914b3276b7092f61b467f5346c2abc77ecc7c1a 100644 (file)
@@ -1318,6 +1318,7 @@ uint32_t llama_context::output_reserve(int32_t n_outputs) {
             // This doesn't happen often, but may be annoying in some cases (like the HellaSwag benchmark)
             LLAMA_LOG_INFO("%s: reallocating output buffer from size %.02f MiB to %.02f MiB\n", __func__, prev_size / 1024.0 / 1024.0, new_size / 1024.0 / 1024.0);
 #endif
+            synchronize();
             buf_output = nullptr;
             logits = nullptr;
             embd = nullptr;