Skip to content

Commit 4dba7db

Browse files
authored
Merge branch 'main' into jiannanWang/examples
2 parents 5409cd3 + f526f25 commit 4dba7db

File tree

4 files changed

+3
-548
lines changed

4 files changed

+3
-548
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"

redirects.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@
4848
"recipes/torchserve_vertexai_tutorial.html": "../index.html",
4949
"recipes/amx.html": "../index.html",
5050
"unstable_source/vulkan_workflow.rst": "../index.html",
51+
"unstable/semi_structured_sparse.html": "https://docs.pytorch.org/tutorials/advanced/semi_structured_sparse.html",
5152
"unstable/skip_param_init.html": "https://docs.pytorch.org/tutorials/recipes/recipes/module_load_state_dict_tips.html",
5253
"unstable_source/backend_config_tutorial.rst": "../index.html",
5354
}

unstable_index.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,6 @@ decide if we want to upgrade the level of commitment or to fail fast.
3636

3737
.. Add prototype tutorial cards below this line
3838
39-
.. Sparsity
40-
41-
.. customcarditem::
42-
:header: (prototype) Accelerating BERT with semi-structured (2:4) sparsity
43-
:card_description: Prune BERT to be 2:4 sparse and accelerate for inference.
44-
:image: _static/img/thumbnails/cropped/generic-pytorch-logo.png
45-
:link: unstable/semi_structured_sparse.html
46-
:tags: Model-Optimiziation
47-
4839
.. vmap
4940
5041
.. customcarditem::

0 commit comments

Comments
 (0)