This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] introduce LevelFormat which do not encoding level properties of a sparse tensor level.
ClosedPublic

Authored by Peiming on Dec 20 2022, 3:49 PM.

Diff Detail

Event Timeline

Peiming created this revision.Dec 20 2022, 3:49 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Dec 20 2022, 3:49 PM
Peiming updated this revision to Diff 484413.Dec 20 2022, 3:56 PM

update comments.

Peiming updated this revision to Diff 484415.Dec 20 2022, 3:58 PM

update comments.

aartbik added inline comments.Dec 20 2022, 4:00 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
161

storage formats (plural)

249

make a note that adding properties will l need to be addressed with new parameters

aartbik added inline comments.Dec 20 2022, 4:02 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
164

can we do without?

wrengr added inline comments.Dec 20 2022, 4:09 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
161–163

please update this documentation per my discussion on the previous patch

243

"LevelFormat"

248

documentation needs updating

253–255

Can you use return isValidDLT(dlt) ? dlt : std::nullopt; instead

258

per my comment on the previous patch, can you add a comment about why you want to assert this? I assume it's so that the next block of asserions can use the operator== without casting. But it's good to make it clear whether the assertion is just for that reason or whether it's something we actually intend the API to promise.

277–300

I think it'd be better to use some macros to help simplify this, but I can do that in a separate patch

wrengr added inline comments.Dec 20 2022, 4:13 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
249

Actually, I'm thinking it'd be nicer to just define a LevelProperties type with its own operator| to set the various property bits. But I can make a separate patch for that

wrengr added inline comments.Dec 20 2022, 4:14 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
161–163

Ah, looks like that got resolved between when I loaded the page and when my comment posted :)

Peiming updated this revision to Diff 484417.Dec 20 2022, 4:26 PM
Peiming marked 9 inline comments as done.

address comment

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

SG

258

removed

Peiming marked 2 inline comments as done.Dec 20 2022, 4:27 PM
aartbik accepted this revision.Dec 20 2022, 4:33 PM
This revision is now accepted and ready to land.Dec 20 2022, 4:33 PM
Peiming updated this revision to Diff 484419.Dec 20 2022, 4:35 PM

update comments.

wrengr added inline comments.Dec 20 2022, 4:35 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
162

"properties"

162

"the"

252

I'd change this to "TODO: factor out a new LevelProperties type so we can add new properties without changing this function's signature"

wrengr accepted this revision.Dec 20 2022, 4:36 PM
wrengr added inline comments.
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
244

"Returns"

252

"are"

252

"for"

wrengr added inline comments.Dec 20 2022, 4:38 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
252

"Returns"

Peiming updated this revision to Diff 484422.Dec 20 2022, 4:40 PM
Peiming marked 6 inline comments as done.

address comments.

wrengr added inline comments.Dec 20 2022, 4:40 PM
mlir/include/mlir/Dialect/SparseTensor/IR/Enums.h
259

Do you really need to pass this template parameter? The compiler should be able to infer it from the dlt variable.

Peiming updated this revision to Diff 484423.Dec 20 2022, 4:44 PM

address comments.

This revision was landed with ongoing or failed builds.Dec 20 2022, 4:47 PM
This revision was automatically updated to reflect the committed changes.