10000 dynamic estimate of required memory usage by Green-Sky · Pull Request #438 · ggml-org/llama.cpp · GitHub
[go: up one dir, main page]

Skip to content

dynamic estimate of required memory usage #438

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix perplexity - it's memory needs dont grow, so we skip it
  • Loading branch information
Green-Sky committed Mar 23, 2023
commit 2d262ea9f0cbfba6d525b94a05b51cd6dfc55464
2 changes: 1 addition & 1 deletion llama.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,7 @@ static bool llama_eval_internal(
auto & mem_at_token1 = lctx.mem_at_token1;

// TODO: fix this hardcoded size
static size_t buf_size = size_t(n_ctx)*1024*1024;
static size_t buf_size = size_t(n_ctx)*size_t(N)*128*1024;
static void * buf = malloc(buf_size);

const size_t C0 = mem_at_token0; // ~base
Expand Down
2 changes: 1 addition & 1 deletion main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ int main(int argc, char ** argv) {
// (fill in mem_at_token0 and mem_at_token1)
// TODO: better way to do that
// TODO(Green-Sky): move to internal and detect first time usage
{
if (!params.perplexity) { // perplexity does not grow over time
// we make 2 evals, of batchsize to take 2 measurements, to determine base and growth
std::vector<llama_token> tmp(params.n_batch*2, 2);
tmp[0] = llama_token_bos();
Expand Down
0