Skip to content

Commit f9da447

Browse files
committed
[mlir][sparse] clean up a few TODOs and layout
Removed some TODOs that are not likely to be done or are already recorded through git tracker. Reviewed By: Peiming Differential Revision: https://reviews.llvm.org/D156836
1 parent 1f0d24c commit f9da447

File tree

6 files changed

+9
-28
lines changed

6 files changed

+9
-28
lines changed

mlir/include/mlir/Dialect/SparseTensor/IR/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,3 @@ set(LLVM_TARGET_DEFINITIONS SparseTensorTypes.td)
1212
mlir_tablegen(SparseTensorTypes.h.inc -gen-typedef-decls)
1313
mlir_tablegen(SparseTensorTypes.cpp.inc -gen-typedef-defs)
1414
add_public_tablegen_target(MLIRSparseTensorTypesIncGen)
15-

mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ namespace sparse_tensor {
4242
/// values with the built-in type "index". For now, we simply assume that
4343
/// type is 64-bit, but targets with different "index" bitwidths should
4444
/// link with an alternatively built runtime support library.
45-
// TODO: support such targets?
4645
using index_type = uint64_t;
4746

4847
/// Encoding of overhead types (both position overhead and coordinate
@@ -92,11 +91,6 @@ enum class PrimaryType : uint32_t {
9291
};
9392

9493
// This x-macro includes all `V` types.
95-
// TODO: We currently split out the non-variadic version from the variadic
96-
// version. Using ##__VA_ARGS__ to avoid the split gives
97-
// warning: token pasting of ',' and __VA_ARGS__ is a GNU extension
98-
// [-Wgnu-zero-variadic-macro-arguments]
99-
// and __VA_OPT__(, ) __VA_ARGS__ requires c++20.
10094
#define MLIR_SPARSETENSOR_FOREVERY_V(DO) \
10195
DO(F64, double) \
10296
DO(F32, float) \
@@ -205,7 +199,6 @@ enum class LevelFormat : uint8_t {
205199
/// Returns string representation of the given dimension level type.
206200
constexpr const char *toMLIRString(DimLevelType dlt) {
207201
switch (dlt) {
208-
// TODO: should probably raise an error instead of printing it...
209202
case DimLevelType::Undef:
210203
return "undef";
211204
case DimLevelType::Dense:

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorAttrDefs.td

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,7 @@ def SparseTensorEncodingAttr : SparseTensor_Attr<"SparseTensorEncoding",
153153
stored with compression while dense storage is used within each block
154154
(although hybrid schemes are possible as well).
155155

156-
TODO: the following example is out-of-date and will be implemented
157-
in a different manner than described here.
158-
(This will be corrected in an upcoming change that completely
156+
(The following will be corrected in an upcoming change that completely
159157
overhauls the syntax of this attribute.)
160158

161159
The dimToLvl mapping also provides a notion of "counting a
@@ -439,11 +437,11 @@ def AnyRankedSparseTensor : RankedSparseTensorOf<[AnyType]>;
439437
// Sparse Tensor Sorting Algorithm Attribute.
440438
//===----------------------------------------------------------------------===//
441439

442-
// TODO: Currently, we only provide four implementations, and expose the
443-
// implementations via attribute algorithm. In the future, if we will need
444-
// to support both stable and non-stable quick sort, we may add
445-
// quick_sort_nonstable enum to the attribute. Alternative, we may use two
446-
// attributes, (stable|nonstable, algorithm), to specify a sorting
440+
// Currently, we only provide four implementations, and expose the
441+
// implementations via attribute algorithm. In the future, if we will
442+
// need to support both stable and non-stable quick sort, we may add
443+
// quick_sort_nonstable enum to the attribute. Alternative, we may use
444+
// two attributes, (stable|nonstable, algorithm), to specify a sorting
447445
// implementation.
448446
//
449447
// --------------------------------------------------------------------------

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorOps.td

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -762,14 +762,6 @@ def SparseTensor_OutOp : SparseTensor_Op<"out", []>,
762762
//===----------------------------------------------------------------------===//
763763

764764
def SparseTensor_SortOp : SparseTensor_Op<"sort", [AttrSizedOperandSegments]>,
765-
// TODO: May want to extend tablegen with
766-
// class NonemptyVariadic<Type type> : Variadic<type> { let minSize = 1; }
767-
// and then use NonemptyVariadic<...>:$xs here.
768-
//
769-
// TODO: Currently tablegen doesn't support the assembly syntax when
770-
// `algorithm` is an optional enum attribute. We may want to use an optional
771-
// enum attribute when this is fixed in tablegen.
772-
//
773765
Arguments<(ins Index:$n,
774766
Variadic<StridedMemRefRankOf<[AnyInteger, Index], [1]>>:$xs,
775767
Variadic<StridedMemRefRankOf<[AnyType], [1]>>:$ys,

mlir/include/mlir/Dialect/SparseTensor/IR/SparseTensorStorageLayout.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ using FieldIndex = unsigned;
107107
/// encoding.
108108
class StorageLayout {
109109
public:
110-
// TODO: Functions/methods marked with [NUMFIELDS] might should use
110+
// TODO: Functions/methods marked with [NUMFIELDS] should use
111111
// `FieldIndex` for their return type, via the same reasoning for why
112112
// `Dimension`/`Level` are used both for identifiers and ranks.
113113
explicit StorageLayout(const SparseTensorType &stt)
@@ -154,12 +154,12 @@ class StorageLayout {
154154
// Wrapper functions to invoke StorageLayout-related method.
155155
//
156156

157-
// TODO: See note [NUMFIELDS].
157+
// See note [NUMFIELDS].
158158
inline unsigned getNumFieldsFromEncoding(SparseTensorEncodingAttr enc) {
159159
return StorageLayout(enc).getNumFields();
160160
}
161161

162-
// TODO: See note [NUMFIELDS].
162+
// See note [NUMFIELDS].
163163
inline unsigned getNumDataFieldsFromEncoding(SparseTensorEncodingAttr enc) {
164164
return StorageLayout(enc).getNumDataFields();
165165
}

mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ enum class SparseParallelizationStrategy {
4141
kAnyStorageOuterLoop,
4242
kDenseAnyLoop,
4343
kAnyStorageAnyLoop
44-
// TODO: support reduction parallelization too?
4544
};
4645

4746
// TODO : Zero copy is disabled due to correctness bugs.Tracker #64316

0 commit comments

Comments
 (0)