model-pruning

Identify and apply model pruning to LLMs using Wanda or SparseGPT.

1.0k|117|Updated Feb 26, 2026
One-click install
npx skills add https://github.com/OpenLAIR/dr-claw --skill model-pruning-openlair
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-pruning
Source: https://github.com/OpenLAIR/dr-claw/tree/main/skills/emerging-techniques/model-pruning
Command: npx skills add https://github.com/OpenLAIR/dr-claw --skill model-pruning-openlair

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

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.

Core Features & Use Cases

  • Pruning techniques: Wanda, SparseGPT, N:M sparsity, magnitude pruning, structured vs unstructured.
  • Scenarios: compress models without retraining, deploy on hardware accelerators, balance accuracy vs speed.
  • Example: You have a 65B LLM and want 50% sparsity to halve memory; prune accordingly.

Quick Start

Run Wanda pruning on your chosen model to achieve 50% sparsity with minimal accuracy loss and save the pruned model.

Frequently Asked Questions about model-pruning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
What is the best way to compress an LLM to 50% sparsity without retraining?

One-shot model pruning using Wanda or SparseGPT compresses LLMs to 50% sparsity without retraining, preserving accuracy while halving memory usage. These methods prune transformer layers directly using calibration data.

How does N:M sparsity differ from unstructured pruning for accelerating inference?

N:M sparsity enforces a fixed ratio of zero weights within blocks for hardware accelerator compatibility, whereas unstructured pruning removes individual weights freely. Both accelerate inference but differ in hardware deployment efficiency.

Can I prune a 65B LLM for faster inference on edge devices?

Yes, model pruning effectively reduces a 65B LLM's memory footprint by 50% for edge device deployment. You need representative calibration data and familiarity with PyTorch and Transformers to guide the pruning process.

Do I need calibration data to apply Wanda or SparseGPT pruning?

Yes, calibration data or representative inputs are required to guide Wanda and SparseGPT pruning. These one-shot methods use the calibration data to evaluate weight importance and minimize accuracy loss during compression.

When should I choose structured pruning over magnitude pruning for my model?

Choose structured pruning when hardware targets require regular sparsity patterns for acceleration, whereas magnitude pruning removes individual low-magnitude weights freely. Structured pruning prioritizes hardware efficiency over unstructured flexibility.