mirror of
https://github.com/Lizonghang/prima.cpp.git
synced 2025-09-06 21:29:02 +00:00
Fix compilation warnings and uninitialized variable in perplexity test
This commit is contained in:
parent
2123879cfe
commit
4b823775ec
2 changed files with 14 additions and 13 deletions
|
@ -691,23 +691,24 @@ static results_perplexity perplexity(llama_context * ctx, const gpt_params & par
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (my_rank == 0) {
|
||||||
|
// Required batch info: Operation scale, KV cache location, Logits calculation location
|
||||||
|
meta.n_ctx = n_ctx;
|
||||||
|
meta.n_tokens = batch.n_tokens;
|
||||||
|
meta.pos = batch.pos;
|
||||||
|
meta.logits = batch.logits;
|
||||||
|
meta.all_pos_0 = batch.all_pos_0;
|
||||||
|
meta.all_pos_1 = batch.all_pos_1;
|
||||||
|
meta.n_outputs = n_outputs;
|
||||||
|
meta.chunk_start_pos = start;
|
||||||
|
}
|
||||||
|
|
||||||
// other ranks need to know batch info
|
// other ranks need to know batch info
|
||||||
{
|
{
|
||||||
if (n_world > 1) {
|
if (n_world > 1) {
|
||||||
meta.n_ctx = n_ctx;
|
meta.n_ctx = n_ctx;
|
||||||
|
|
||||||
if (my_rank == 0) {
|
if (my_rank == 0) {
|
||||||
// Required batch info: Operation scale, KV cache location, Logits calculation location
|
|
||||||
meta.n_tokens = batch.n_tokens;
|
|
||||||
meta.pos = batch.pos;
|
|
||||||
meta.logits = batch.logits;
|
|
||||||
|
|
||||||
meta.all_pos_0 = batch.all_pos_0;
|
|
||||||
meta.all_pos_1 = batch.all_pos_1;
|
|
||||||
|
|
||||||
meta.n_outputs = n_outputs;
|
|
||||||
meta.chunk_start_pos = start;
|
|
||||||
|
|
||||||
llama_send_meta(ctx, &meta);
|
llama_send_meta(ctx, &meta);
|
||||||
} else {
|
} else {
|
||||||
if (llama_recv_meta(ctx, &meta) == -1) {
|
if (llama_recv_meta(ctx, &meta) == -1) {
|
||||||
|
|
|
@ -18316,8 +18316,8 @@ static int llama_decode_internal(
|
||||||
/* logits_all */ n_outputs == n_tokens_all);
|
/* logits_all */ n_outputs == n_tokens_all);
|
||||||
|
|
||||||
// reserve output buffer
|
// reserve output buffer
|
||||||
if (my_rank == 0 && llama_output_reserve(lctx, n_outputs) < n_outputs) {
|
if (my_rank == 0 && llama_output_reserve(lctx, n_outputs) < (size_t)n_outputs) {
|
||||||
LLAMA_LOG_ERROR("%s: could not reserve space for batch with %u outputs\n", __func__, n_outputs);
|
LLAMA_LOG_ERROR("%s: could not reserve space for batch with %llu outputs\n", __func__, n_outputs);
|
||||||
return -2;
|
return -2;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue