This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] refactoring: move genAffine to loopEmitter
ClosedPublic

Authored by Peiming on Nov 16 2022, 5:47 PM.

Details

Summary

This is the beginning patch of a sequence of dependent patches that in together provide the affine expression on matched indexing mapping for sparse tensors.

This patch itself simply move genAffine into loop emitter to be prepared for upcoming patches.

D138169 provides support for affine expression on dense dimensions only (except for constant affine expression)
D138170 provides support for constant affine expressions on dense dimensions
D138171 provides merger support for affine expression on sparse dimension (without codegen)
D138172 provides codegen support (by generating a "filter" loop) for affine expression on sparse dimensions.
D138173 fixes a crash on resolveCycle when dealing with affine expressions.

Diff Detail

Event Timeline

Peiming created this revision.Nov 16 2022, 5:47 PM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Nov 16 2022, 5:47 PM
Peiming edited the summary of this revision. (Show Details)Nov 16 2022, 6:02 PM
Peiming edited the summary of this revision. (Show Details)Nov 16 2022, 8:41 PM
Peiming added inline comments.Nov 16 2022, 8:45 PM
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.h
558

Should I make it a std::function in this patch? I think block sparsity might also need a (different) mapping?

It is not a complex change anyway.

Peiming updated this revision to Diff 476219.Nov 17 2022, 1:22 PM
Peiming edited the summary of this revision. (Show Details)

rebase

aartbik accepted this revision.Nov 18 2022, 12:42 PM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.h
351

update doc to match all parameters

558

I would do that change when needed? but up to you

This revision is now accepted and ready to land.Nov 18 2022, 12:42 PM
Peiming updated this revision to Diff 476589.Nov 18 2022, 1:38 PM
Peiming marked 2 inline comments as done.

address comments

This revision was landed with ongoing or failed builds.Nov 18 2022, 1:39 PM
This revision was automatically updated to reflect the committed changes.