Skip to content
Back to skills

Wanda Row Pruning

ASecurity

Compute row-wise Wanda pruning scores, masks, and pruned weights without any weight update.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
testing

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill wanda_row_pruning --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Wanda Row Pruning?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Wanda Row Pruning
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-wanda-row-pruning/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-wanda-row-pruning)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: wanda_row_pruning
description: Compute row-wise Wanda pruning scores, masks, and pruned weights without any weight update.
---

# Wanda Row Pruning

Use this skill to prune a linear layer with the Wanda rule: score each weight by `abs(W_ij) * activation_norm_j`, compare scores only within the same output row, and zero the lowest-scoring weights. Do not use it when the experiment requires global layer-wise magnitude thresholds.

## Inputs
- Weight matrix shaped `[output_channels][input_channels]`.
- Activation norm vector with one entry per input channel.
- Unstructured sparsity ratio in `[0, 1)`.

## Outputs
- Boolean prune mask where `true` means the weight is removed.
- Pruned weight matrix with masked entries set to zero.
- Score matrix and exact sparsity metadata.

## Workflow
1. Validate the activation vector length against the matrix width.
2. Compute scores by multiplying every row of `abs(W)` by the activation norms.
3. For each output row, deterministically select the lowest `floor(width * sparsity_ratio)` scores.
4. Set only masked weights to zero; never alter unmasked values.

## Validation
The tests include an outlier-channel case where Wanda keeps a low-magnitude but high-activation weight that magnitude pruning removes.

## Limitations
This skill handles one dense matrix. Model traversal and calibration capture are separate modules.

Files in this skill

  • SKILL.md1.3 KB
  • scripts/wanda.py1.7 KB
  • tests/test_wanda_row_pruning.py295 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…