Skip to content

Commit 9e1eb9e

Browse files
committed
Sparse Semi Sturcutred Tutorial audit
Realized that we have essentially two versions of the same tutorial, with the only difference being one is a jupyter notebook. [here](https://docs.pytorch.org/tutorials/unstable/semi_structured_sparse.html) and [here](https://docs.pytorch.org/tutorials/advanced/semi_structured_sparse.html) for reference. The PR removes the `unstable_source` rst tutorial and makes a couple of small updates of the jupyter notebook.
1 parent 0b98a1c commit 9e1eb9e

File tree

2 files changed

+2
-539
lines changed

2 files changed

+2
-539
lines changed

advanced_source/semi_structured_sparse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343
# - A NVIDIA GPU with semi-structured sparsity support (Compute
4444
# Capability 8.0+).
4545
#
46+
# .. note:: This tutorial is tested on an NVIDIA A100 80GB GPU. You may not see similar speedups on newer GPU architectures, For the latest information on semi-structured sparsity support, please refer to the README `here <https://github.com/pytorch/ao/tree/main/torchao/sparsity#torchao-sparsity>
47+
#
4648
# This tutorial is designed for beginners to semi-structured sparsity and
4749
# sparsity in general. For users with existing 2:4 sparse models,
4850
# accelerating ``nn.Linear`` layers for inference with
@@ -52,7 +54,6 @@
5254
import torch
5355
from torch.sparse import to_sparse_semi_structured, SparseSemiStructuredTensor
5456
from torch.utils.benchmark import Timer
55-
SparseSemiStructuredTensor._FORCE_CUTLASS = True
5657

5758
# mask Linear weight to be 2:4 sparse
5859
mask = torch.Tensor([0, 0, 1, 1]).tile((3072, 2560)).cuda().bool()
@@ -207,7 +208,6 @@
207208
import transformers
208209

209210
# force CUTLASS use if ``cuSPARSELt`` is not available
210-
SparseSemiStructuredTensor._FORCE_CUTLASS = True
211211
torch.manual_seed(100)
212212

213213
# Set default device to "cuda:0"

0 commit comments

Comments
 (0)