Can llama_state_*
save/restore be used across different n_ctx
? Which params must match?
#15569
Unanswered
PopFlamingo
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I’m would like to use the state APIs and wanted to clarify the compatibility contract.
APIs involved
llama_state_get_size(ctx)
,llama_state_get_data(ctx, buf, size)
(orllama_state_save_file(path, ctx, …)
)llama_state_set_data(ctx, buf, size)
(orllama_state_load_file(path, ctx, …)
)Questions
If a state was saved from a context created with
llama_context_params
wheren_ctx = A
, can it be restored into a context created withn_ctx = B
whereA != B
?B > A
,B < A
, or only whenB == A
?Beyond
n_ctx
, which fields inllama_context_params
must match forllama_state_set_data
to succeed and reproduce the same continuation?For example:
type_k
/type_v
(KV precision)n_seq_max
-related behaviorSizing on restore: is the intended pattern to pass the serialized blob’s byte length to
llama_state_set_data(ctx, buf, saved_size)
rather than callingllama_state_get_size(dst_ctx)
on the destination?Any authoritative guidance (or doc pointers) on which parameters must match for a valid restore would be super helpful. Thanks!
Beta Was this translation helpful? Give feedback.
All reactions