02. Pruning: Unstructured

Chapter 2 of 18 · 10 min

Local verification checkpoint

Run the smallest example from this chapter in a local workspace and record the package version, runtime, data path, and observed output. If the result depends on model size, vector count, CPU/GPU backend, or available memory, note that constraint beside the exercise so the lesson remains reproducible.

EXERCISE

Load a small PyTorch model, apply unstructured pruning at 70% sparsity using torch.nn.utils.prune.random_unstructured, and measure the compressed size versus inference speed compared to the dense baseline.