This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Add new option (enable-runtime-library) to sparse compiler pipeline
ClosedPublic

Authored by Peiming on Sep 9 2022, 11:41 AM.

Details

Summary

Add new option (enable-runtime-library) to sparse compiler pipeline, it allows us to decide whether we need to rewrite operations (e.g., concatenate, reshape) within sparsification (when using codegen) or convert them after sparsification (when using runtime library).

Diff Detail

Event Timeline

Peiming created this revision.Sep 9 2022, 11:41 AM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Sep 9 2022, 11:41 AM
Peiming updated this revision to Diff 459153.Sep 9 2022, 11:51 AM

Take the codegen path when RT is disabled.

aartbik added inline comments.Sep 9 2022, 12:01 PM
mlir/include/mlir/Dialect/SparseTensor/Pipelines/Passes.h
80

I love your enthusiasm adding this TODO ;-)

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

if we document the value (good practice), let's also document the other two false

and I would say, "enable" instead of "use" to stay in the same terminology as used in the flag description

mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.td
102

Enable

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorPasses.cpp
55

move this comment and decl down too

mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
308

If not enableRT (flag name) ....
or
If RT not enabled ....

Peiming updated this revision to Diff 459161.Sep 9 2022, 12:25 PM
Peiming marked 4 inline comments as done.

Address comments from Aart

Peiming updated this revision to Diff 459177.Sep 9 2022, 1:04 PM

First codegen integrate test!

Peiming updated this revision to Diff 459179.Sep 9 2022, 1:06 PM

add missing period...

Peiming updated this revision to Diff 459184.Sep 9 2022, 1:22 PM

update test

aartbik accepted this revision.Sep 9 2022, 1:43 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.h
74

oops, supernit, we usually put it before the value, as in

/*disable SIMD Index32 = */false

mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
68 ↗(On Diff #459184)

can we actually run this always, even for lib cases to clean up?

This may impact some CHECK tests though, so I am okay either way

mlir/test/Integration/Dialect/SparseTensor/CPU/sparse_codegen_dim.mlir
14 ↗(On Diff #459184)

Move down one line

also, rename MAT into DCSR

This revision is now accepted and ready to land.Sep 9 2022, 1:43 PM
Peiming updated this revision to Diff 459194.Sep 9 2022, 1:51 PM
Peiming marked an inline comment as done.

Address comments from Aart.

Peiming marked 2 inline comments as done.Sep 9 2022, 1:52 PM
Peiming added inline comments.
mlir/lib/Dialect/SparseTensor/Pipelines/SparseTensorPipelines.cpp
68 ↗(On Diff #459184)

Actually it does not impact any CHECT tests, probably only end-to-end integrate test are involved here, so it wouldn't change the result.

Peiming marked an inline comment as done.Sep 9 2022, 1:53 PM
This revision was landed with ongoing or failed builds.Sep 9 2022, 1:54 PM
This revision was automatically updated to reflect the committed changes.