mirror of
https://github.com/iafiscal1212/diffuse-cpp.git
synced 2026-12-04 00:28:08 +00:00
Add speculative decoding engine that uses a small draft model (e.g.
Qwen2.5-0.5B) to propose K candidate tokens, verified in one batch
by the target model (e.g. Qwen2.5-32B). Greedy mode (temp=0) only.
Key features:
- Fast-reject: skip target batch when d1 mismatches (saves ~40% of batches)
- KV cache rollback after verification (accepted prefix kept)
- Separate threadpools: target=high priority, draft=normal
- ar_forward_batch: new API for multi-token forward without cache reset
New files: src/ar-speculative.{h,cpp}
CLI flags: --draft, --spec-k, --draft-threads
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>