Add a numeric context parameter declaring the maximum outputs one sequence

This commit is contained in:
Gaurav Garg
2026-07-05 02:48:13 +05:30
parent 0eddfa0b4c
commit eab4e8444f
14 changed files with 120 additions and 72 deletions
+5
View File
@@ -2382,6 +2382,11 @@ int32_t common_speculative_n_outputs_max(int32_t n_batch, int32_t n_parallel, in
return std::min<int64_t>(n_batch, n_outputs);
}
int32_t common_speculative_n_outputs_per_seq_max(int32_t n_batch, int32_t n_draft) {
const int64_t n_outputs = 1 + (int64_t) std::max(0, n_draft);
return std::min<int64_t>(n_batch, n_outputs);
}
// initialization of the speculative decoding system
//
common_speculative * common_speculative_init(common_params_speculative & params, uint32_t n_seq) {