This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] support new kind of scalar in sparse linalg generic op
ClosedPublic

Authored by aartbik on Jun 15 2021, 4:29 PM.

Details

Summary

We have several ways of introducing a scalar invariant value into
linalg generic ops (should we limit this somewhat?). This revision
makes sure we handle all of them correctly in the sparse compiler.

Diff Detail

Event Timeline

aartbik created this revision.Jun 15 2021, 4:29 PM
aartbik requested review of this revision.Jun 15 2021, 4:29 PM
aartbik edited the summary of this revision. (Show Details)Jun 15 2021, 4:31 PM
aartbik added reviewers: gysit, bixia, gussmith23.

Hi Tobias,
As discussed today, this removes the assert on scalar inputs and deals with them correctly in the sparse compiler.
I also added a test that uses all possible ways of introducing scalars into a sparse kernel though the linalg op
(should we restrict this a bit?)
Aart

gysit accepted this revision.Jun 15 2021, 10:13 PM

LGTM

This revision is now accepted and ready to land.Jun 15 2021, 10:13 PM

Hi Tobias,
As discussed today, this removes the assert on scalar inputs and deals with them correctly in the sparse compiler.
I also added a test that uses all possible ways of introducing scalars into a sparse kernel though the linalg op
(should we restrict this a bit?)
Aart

We probably continue to support all options on the Linalg side. Capturing values is convenient in passes, scalar parameters are the clean solution IMO, and 0D tensors are a thing in higher level dialects.

At least when looking at the patch, my impression is that there is not a lot of overhead associated to support the different parameter types!