summaryrefslogtreecommitdiff
path: root/llama.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llama.cpp')
-rw-r--r--llama.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/llama.cpp b/llama.cpp
index 4cd0f16e..391c956e 100644
--- a/llama.cpp
+++ b/llama.cpp
@@ -8133,6 +8133,11 @@ void llama_sample_softmax(struct llama_context * ctx, llama_token_data_array * c
}
void llama_sample_top_k(struct llama_context * ctx, llama_token_data_array * candidates, int32_t k, size_t min_keep) {
+ // TODO: move bucket sort to separate function so that top_p/tail_free/typical/softmax first is equally fast
+ // if (k >= (int32_t)candidates->size) {
+ // return;
+ // }
+
const int64_t t_start_sample_us = ggml_time_us();
k = std::max(k, (int) min_keep);