if (params.warmup) {
LOG_INF("%s: warming up the model with an empty run - please wait ... (--no-warmup to disable)\n", __func__);
- llama_set_warmup(lctx, true);
-
std::vector<llama_token> tmp;
llama_token bos = llama_vocab_bos(vocab);
llama_token eos = llama_vocab_eos(vocab);
llama_memory_clear(llama_get_memory(lctx), true);
llama_synchronize(lctx);
llama_perf_context_reset(lctx);
- llama_set_warmup(lctx, false);
// reset samplers to reset RNG state after warmup to the seeded state
res->reset_samplers();
// Set whether the model is in warmup mode or not
// If true, all model tensors are activated during llama_decode() to load and cache their weights.
- LLAMA_API void llama_set_warmup(struct llama_context * ctx, bool warmup);
+ //
+ // note: using this can cause extra graph reallocations because it changes the graph topology with MoE models,
+ // so it is generally not recommended to use in practice. will be removed in the future
+ DEPRECATED(LLAMA_API void llama_set_warmup(struct llama_context * ctx, bool warmup),
+ "user code should do warmup runs manually [TAG_LLAMA_GRAPH_NO_WARMUP]");
// Set abort callback
LLAMA_API void llama_set_abort_callback(struct llama_context * ctx, ggml_abort_callback abort_callback, void * abort_callback_data);
bool fused_gdn_ch; // use fused gated delta net (chunked)
bool auto_fgdn;
bool no_perf;
- bool warmup;
+ bool warmup; // TODO: remove [TAG_LLAMA_GRAPH_NO_WARMUP]
bool op_offload;
bool kv_unified;
bool pipeline_parallel;
throw std::runtime_error("failed to create context");
}
- llama_set_warmup(ctx.get(), false);
-
vocab = llama_model_get_vocab(model);
n_vocab = llama_vocab_n_tokens(vocab);
}