23namespace entropic::speculative {
63 "target model is recurrent (Mamba/RWKV) — speculative "
64 "decoding is incompatible with recurrent architectures "
65 "at the v2.1.11 llama.cpp pin"};
69 "target model is hybrid (e.g., QWEN35/QWEN35MOE, "
70 "NEMOTRON_H, JAMBA, GRANITE_HYBRID) — speculative "
71 "decoding produces divergent state at split-prefill "
72 "boundaries on hybrid SSM architectures at the v2.1.11 "
73 "llama.cpp pin (see proposal Implementation Log, Gate A)"};
91 "vocab type differs between target and draft models"};
110 return std::string{
"BOS add-behavior differs"};
113 return std::string{
"BOS token id differs"};
132 return std::string{
"EOS add-behavior differs"};
135 return std::string{
"EOS token id differs"};
157 "vocab size difference exceeds the speculative tolerance "
158 "(target=" + std::to_string(
nt)
159 +
", draft=" + std::to_string(
nd)
160 +
", max-allowed-diff="
183 const int end = std::min(
nt,
nd);
187 if (
tt ==
nullptr ||
td ==
nullptr || std::strcmp(
tt,
td) != 0) {
189 "token text differs at id "
191 +
" — draft tokenizer is not a prefix-compatible "
192 "subset of the target"};
218 using Check = std::optional<std::string> (*)(
228 if (
d.has_value()) {
err = std::move(*
d); }
249 if (target ==
nullptr || draft ==
nullptr) {
250 err =
"null model handle (target or draft)";
256 err = (
vt ==
nullptr ||
vd ==
nullptr)
257 ? std::string{
"model vocab unavailable (target or draft)"}
std::string err
size_exceeded, when set
@ optional
optional: every escape asks the host's path approver
Tokenizer/architecture compatibility check for speculative decoding draft pairing.
CompatResult check_compat(const llama_model *target, const llama_model *draft)
Check whether a draft model can pair with a target for sequential speculative decoding.
Result of a draft/target compatibility check.