ao icon indicating copy to clipboard operation
ao copied to clipboard

What is the difference between WeightNormSparsifier and torch.nn.utils.prune.l1_unstructured ?

Open mayank64ce opened this issue 1 year ago • 3 comments

mayank64ce avatar Aug 21 '24 18:08 mayank64ce

cc @jcaip

supriyar avatar Aug 21 '24 19:08 supriyar

Hey @mayank64ce torch.nn.tils.prun.l1_unstructured is no longer maintained, so I would recommend using the WeightNormSparsifier. The sparsifier also allows for more configs, like block_size, or intra block sparsity.

Functionally however, they do the same thing - mask dense models to put zeros in the "right" place.

jcaip avatar Aug 22 '24 23:08 jcaip

I see, in the WeightNormSparsifier, there seem to be some additional parameters other different from l1_unstructured. How can I simulate the same behavior for a give prune_ratio .

Also can this sparse_block_shape parameter be of any arbitrary shape ?

mayank64ce avatar Aug 23 '24 01:08 mayank64ce