From: ddh0 Date: Mon, 15 Sep 2025 07:54:57 +0000 (-0500) Subject: fix KLD percentile output (#15999) X-Git-Tag: upstream/0.0.6527~51 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=a68f31edd71cc39141113f05f7133a3e9ece8c61;p=pkg%2Fggml%2Fsources%2Fllama.cpp fix KLD percentile output (#15999) In `llama-perplexity`, when using `--kl-divergence`, the KL divergence statistics output mistakenly displays the 99th percentile twice. This change fixes that and correctly displays the 90th percentile as originally intended (presumably). --- diff --git a/tools/perplexity/perplexity.cpp b/tools/perplexity/perplexity.cpp index 80cbb095..c9fd082d 100644 --- a/tools/perplexity/perplexity.cpp +++ b/tools/perplexity/perplexity.cpp @@ -1931,7 +1931,7 @@ static void kl_divergence(llama_context * ctx, const common_params & params) { LOG("Maximum KLD: %10.6f\n", kld_values.back()); LOG("99.9%% KLD: %10.6f\n", percentile(kld_values, 0.999f)); LOG("99.0%% KLD: %10.6f\n", percentile(kld_values, 0.990f)); - LOG("99.0%% KLD: %10.6f\n", percentile(kld_values, 0.990f)); + LOG("90.0%% KLD: %10.6f\n", percentile(kld_values, 0.900f)); LOG("Median KLD: %10.6f\n", kld_median); LOG("10.0%% KLD: %10.6f\n", percentile(kld_values, 0.100f)); LOG(" 5.0%% KLD: %10.6f\n", percentile(kld_values, 0.050f));