summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGeorgi Gerganov <ggerganov@gmail.com>2024-03-11 17:49:47 +0200
committerGitHub <noreply@github.com>2024-03-11 17:49:47 +0200
commit05b06210c954491cf0f12034b0a62bd4d69ce78b (patch)
tree8cce0e429b8591dcbabd2d1e1ea6451a6a2f6894 /examples
parent83796e62bc9f6caae6228168e359890f51e60fee (diff)
llama : more consistent names of count variables (#5994)
* llama : more consistent names of count variables ggml-ci * llama : n_parallel -> n_seq_max * common : fix param name * examples : fix param name
Diffstat (limited to 'examples')
-rw-r--r--examples/batched-bench/batched-bench.cpp2
-rw-r--r--examples/batched/batched.cpp2
-rw-r--r--examples/main/main.cpp1
-rw-r--r--examples/perplexity/perplexity.cpp6
4 files changed, 6 insertions, 5 deletions
diff --git a/examples/batched-bench/batched-bench.cpp b/examples/batched-bench/batched-bench.cpp
index dff6c68e..22bc93bc 100644
--- a/examples/batched-bench/batched-bench.cpp
+++ b/examples/batched-bench/batched-bench.cpp
@@ -106,7 +106,7 @@ int main(int argc, char ** argv) {
ctx_params.n_threads_batch = params.n_threads_batch == -1 ? params.n_threads : params.n_threads_batch;
// ensure enough sequences are available
- ctx_params.n_parallel = *std::max_element(n_pl.begin(), n_pl.end());
+ ctx_params.n_seq_max = *std::max_element(n_pl.begin(), n_pl.end());
llama_context * ctx = llama_new_context_with_model(model, ctx_params);
diff --git a/examples/batched/batched.cpp b/examples/batched/batched.cpp
index dde4d5a0..ee1f8f1b 100644
--- a/examples/batched/batched.cpp
+++ b/examples/batched/batched.cpp
@@ -80,7 +80,7 @@ int main(int argc, char ** argv) {
ctx_params.seed = 1234;
ctx_params.n_ctx = n_kv_req;
ctx_params.n_batch = std::max(n_len, n_parallel);
- ctx_params.n_parallel = n_parallel;
+ ctx_params.n_seq_max = n_parallel;
ctx_params.n_threads = params.n_threads;
ctx_params.n_threads_batch = params.n_threads_batch == -1 ? params.n_threads : params.n_threads_batch;
diff --git a/examples/main/main.cpp b/examples/main/main.cpp
index 47059e58..e2d07a63 100644
--- a/examples/main/main.cpp
+++ b/examples/main/main.cpp
@@ -878,6 +878,7 @@ int main(int argc, char ** argv) {
const auto line_pfx = ::llama_tokenize(ctx, params.input_prefix, false, true);
const auto line_inp = ::llama_tokenize(ctx, buffer, false, false);
const auto line_sfx = ::llama_tokenize(ctx, params.input_suffix, false, true);
+
LOG("input tokens: %s\n", LOG_TOKENS_TOSTR_PRETTY(ctx, line_inp).c_str());
embd_inp.insert(embd_inp.end(), line_pfx.begin(), line_pfx.end());
diff --git a/examples/perplexity/perplexity.cpp b/examples/perplexity/perplexity.cpp
index 293eb52c..fdfc8f5d 100644
--- a/examples/perplexity/perplexity.cpp
+++ b/examples/perplexity/perplexity.cpp
@@ -841,7 +841,7 @@ static void hellaswag_score(llama_context * ctx, const gpt_params & params) {
const int n_batch = params.n_batch;
const int max_tasks_per_batch = 32;
- const int max_seq = std::min(4*max_tasks_per_batch, (int) llama_n_max_seq(ctx));
+ const int max_seq = std::min(4*max_tasks_per_batch, (int) llama_n_seq_max(ctx));
llama_batch batch = llama_batch_init(n_ctx, 0, max_seq);
@@ -1118,7 +1118,7 @@ static void winogrande_score(llama_context * ctx, const gpt_params & params) {
const int n_batch = params.n_batch;
const int max_tasks_per_batch = 128;
- const int max_seq = std::min(2*max_tasks_per_batch, (int) llama_n_max_seq(ctx));
+ const int max_seq = std::min(2*max_tasks_per_batch, (int) llama_n_seq_max(ctx));
llama_batch batch = llama_batch_init(n_ctx, 0, max_seq);
@@ -1470,7 +1470,7 @@ static void multiple_choice_score(llama_context * ctx, const gpt_params & params
const int n_batch = params.n_batch;
const int max_tasks_per_batch = 32;
- const int max_seq = std::min(4*max_tasks_per_batch, (int) llama_n_max_seq(ctx));
+ const int max_seq = std::min(4*max_tasks_per_batch, (int) llama_n_seq_max(ctx));
llama_batch batch = llama_batch_init(n_ctx, 0, max_seq);