Skip to content

Commit e2b3294

Browse files
committed
context : fix enc-dec state save/load
ggml-ci
1 parent e5bc5f8 commit e2b3294

File tree

1 file changed

+11
-37
lines changed

1 file changed

+11
-37
lines changed

src/llama-context.cpp

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -4981,63 +4981,46 @@ void llama_context_enc_dec::perf_reset() {
49814981

49824982
//
49834983
// state save/load
4984+
// TODO: for now dump just the decoder state, in the future dump both
49844985
//
49854986

49864987
size_t llama_context_enc_dec::state_get_size() {
4987-
GGML_ABORT("TODO: implement");
4988+
return ctx_dec->state_get_size();
49884989
}
49894990

49904991
size_t llama_context_enc_dec::state_get_data( uint8_t * dst, size_t size) {
4991-
GGML_UNUSED(dst);
4992-
GGML_UNUSED(size);
4993-
GGML_ABORT("TODO: implement");
4992+
return ctx_dec->state_get_data(dst, size);
49944993
}
49954994

49964995
size_t llama_context_enc_dec::state_set_data(const uint8_t * src, size_t size) {
4997-
GGML_UNUSED(src);
4998-
GGML_UNUSED(size);
4999-
GGML_ABORT("TODO: implement");
4996+
return ctx_dec->state_set_data(src, size);
50004997
}
50014998

50024999
size_t llama_context_enc_dec::state_seq_get_size(llama_seq_id seq_id) {
5003-
GGML_UNUSED(seq_id);
5004-
GGML_ABORT("TODO: implement");
5000+
return ctx_dec->state_seq_get_size(seq_id);
50055001
}
50065002

50075003
size_t llama_context_enc_dec::state_seq_get_data(llama_seq_id seq_id, uint8_t * dst, size_t size) {
5008-
GGML_UNUSED(seq_id);
5009-
GGML_UNUSED(dst);
5010-
GGML_UNUSED(size);
5011-
GGML_ABORT("TODO: implement");
5004+
return ctx_dec->state_seq_get_data(seq_id, dst, size);
50125005
}
50135006

50145007
size_t llama_context_enc_dec::state_seq_set_data(llama_seq_id seq_id, const uint8_t * src, size_t size) {
5015-
GGML_UNUSED(seq_id);
5016-
GGML_UNUSED(src);
5017-
GGML_UNUSED(size);
5018-
GGML_ABORT("TODO: implement");
5008+
return ctx_dec->state_seq_set_data(seq_id, src, size);
50195009
}
50205010

50215011
bool llama_context_enc_dec::state_load_file(
50225012
const char * filepath,
50235013
llama_token * tokens_out,
50245014
size_t n_token_capacity,
50255015
size_t * n_token_count_out) {
5026-
GGML_UNUSED(filepath);
5027-
GGML_UNUSED(tokens_out);
5028-
GGML_UNUSED(n_token_capacity);
5029-
GGML_UNUSED(n_token_count_out);
5030-
GGML_ABORT("TODO: implement");
5016+
return ctx_dec->state_load_file(filepath, tokens_out, n_token_capacity, n_token_count_out);
50315017
}
50325018

50335019
bool llama_context_enc_dec::state_save_file(
50345020
const char * filepath,
50355021
const llama_token * tokens,
50365022
size_t n_token_count) {
5037-
GGML_UNUSED(filepath);
5038-
GGML_UNUSED(tokens);
5039-
GGML_UNUSED(n_token_count);
5040-
GGML_ABORT("TODO: implement");
5023+
return ctx_dec->state_save_file(filepath, tokens, n_token_count);
50415024
}
50425025

50435026
size_t llama_context_enc_dec::state_seq_load_file(
@@ -5046,24 +5029,15 @@ size_t llama_context_enc_dec::state_seq_load_file(
50465029
llama_token * tokens_out,
50475030
size_t n_token_capacity,
50485031
size_t * n_token_count_out) {
5049-
GGML_UNUSED(seq_id);
5050-
GGML_UNUSED(filepath);
5051-
GGML_UNUSED(tokens_out);
5052-
GGML_UNUSED(n_token_capacity);
5053-
GGML_UNUSED(n_token_count_out);
5054-
GGML_ABORT("TODO: implement");
5032+
return ctx_dec->state_seq_load_file(seq_id, filepath, tokens_out, n_token_capacity, n_token_count_out);
50555033
}
50565034

50575035
size_t llama_context_enc_dec::state_seq_save_file(
50585036
llama_seq_id seq_id,
50595037
const char * filepath,
50605038
const llama_token * tokens,
50615039
size_t n_token_count) {
5062-
GGML_UNUSED(seq_id);
5063-
GGML_UNUSED(filepath);
5064-
GGML_UNUSED(tokens);
5065-
GGML_UNUSED(n_token_count);
5066-
GGML_ABORT("TODO: implement");
5040+
return ctx_dec->state_seq_save_file(seq_id, filepath, tokens, n_token_count);
50675041
}
50685042

50695043
//

0 commit comments

Comments
 (0)