pub struct PatchPolicy {
pub exclude_names: Vec<String>,
/* private fields */
}Expand description
Pattern rules for per-layer rank scaling (KV_PATTERN) and exclusion (lm_head).
Fields§
§exclude_names: Vec<String>Substring patterns for module names excluded from quantization (["lm_head"] default).
Implementations§
Source§impl PatchPolicy
impl PatchPolicy
Sourcepub fn new() -> Self
pub fn new() -> Self
Build default upstream policy (\.k_proj$ and \.v_proj$ receive kv_factor;
lm_head and MoE router projections are excluded).
Sourcepub fn is_excluded(&self, module_name: &str) -> bool
pub fn is_excluded(&self, module_name: &str) -> bool
Return true if module_name matches any excluded substring.
Sourcepub fn ratio_factor(&self, module_name: &str, config: &LittleBitConfig) -> f64
pub fn ratio_factor(&self, module_name: &str, config: &LittleBitConfig) -> f64
Compute the rank multiplier (kv_factor for .k_proj / .v_proj, otherwise 1.0).
Trait Implementations§
Source§impl Clone for PatchPolicy
impl Clone for PatchPolicy
Source§impl Debug for PatchPolicy
impl Debug for PatchPolicy
Auto Trait Implementations§
impl Freeze for PatchPolicy
impl RefUnwindSafe for PatchPolicy
impl Send for PatchPolicy
impl Sync for PatchPolicy
impl Unpin for PatchPolicy
impl UnsafeUnpin for PatchPolicy
impl UnwindSafe for PatchPolicy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
impl<T, U> Imply<T> for U
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more