@@ -3105,6 +3105,20 @@ void llama_set_draft_input_hidden_state(struct llama_context * ctx, const float
31053105 ctx->draft_input_hidden_state = hidden_state;
31063106}
31073107
3108+ bool llama_mtp_prepare_sinfo_for_warmup (struct llama_context * ctx) {
3109+ auto * kvd = static_cast <llama_context_kv_cache_data *>(ctx->kv_cache_data );
3110+ const auto & last_sinfo = kvd->last_main_model_sinfos ;
3111+
3112+ if (last_sinfo.empty ()) {
3113+ LLAMA_LOG_ERROR (" %s: The main call sinfo is not available for warmup.\n " , __func__);
3114+ return false ;
3115+ }
3116+
3117+ kvd->forced_sinfos = &last_sinfo;
3118+ return true ;
3119+ }
3120+
3121+
31083122bool llama_mtp_prepare_sinfo_for_update (struct llama_context * ctx, size_t n_accepted) {
31093123 auto * kvd = static_cast <llama_context_kv_cache_data *>(ctx->kv_cache_data );
31103124 const auto & last_sinfo = kvd->last_main_model_sinfos ;
@@ -3126,4 +3140,14 @@ bool llama_mtp_prepare_sinfo_for_update(struct llama_context * ctx, size_t n_acc
31263140void llama_mtp_cancel_sinfo_update (struct llama_context * ctx) {
31273141 auto * kvd = static_cast <llama_context_kv_cache_data *>(ctx->kv_cache_data );
31283142 kvd->forced_sinfos = nullptr ;
3129- }
3143+ }
3144+
3145+ void llama_context::kv_cache_seq_rm (llama_seq_id seq_id, llama_pos p0, llama_pos p1) {
3146+ if (memory) {
3147+ static_cast <llama_kv_cache_unified *>(memory.get ())->seq_rm (seq_id, p0, p1);
3148+ }
3149+ }
3150+
3151+ void llama_kv_cache_seq_rm (struct llama_context * ctx, llama_seq_id seq_id, llama_pos p0, llama_pos p1) {
3152+ ctx->kv_cache_seq_rm (seq_id, p0, p1);
3153+ }
0 commit comments