pub struct SpecPolicy { /* private fields */ }Expand description
The DSpark depth that lands the most tokens per millisecond: every round
and plain token is timed from one decode step to the next (the
pipeline’s own work included), a depth’s price is its running average
(one never timed is scaled from the nearest timed one by [SPEC_REL]),
and how often each draft holds is a running average too. 0 drafts, plain
decoding, is a depth like the others; while it wins, a round of 2 every
32 tokens keeps the holds current.
Implementations§
Source§impl SpecPolicy
impl SpecPolicy
Sourcepub fn pick(&mut self, pos: usize, room: usize) -> usize
pub fn pick(&mut self, pos: usize, room: usize) -> usize
The drafts for the step at pos (room: tokens the request still
allows past the anchor). Times the previous step when it ended here.
Sourcepub fn done(&mut self, pos: usize, k: usize, accepted: usize)
pub fn done(&mut self, pos: usize, k: usize, accepted: usize)
Record the step just taken at pos: k drafts offered, accepted
kept (0 and 0 for a plain token).
Sourcepub fn forget_step(&mut self)
pub fn forget_step(&mut self)
The step after a reset or a new request is not timed against the last one.