Skip to content

Commit 5266379

Browse files
authored
llama_context: synchronize before reallocating output buffer (#17974)
1 parent 4d5ae24 commit 5266379

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/llama-context.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1318,6 +1318,7 @@ uint32_t llama_context::output_reserve(int32_t n_outputs) {
13181318
// This doesn't happen often, but may be annoying in some cases (like the HellaSwag benchmark)
13191319
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);
13201320
#endif
1321+
synchronize();
13211322
buf_output = nullptr;
13221323
logits = nullptr;
13231324
embd = nullptr;

0 commit comments

Comments
 (0)