13#ifndef ENTROPIC_INFERENCE_BATCH_UTIL_H
14#define ENTROPIC_INFERENCE_BATCH_UTIL_H
42template <
typename Tok>
44 const std::vector<std::vector<Tok>>&
seqs) {
45 if (
seqs.size() < 2) {
return 0; }
48 for (std::size_t
i = 1;
i <
seqs.size(); ++
i) {
Activate model on GPU (WARM → ACTIVE).
bool batch_is_viable(std::size_t n, int n_parallel, std::size_t shared, bool hybrid, std::size_t total_suffix, int n_batch)
Decide whether the same-prefix batch fast-path is safe + worthwhile.
std::size_t common_prefix_len(const std::vector< Tok > &a, const std::vector< Tok > &b)
Length of the longest common token prefix of two sequences.
std::size_t batch_shared_prefix_len(const std::vector< std::vector< Tok > > &seqs)
Longest shared token prefix across N request sequences (gh#98).
@ optional
optional: every escape asks the host's path approver
gh#96 (v2.7.5) warm-keep / incremental-prefill decision logic.