add llama_model_reset_time API
This commit is contained in:
parent
8a308354f6
commit
24bea1549b
3 changed files with 9 additions and 0 deletions
|
@ -1557,6 +1557,8 @@ int main(int argc, char ** argv) {
|
|||
return 1;
|
||||
}
|
||||
prev_inst = &inst;
|
||||
} else {
|
||||
llama_model_reset_time(lmodel);
|
||||
}
|
||||
|
||||
llama_context * ctx = llama_new_context_with_model(lmodel, inst.to_llama_cparams());
|
||||
|
|
|
@ -414,6 +414,8 @@ extern "C" {
|
|||
const char * path_model,
|
||||
struct llama_model_params params);
|
||||
|
||||
LLAMA_API void llama_model_reset_time(struct llama_model * model);
|
||||
|
||||
LLAMA_API void llama_free_model(struct llama_model * model);
|
||||
|
||||
// TODO: rename to llama_init_from_model
|
||||
|
|
|
@ -8809,6 +8809,11 @@ static bool llm_load_tensors(
|
|||
return true;
|
||||
}
|
||||
|
||||
void llama_model_reset_time(llama_model * model) {
|
||||
model->t_start_us = ggml_time_us();
|
||||
model->t_load_us = ggml_time_us() - model->t_start_us;
|
||||
}
|
||||
|
||||
// Returns 0 on success, -1 on error, and -2 on cancellation via llama_progress_callback
|
||||
static int llama_model_load(const std::string & fname, llama_model & model, llama_model_params & params) {
|
||||
model.t_start_us = ggml_time_us();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue