This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Put the implementation for the insertion operation to subroutines.
ClosedPublic

Authored by bixia on Nov 29 2022, 3:34 PM.

Details

Summary

Previously, we generated inlined implementation for insert operation and
observed MLIR compile time increase due to the size of the main routine. We now
put the insert operation implementation in subroutines and leave the inlining
decision to the MLIR compiler.

Diff Detail

Event Timeline

bixia created this revision.Nov 29 2022, 3:34 PM
Herald added a project: Restricted Project. · View Herald Transcript
bixia requested review of this revision.Nov 29 2022, 3:34 PM

Very nice how you have kept the changes compact. I like having the inserts in their own method (since LLVM can decide to inline or not)
and we avoid those big blocks of code for deeper tensors.

Nice job!

mlir/test/Dialect/SparseTensor/sparse_matmul_codegen.mlir
16

I usually move these parameters to the left by hand after using the autogen tool

24

and for constants, and stuff that may move, I add -DAG

would you mind doing that here

Even though we seem to constantly change CHECK tests ;-)
in the long run I hope we stabilize and then having the DAG
will make us less sensitive to minor movements.

bixia updated this revision to Diff 478973.Nov 30 2022, 8:53 AM
bixia marked 2 inline comments as done.

Format a FileCheck test by moving parameters and adding CHECK-DAG.

aartbik accepted this revision.Nov 30 2022, 8:02 PM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorCodegen.cpp
494

Add a comment:

// Construct fields and indices arrays from parameters.

585

Add comment:

Construct parameter list field and indices

This revision is now accepted and ready to land.Nov 30 2022, 8:02 PM
bixia updated this revision to Diff 479318.Dec 1 2022, 8:52 AM
bixia marked 2 inline comments as done.

Add comments.