sampling : add debug log when backend sampler selects token

This commit adds a debug log statement in the llama_sampler_sample
to indicate when a backend sampler has selected a token for a given
index.

The modification helps in tracing the sampling process and understanding
the flow of control when backend samplers are used.
This commit is contained in:
Daniel Bevenius 2025-11-24 15:03:41 +01:00
parent 8eb9b4769d
commit 25f33806d3
No known key found for this signature in database
1 changed files with 1 additions and 0 deletions

View File

@ -446,6 +446,7 @@ llama_token llama_sampler_sample(struct llama_sampler * smpl, struct llama_conte
// If a backend sampler has already sampled a token, return it. // If a backend sampler has already sampled a token, return it.
if (sampled_token != LLAMA_TOKEN_NULL) { if (sampled_token != LLAMA_TOKEN_NULL) {
LLAMA_LOG_DEBUG("%s: Backend sampler selected token for idx %d. Skipping CPU samplers\n", __func__, idx);
return sampled_token; return sampled_token;
} }