Skip to content

fixed off by one error when context shifting in main.cpp example#6921

Merged
ggerganov merged 1 commit intoggml-org:masterfrom
l3utterfly:off-by-one-ctx-main
May 1, 2024
Merged

fixed off by one error when context shifting in main.cpp example#6921
ggerganov merged 1 commit intoggml-org:masterfrom
l3utterfly:off-by-one-ctx-main

Conversation

@l3utterfly
Copy link
Copy Markdown
Contributor

Is this an error? During my tests, eval throws an error below if n_past + embd.size() == nctx, so we need to start shifting one token earlier

@cebtenzzre cebtenzzre requested a review from ggerganov May 1, 2024 15:21
Copy link
Copy Markdown
Member

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, seems like an error

@ggerganov ggerganov merged commit 8d608a8 into ggml-org:master May 1, 2024
@HanClinto
Copy link
Copy Markdown
Contributor

As they say, "There are only two hard problems in computer science."

  • Naming things
  • Cache invalidation
  • Off-by-one errors

@l3utterfly l3utterfly deleted the off-by-one-ctx-main branch May 2, 2024 13:41
scottmudge pushed a commit to scottmudge/koboldcpp that referenced this pull request May 8, 2024
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants