pub struct GemmaDraft {Show 15 fields
pub layers: Vec<GemmaDraftLayer>,
pub pre_proj: GpuTensor,
pub post_proj: GpuTensor,
pub output_norm: GpuTensor,
pub head: GpuTensor,
pub d2t: Option<Vec<u32>>,
pub d2t_dev: Option<CudaSlice<u32>>,
pub trim_adapt: Option<TrimAdapt>,
pub rope_freqs: CudaSlice<f32>,
pub ones: CudaSlice<f32>,
pub n_embd: usize,
pub n_backbone: usize,
pub rope_base_global: f32,
pub rope_base_swa: f32,
pub sliding_window: usize,
}Fields§
§layers: Vec<GemmaDraftLayer>§pre_proj: GpuTensor§post_proj: GpuTensor§output_norm: GpuTensor§head: GpuTensor§d2t: Option<Vec<u32>>FR-Spec trim map: draft-row index -> target token id (None = full head, identity).
d2t_dev: Option<CudaSlice<u32>>Device copy of d2t — the async round translates each drafted trim-idx in place
(u32_map_k) before it seeds the next draft step or meets the verify argmax.
trim_adapt: Option<TrimAdapt>Adaptive trim (coverage escapes are the entire trim cost — oracle-proven +2% on the cell the static trim lost by 17%, jsonl 2026-07-19): spare head slots learned at serve time from the prompt’s own ids and verify-correction tokens.
rope_freqs: CudaSlice<f32>§ones: CudaSlice<f32>§n_embd: usize§n_backbone: usize§rope_base_global: f32§rope_base_swa: f32§sliding_window: usizeImplementations§
Source§impl GemmaDraft
impl GemmaDraft
Sourcepub fn trim_adapt_stats(&self) -> Option<(usize, usize)>
pub fn trim_adapt_stats(&self) -> Option<(usize, usize)>
Adaptive-trim stats: (slots used, slot budget). None when adaptation is off.
Sourcepub fn trim_adapt_save(&self) -> Result<usize>
pub fn trim_adapt_save(&self) -> Result<usize>
Persist the learned trim rows: append ids not yet in the sidecar to
<ranks>.learned (the load path pre-fills spare slots from it, so a distribution’s
escapes pay their first-miss round ONCE across the serve lifetime, not per request).