Skip to content

Commit dcab343

Browse files
committed
use 1 seq for kl_divergence
1 parent 5cf23d1 commit dcab343

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

examples/perplexity/perplexity.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1991,8 +1991,12 @@ int main(int argc, char ** argv) {
19911991
params.n_batch = std::min(params.n_batch, n_kv);
19921992
} else {
19931993
params.n_batch = std::min(params.n_batch, params.n_ctx);
1994-
// ensure there's at least enough seq_ids for HellaSwag
1995-
params.n_parallel = std::max(4, params.n_parallel);
1994+
if (params.kl_divergence) {
1995+
params.n_parallel = 1;
1996+
} else {
1997+
// ensure there's at least enough seq_ids for HellaSwag
1998+
params.n_parallel = std::max(4, params.n_parallel);
1999+
}
19962000
}
19972001

19982002
if (params.ppl_stride > 0) {

0 commit comments

Comments
 (0)