blksprs 1.10.1__tar.gz → 1.10.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. {blksprs-1.10.1 → blksprs-1.10.2}/PKG-INFO +1 -1
  2. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/flow.py +0 -1
  3. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/utils/tools.py +7 -1
  4. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs.egg-info/PKG-INFO +1 -1
  5. {blksprs-1.10.1 → blksprs-1.10.2}/pyproject.toml +1 -1
  6. {blksprs-1.10.1 → blksprs-1.10.2}/README.md +0 -0
  7. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/__init__.py +0 -0
  8. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/layouting/distribution_layout.py +0 -0
  9. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/layouting/sparsity_layout.py +0 -0
  10. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/conversion.py +0 -0
  11. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/distribution.py +0 -0
  12. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/matmul.py +0 -0
  13. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/misc/broadcast_ops.py +0 -0
  14. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/misc/exp.py +0 -0
  15. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/misc/row_wise.py +0 -0
  16. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/partitioning.py +0 -0
  17. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/repeat.py +0 -0
  18. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/softmax.py +0 -0
  19. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/ops/transpose.py +0 -0
  20. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/utils/benchmarking.py +0 -0
  21. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/utils/blksprs_tensor.py +0 -0
  22. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/utils/layout_utils.py +0 -0
  23. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/utils/processing.py +0 -0
  24. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs/utils/validation.py +0 -0
  25. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs.egg-info/SOURCES.txt +0 -0
  26. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs.egg-info/dependency_links.txt +0 -0
  27. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs.egg-info/requires.txt +0 -0
  28. {blksprs-1.10.1 → blksprs-1.10.2}/blksprs.egg-info/top_level.txt +0 -0
  29. {blksprs-1.10.1 → blksprs-1.10.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blksprs
3
- Version: 1.10.1
3
+ Version: 1.10.2
4
4
  Summary: A lightweight library for operations on blocksparse matrices in PyTorch.
5
5
  Author-email: Felix Schön <schoen@kr.tuwien.ac.at>
6
6
  Project-URL: Homepage, https://github.com/FelixSchoen/blksprs
@@ -112,7 +112,6 @@ def flow_forward(ctx, x: Tensor, sparsity_layout_o: Tensor, sparsity_lut: Tensor
112
112
  sparsity_block_size: int, n_sparse_blocks: int, triton_block_size: int) -> Tensor:
113
113
  output = torch.empty(size=(n_sparse_blocks, sparsity_block_size, sparsity_block_size),
114
114
  dtype=x.dtype, device=x.device)
115
- output = torch.zeros_like(output)
116
115
 
117
116
  x_b, x_r, x_c = x.size()
118
117
  x_b_s, x_r_s, x_c_s = stride(x)
@@ -1,3 +1,4 @@
1
+ import torch
1
2
  from torch import Tensor, Size
2
3
 
3
4
 
@@ -20,4 +21,9 @@ def get_triton_block_size(sparsity_block_size: int, limit: int = 128):
20
21
 
21
22
 
22
23
  def stride(x: Tensor):
23
- return x.view(x.shape).stride()
24
+ if x.dim() == 2:
25
+ return x.size(1), 1
26
+ elif x.dim() == 3:
27
+ return x.size(1) * x.size(2), x.size(2), 1
28
+ else:
29
+ raise NotImplementedError
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: blksprs
3
- Version: 1.10.1
3
+ Version: 1.10.2
4
4
  Summary: A lightweight library for operations on blocksparse matrices in PyTorch.
5
5
  Author-email: Felix Schön <schoen@kr.tuwien.ac.at>
6
6
  Project-URL: Homepage, https://github.com/FelixSchoen/blksprs
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "blksprs"
3
- version = "1.10.1"
3
+ version = "1.10.2"
4
4
  authors = [{ name = "Felix Schön", email = "schoen@kr.tuwien.ac.at" }]
5
5
  description = "A lightweight library for operations on blocksparse matrices in PyTorch."
6
6
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes