Skip to content

Commit 2d262ea

Browse files
committed
fix perplexity - it's memory needs dont grow, so we skip it
1 parent 424281a commit 2d262ea

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llama.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,7 @@ static bool llama_eval_internal(
632632
auto & mem_at_token1 = lctx.mem_at_token1;
633633

634634
// TODO: fix this hardcoded size
635-
static size_t buf_size = size_t(n_ctx)*1024*1024;
635+
static size_t buf_size = size_t(n_ctx)*size_t(N)*128*1024;
636636
static void * buf = malloc(buf_size);
637637

638638
const size_t C0 = mem_at_token0; // ~base

main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ int main(int argc, char ** argv) {
219219
// (fill in mem_at_token0 and mem_at_token1)
220220
// TODO: better way to do that
221221
// TODO(Green-Sky): move to internal and detect first time usage
222-
{
222+
if (!params.perplexity) { // perplexity does not grow over time
223223
// we make 2 evals, of batchsize to take 2 measurements, to determine base and growth
224224
std::vector<llama_token> tmp(params.n_batch*2, 2);
225225
tmp[0] = llama_token_bos();

0 commit comments

Comments
 (0)