pub struct Sampler { /* private fields */ }Expand description
Stateful sampler: owns the RNG + the recent-token history (for penalties).
Implementations§
Source§impl Sampler
impl Sampler
pub fn new(cfg: SamplerConfig) -> Self
pub fn is_greedy(&self) -> bool
Sourcepub fn is_spec_sampling(&self) -> bool
pub fn is_spec_sampling(&self) -> bool
Sampled spec in its FASTEST regime: pure temperature, no truncation filters, no
penalties. Filters and penalties are also distribution-exact under the rejection
verify (spec.rs applies both symmetrically to draft q and target p), so they remain
spec-ELIGIBLE — see spec_eligible in memra-server’s worker, the authoritative
predicate. What they cost is the in-graph draft chain: the captured sampled draft
samples from the RAW softmax and can hold neither per-row filter stats nor a varying
penalty history, so spec.rs engages graph_s only in this pure-temp regime
(pure_temp) and otherwise falls back to the eager draft chain. This predicate names
that regime; it is NOT an eligibility test.