MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / common_batch_add

Function common_batch_add

common/common.cpp:1548–1565  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1546}
1547
1548void common_batch_add(
1549 struct llama_batch & batch,
1550 llama_token id,
1551 llama_pos pos,
1552 const std::vector<llama_seq_id> & seq_ids,
1553 bool logits) {
1554 GGML_ASSERT(batch.seq_id[batch.n_tokens] && "llama_batch size exceeded");
1555
1556 batch.token [batch.n_tokens] = id;
1557 batch.pos [batch.n_tokens] = pos;
1558 batch.n_seq_id[batch.n_tokens] = seq_ids.size();
1559 for (size_t i = 0; i < seq_ids.size(); ++i) {
1560 batch.seq_id[batch.n_tokens][i] = seq_ids[i];
1561 }
1562 batch.logits [batch.n_tokens] = logits;
1563
1564 batch.n_tokens++;
1565}
1566
1567//
1568// Vocab utils

Callers 15

mainFunction · 0.85
generate_responseFunction · 0.85
mainFunction · 0.85
perplexity_v2Function · 0.85
hellaswag_scoreFunction · 0.85
winogrande_scoreFunction · 0.85
multiple_choice_scoreFunction · 0.85
kl_divergenceFunction · 0.85
update_batchMethod · 0.85
update_slotsMethod · 0.85
compute_imatrixFunction · 0.85
get_logitsFunction · 0.85

Calls 1

sizeMethod · 0.45

Tested by 9

decodeMethod · 0.68
decode_tokenMethod · 0.68
decode_tokensMethod · 0.68
test_backend_max_outputsFunction · 0.68
mainFunction · 0.68
get_logitsFunction · 0.68
draftMethod · 0.68
mainFunction · 0.68
mainFunction · 0.68