@@ -1428,7 +1428,7 @@ struct sql_printer : public printer {
1428
1428
}
1429
1429
};
1430
1430
1431
- static void test_prompt (llama_context * ctx, int n_prompt, int n_past, int n_batch, int n_threads) {
1431
+ static void test_prompt (llama_context * ctx, int n_prompt, int n_batch, int n_threads) {
1432
1432
llama_set_n_threads (ctx, n_threads, n_threads);
1433
1433
1434
1434
const llama_model * model = llama_get_model (ctx);
@@ -1444,14 +1444,14 @@ static void test_prompt(llama_context * ctx, int n_prompt, int n_past, int n_bat
1444
1444
for (int i = 1 ; i < n_tokens; i++) {
1445
1445
tokens[i] = std::rand () % n_vocab;
1446
1446
}
1447
- llama_decode (ctx, llama_batch_get_one (tokens.data (), n_tokens, n_past + n_processed, 0 ));
1447
+ llama_decode (ctx, llama_batch_get_one (tokens.data (), n_tokens));
1448
1448
n_processed += n_tokens;
1449
1449
}
1450
1450
1451
1451
llama_synchronize (ctx);
1452
1452
}
1453
1453
1454
- static void test_gen (llama_context * ctx, int n_gen, int n_past, int n_threads) {
1454
+ static void test_gen (llama_context * ctx, int n_gen, int n_threads) {
1455
1455
llama_set_n_threads (ctx, n_threads, n_threads);
1456
1456
1457
1457
const llama_model * model = llama_get_model (ctx);
@@ -1460,7 +1460,7 @@ static void test_gen(llama_context * ctx, int n_gen, int n_past, int n_threads)
1460
1460
llama_token token = llama_add_bos_token (model) ? llama_token_bos (model) : std::rand () % n_vocab;
1461
1461
1462
1462
for (int i = 0 ; i < n_gen; i++) {
1463
- llama_decode (ctx, llama_batch_get_one (&token, 1 , n_past + i, 0 ));
1463
+ llama_decode (ctx, llama_batch_get_one (&token, 1 ));
1464
1464
llama_synchronize (ctx);
1465
1465
token = std::rand () % n_vocab;
1466
1466
}
@@ -1596,13 +1596,13 @@ int main(int argc, char ** argv) {
1596
1596
fprintf (stderr, " llama-bench: benchmark %d/%ld: warmup prompt run\n " , params_idx, params_count);
1597
1597
}
1598
1598
// test_prompt(ctx, std::min(t.n_batch, std::min(t.n_prompt, 32)), 0, t.n_batch, t.n_threads);
1599
- test_prompt (ctx, t.n_prompt , 0 , t.n_batch , t.n_threads );
1599
+ test_prompt (ctx, t.n_prompt , t.n_batch , t.n_threads );
1600
1600
}
1601
1601
if (t.n_gen > 0 ) {
1602
1602
if (params.progress ) {
1603
1603
fprintf (stderr, " llama-bench: benchmark %d/%ld: warmup generation run\n " , params_idx, params_count);
1604
1604
}
1605
- test_gen (ctx, 1 , 0 , t.n_threads );
1605
+ test_gen (ctx, 1 , t.n_threads );
1606
1606
}
1607
1607
1608
1608
for (int i = 0 ; i < params.reps ; i++) {
@@ -1614,13 +1614,13 @@ int main(int argc, char ** argv) {
1614
1614
if (params.progress ) {
1615
1615
fprintf (stderr, " llama-bench: benchmark %d/%ld: prompt run %d/%d\n " , params_idx, params_count, i + 1 , params.reps );
1616
1616
}
1617
- test_prompt (ctx, t.n_prompt , 0 , t.n_batch , t.n_threads );
1617
+ test_prompt (ctx, t.n_prompt , t.n_batch , t.n_threads );
1618
1618
}
1619
1619
if (t.n_gen > 0 ) {
1620
1620
if (params.progress ) {
1621
1621
fprintf (stderr, " llama-bench: benchmark %d/%ld: generation run %d/%d\n " , params_idx, params_count, i + 1 , params.reps );
1622
1622
}
1623
- test_gen (ctx, t.n_gen , t.n_prompt , t. n_threads );
1623
+ test_gen (ctx, t.n_gen , t.n_threads );
1624
1624
}
1625
1625
1626
1626
uint64_t t_ns = get_time_ns () - t_start;
0 commit comments