model-pruning

Prune large language models with Wanda and SparseGPT for sparsity.

6|3|Updated Jan 29, 2026
One-click install
npx skills add https://github.com/jonnabio/ace-framework --skill model-pruning-jonnabio
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: model-pruning
Source: https://github.com/jonnabio/ace-framework/tree/main/.ace/packs/ai-research/model-pruning
Command: npx skills add https://github.com/jonnabio/ace-framework --skill model-pruning-jonnabio

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires transformers, torch, accelerate, and includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill provides a framework to reduce the size of large language models and accelerate inference using pruning techniques, allowing for faster deployment on constrained hardware.

Core Features & Use Cases

  • Model Pruning: Apply various pruning techniques like Wanda and SparseGPT to reduce model size and improve inference speed.
  • Use Case: Prune a LLaMA-7B model to achieve 50% sparsity with minimal accuracy loss and enable faster inference on edge devices.
  • Quick Start: Use the wanda_prune function to prune a model with one-shot, no retraining.

Quick Start

Run the wanda_prune function on your LLaMA-7B model with 50% sparsity:

pruned_model = wanda_prune(model, calib_data, sparsity=0.5)

Frequently Asked Questions about model-pruning

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

FAQPage Schema
How do I prune a large language model without retraining to accelerate inference?

To prune a large language model without retraining, use one-shot pruning techniques like Wanda or SparseGPT, which apply sparsity to model weights using calibration data to reduce model size and accelerate inference.

Can I use Wanda pruning to achieve 50% sparsity on a LLaMA-7B model?

Yes, you can apply Wanda pruning to a LLaMA-7B model to achieve 50% sparsity by passing your model and calibration data to the `wanda_prune` function with the sparsity parameter set to 0.5.

What is model compression through sparsity and when do I need it?

Model compression through sparsity reduces the number of non-zero weights in large language models. You need it when deploying models on constrained edge hardware that requires faster inference and smaller memory footprints.

Does this model pruning approach require PyTorch and Transformers dependencies?

Yes, this model pruning approach requires PyTorch, Transformers, and Accelerate libraries to perform tensor operations, load large language models, and manage hardware acceleration during the sparsity process.

What are the limitations of one-shot model pruning for inference acceleration?

One-shot model pruning for inference acceleration faces limitations in accuracy loss at higher sparsity ratios and requires hardware accelerators that specifically support and benefit from sparse matrix operations.

What's the best way to prepare calibration data for pruning a language model?

The best way to prepare calibration data for pruning a language model is to provide a representative sample of your target inference domain, allowing the pruning algorithm to accurately evaluate weight importance and minimize accuracy loss.