use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, Default)]
#[serde(rename_all = "snake_case")]
pub enum PruneMethod {
#[default]
Magnitude,
Wanda,
SparseGpt,
MinitronDepth,
MinitronWidth,
}
impl PruneMethod {
pub fn requires_calibration(&self) -> bool {
matches!(
self,
PruneMethod::Wanda
| PruneMethod::SparseGpt
| PruneMethod::MinitronDepth
| PruneMethod::MinitronWidth
)
}
pub fn display_name(&self) -> &'static str {
match self {
PruneMethod::Magnitude => "Magnitude",
PruneMethod::Wanda => "Wanda",
PruneMethod::SparseGpt => "SparseGPT",
PruneMethod::MinitronDepth => "Minitron (Depth)",
PruneMethod::MinitronWidth => "Minitron (Width)",
}
}
}