Skip to content

Commit

Permalink
update README example with correct import of sparsify_ (#741)
Browse files Browse the repository at this point in the history
* sparsify -> sparsify_

* Update README.md
  • Loading branch information
a-r-r-o-w committed Aug 23, 2024
1 parent 9a56e80 commit eb47c93
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ And a quick crash course on inference quantization to help parse the above table

Sparsifying your model is also a 1 liner that should work on any model with an `nn.Linear`. We find that sparsity works best on compute bound models like SAM, specifically the MLP layers.
```python
from torchao.sparsity import sparsify, semi_sparse_weight()
from torchao.sparsity import sparsify_, semi_sparse_weight

m = sparsify_(m, semi_sparse_weight())
```
Sparsity can also be composed with int8 dynamic quantization for further speedups:

```python
from torchao.sparsity import sparsify, int8_dynamic_activation_int8_semi_sparse_weight
from torchao.sparsity import sparsify_, int8_dynamic_activation_int8_semi_sparse_weight

m = sparsify_(m, int8_dynamic_activation_int8_semi_sparse_weight())
```
Expand Down

0 comments on commit eb47c93

Please sign in to comment.