Agent skill · research science · davila7
model-pruning
Reduce LLM size and accelerate inference using pruning techniques like Wanda and SparseGPT. Use when compressing models without retraining, achieving 50% sparsity with minimal accuracy loss, or enabling faster inference on hardware accelerators. Covers unstructured pruning, structured pruning, N:M sparsity, magnitude pruning, and one-shot methods.
Why this skill is useful
Adds executable scripts for model pruning techniques that significantly enhance LLM performance and reduce size without retraining.
What it needs
Requires torch, transformers installed locally. About 6k tokens when loaded. Last updated 2026-08-06. 30,138 stars on the source repository.
What this skill does
Model Pruning: Compressing LLMs When to Use This Skill Use Model Pruning when you need to: Reduce model size by 40-60% with <1% accuracy loss Accelerate inference using hardware-friendly sparsity (2-4× speedup) Deploy on constrained hardware (mobile, edge devices) Compress without retraining using one-shot methods Enable efficient serving with reduced memory footprint Key Techniques: Wanda (weights × activations), SparseGPT (second-order), structured pruning, N:M sparsity Papers: Wanda ICLR 2024 (arXiv 2306.11695), SparseGPT (arXiv 2301.00774) Installation Quick Start Wanda Pruning (One-Shot, No Retraining) Source: ICLR 2024 (arXiv 2306.11695) SparseGPT (Second-Order Pruning) Source: arXiv 2301.00774 N:M Structured Pruning (Hardware Accelerator) Core Concepts 1. Pruning Criteria Magnitude Pruning (baseline): Wanda (weights × activations): SparseGPT (second-order): 2. Structured vs Unstructured Unstructured (fine-grained): Prune individual weights Higher quality (better accuracy) No hardware speedup (irregular sparsity) Structured (coarse-grained): Prune entire neurons, heads, or layers Lower quality (more accuracy loss) Hardware speedup (regular sparsity) Semi-structured (N:M): Best of both worlds 50% sparsity (2:4) → 2× speedup on NVIDIA GPUs Minimal accuracy loss 3. Sparsity Patterns Pruning Strategies Strategy 1: Gradual Magnitude Pruning Strategy 2: Layer-wise Pruning Strategy 3: Iterative Pruning + Fine-tuning Production Deployment Complete Pruning Pipeline Evaluation Best Practices 1. Sparsity Selection 2. Method Selection 3. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills davila7/emerging-techniques-model-pruning