[Mlir-commits] [mlir] 12ee3a6 - [mlir][sparse] make high and 2:4 a level format, not a level property (#67206)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Sep 22 16:52:40 PDT 2023
Author: Aart Bik
Date: 2023-09-22T16:52:36-07:00
New Revision: 12ee3a6f53db552b121b733ca21fb8c4f048398a
URL: https://github.com/llvm/llvm-project/commit/12ee3a6f53db552b121b733ca21fb8c4f048398a
DIFF: https://github.com/llvm/llvm-project/commit/12ee3a6f53db552b121b733ca21fb8c4f048398a.diff
LOG: [mlir][sparse] make high and 2:4 a level format, not a level property (#67206)
After some internal discussion, we decided that these features were best
represented as a separate format, and not a property.
Added:
Modified:
mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
index 6a8e66335fbc697..e6577aed063ca7f 100644
--- a/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
+++ b/mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td
@@ -141,20 +141,24 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
- **dense** : all entries along this level are stored
- **compressed** : only nonzeros along this level are stored
+ - **loose_compressed** : as compressed, but allows for free space between regions
- **singleton** : a variant of the compressed format, where coordinates have no siblings
+ - **block2_4** : the compression uses a 2:4 encoding per 1x4 block
+
+ For a compressed level, each position interval is represented in a compact
+ way with a lowerbound `pos(i)` and an upperbound `pos(i+1) - 1`, which implies
+ that successive intervals must appear in order without any "holes" in between
+ them. The loose compressed format relaxes these constraints by representing each
+ position interval with a lowerbound `lo(i)` and an upperbound `hi(i)`, which
+ allows intervals to appear in arbitrary order and with elbow room between them.
- Different level-formats may have
diff erent collections of level-properties.
By default, each level-type has the property of being unique (no duplicate
- coordinates at that level), ordered (coordinates appear sorted at that
- level), and, for compression, storing each position interval in a compact
- way with a lowerbound `pos(i)`" and an upperbound `pos(i+1) - 1`.
- The following properties can be added to a level-format to change this
- default behavior:
+ coordinates at that level) and ordered (coordinates appear sorted at that
+ level). The following properties can be added to a level-format to change
+ this default behavior:
- **nonunique** : duplicate coordinates may appear at the level
- **nonordered** : coordinates may appear in arbribratry order
- - **high** : position interval upperbounds are stored explicitly
- - **block2_4** : the compression uses a 2:4 encoding per 1x4 block
In addition to the map, the following two fields are optional:
More information about the Mlir-commits
mailing list