pub struct CompressionConfig {
pub stages: Vec<CompressionStage>,
pub skip_embedding_layers: bool,
}Expand description
Full pipeline configuration: ordered list of stages and global options.
Fields§
§stages: Vec<CompressionStage>Ordered sequence of compression stages to apply.
skip_embedding_layers: boolWhen true, tensors whose name starts with "embed" or "token" are
skipped (not passed through any compression stage).
Implementations§
Source§impl CompressionConfig
impl CompressionConfig
Sourcepub fn add_stage(self, stage: CompressionStage) -> Self
pub fn add_stage(self, stage: CompressionStage) -> Self
Append a stage and return self for chaining.
Sourcepub fn prune_then_quantize(sparsity: f32) -> Self
pub fn prune_then_quantize(sparsity: f32) -> Self
Convenience: L1-unstructured pruning at sparsity, followed by INT8 quantization.
Sourcepub fn quantize_only() -> Self
pub fn quantize_only() -> Self
Convenience: INT8 quantization only.
Sourcepub fn prune_only(sparsity: f32) -> Self
pub fn prune_only(sparsity: f32) -> Self
Convenience: L1-unstructured pruning only at sparsity.
Trait Implementations§
Source§impl Clone for CompressionConfig
impl Clone for CompressionConfig
Source§fn clone(&self) -> CompressionConfig
fn clone(&self) -> CompressionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CompressionConfig
impl Debug for CompressionConfig
Source§impl Default for CompressionConfig
impl Default for CompressionConfig
Source§fn default() -> CompressionConfig
fn default() -> CompressionConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CompressionConfig
impl RefUnwindSafe for CompressionConfig
impl Send for CompressionConfig
impl Sync for CompressionConfig
impl Unpin for CompressionConfig
impl UnsafeUnpin for CompressionConfig
impl UnwindSafe for CompressionConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> 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