Skip to content

server : fix ctx checkpoint restore logic#19924

Merged
ggerganov merged 1 commit intomasterfrom
gg/server-ctx-chkpt-fix
Feb 26, 2026
Merged

server : fix ctx checkpoint restore logic#19924
ggerganov merged 1 commit intomasterfrom
gg/server-ctx-chkpt-fix

Conversation

@ggerganov
Copy link
Copy Markdown
Member

cont #19849
fix #19901

Prevent n_past from exceeding the available tokens in the checkpoint.

@yshui
Copy link
Copy Markdown

yshui commented Feb 26, 2026

this feels wrong? pos_next is one past the last token, but size_up_to_pos treats max_pos as inclusive.

@ggerganov
Copy link
Copy Markdown
Member Author

ggerganov commented Feb 26, 2026

@yshui Can you clarify a bit more? I think the logic is correct, though indeed it's a bit convoluted and I could have miss something.

@yshui
Copy link
Copy Markdown

yshui commented Feb 26, 2026

in that case, i must've misunderstood something. please ignore me.

@ggerganov ggerganov merged commit 01cd448 into master Feb 26, 2026
77 of 78 checks passed
@ggerganov ggerganov deleted the gg/server-ctx-chkpt-fix branch February 26, 2026 16:20
bartowski1182 pushed a commit to bartowski1182/llama.cpp that referenced this pull request Mar 2, 2026
ArberSephirotheca pushed a commit to ArberSephirotheca/llama.cpp that referenced this pull request Mar 3, 2026
Ethan-a2 pushed a commit to Ethan-a2/llama.cpp that referenced this pull request Mar 20, 2026
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
rsenthilkumar6 pushed a commit to rsenthilkumar6/llama.cpp that referenced this pull request May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Misc. bug: PR19849 causes inconsistent sequence positions

3 participants