Skip to content

Commit d3c0635

Browse files
committed
add assert in graph_reserve to ensure n_outputs >= 1
1 parent 4bf6181 commit d3c0635

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
@@ -1371,6 +1371,7 @@ llm_graph_result * llama_context::get_gf_res_reserve() const {
13711371

13721372
ggml_cgraph * llama_context::graph_reserve(uint32_t n_tokens, uint32_t n_seqs, uint32_t n_outputs, const llama_memory_context_i * mctx, bool split_only) {
13731373
LLAMA_LOG_DEBUG("%s: reserving a graph for ubatch with n_tokens = %4u, n_seqs = %2u, n_outputs = %4u\n", __func__, n_tokens, n_seqs, n_outputs);
1374+
GGML_ASSERT(n_outputs >= 1);
13741375

13751376
if (n_tokens % n_seqs != 0) {
13761377
n_tokens = ((n_tokens + (n_seqs - 1)) / n_seqs) * n_seqs; // round to next multiple of n_seqs

0 commit comments

Comments
 (0)