[XPU] add speculate_get_logits (#5497)

* [XPU] add speculate_step_system_cache

* [XPU] add speculate_step_system_cache

* [XPU] add speculate_get_logits

* delete context

* add ptr check

---------

Co-authored-by: cmcamdy <1027740945@qq.com>
Co-authored-by: YuBaoku <49938469+EmmonsCurse@users.noreply.github.com>
This commit is contained in:
RuohengMa
2025-12-12 15:38:30 +08:00
committed by GitHub
parent 888c4b992d
commit 12c76f8137
6 changed files with 603 additions and 0 deletions
@@ -600,6 +600,19 @@ DLL_EXPORT int rebuild_self_hidden_states(api::Context* ctx,
T* output,
int dim_embed,
int elem_cnt);
DLL_EXPORT int speculate_get_logits(Context* ctx,
float* draft_logits,
int* next_token_num,
int* batch_token_num,
int* cu_next_token_offset,
int* cu_batch_token_offset,
const float* logits,
const float* first_token_logits,
const int* seq_lens_this_time,
const int* seq_lens_encoder,
const int real_bsz,
const int vocab_size);
/*--------------------------------------- MTP end
* --------------------------------------------*/