This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] Expose SparseTensor passes as enums instead of opaque numbers for vectorization and parallelization options.
ClosedPublic

Authored by nkreeger on Apr 15 2022, 2:50 PM.

Diff Detail

Event Timeline

nkreeger created this revision.Apr 15 2022, 2:50 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 15 2022, 2:50 PM
nkreeger requested review of this revision.Apr 15 2022, 2:50 PM

Nice! LGTM but please for Aart to review.

Do you have commit access or do you need someone to land this for you?

Nice! LGTM but please for Aart to review.

Do you have commit access or do you need someone to land this for you?

Yeah Aart is on the review - I don't have commit access, first patch :-)

Thanks for the change. One nit question.

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

Is this "Some desc here", here and below, a TBD, or an oversight?

nkreeger updated this revision to Diff 423302.Apr 17 2022, 12:26 PM

Thanks for the change. One nit question.

Yes, sorry an oversight. Updated with some comments in the .td file.

rriddle added inline comments.Apr 17 2022, 12:32 PM
mlir/include/mlir/Dialect/SparseTensor/Transforms/Passes.td
69

FYI, You can use [{ <string-contents-here> }] to create a multi line string literal.

69

That would remove the need to escape the inner strings as well.

nkreeger updated this revision to Diff 423306.Apr 17 2022, 12:55 PM
nkreeger marked 3 inline comments as done.

Updated - thanks for the eyes

aartbik accepted this revision.Apr 18 2022, 9:17 AM

Thanks for doing this. I have a few nits on the description text, please fix those before submitting, but no need for a re-review.

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

Typo: L79 should reay "Enable *dense* ...."
Also, I would not repeat "strategy" here

90

Same here and below, just say

Enable vectorization for ....

This revision is now accepted and ready to land.Apr 18 2022, 9:17 AM
nkreeger updated this revision to Diff 423621.Apr 19 2022, 7:49 AM
nkreeger marked 2 inline comments as done.

Updated diff - sorry I don't have commit access.

Friendly ping here - lemme know if I need to something more to get this thing landed. I don't have LLVM commit rights. Thanks!

Sorry, I missed this... Can you please rebase? There is a conflict in a test.

Also: please email Chris to get commit access if you're planning to continue send more changes :)

nkreeger updated this revision to Diff 424719.Apr 23 2022, 7:18 AM

Updated - thanks Mehdi - I'll drop Chris a note.

nkreeger reopened this revision.Apr 23 2022, 6:17 PM

Looks like build-bot didn't like this test for NVIDIA: https://lab.llvm.org/buildbot/#/builders/61/builds/25447

This revision is now accepted and ready to land.Apr 23 2022, 6:17 PM

Friendly ping here - lemme know if I need to something more to get this thing landed. I don't have LLVM commit rights. Thanks!

Oops, I missed this follow up discussion. Apologies. I will commit this!

Hey Aart - the integration tests haven't passed on GPU - I'm working on a
fix but I haven't had a chance to get back to it this week.

Additionally, I have commit access now thanks to Chris :-)

Additionally, I have commit access now thanks to Chris :-)

In that case, I will let you do the honors! (after the fix of course ;-)

aartbik retitled this revision from [mlir][sparse] Expose SpareTensor passes as enums instead of opaque numbers for vectorization and parallelization options. to [mlir][sparse] Expose SparseTensor passes as enums instead of opaque numbers for vectorization and parallelization options..May 12 2022, 2:31 PM

Just curious on the status of this change?

Just curious on the status of this change?

It is stuck on a command line parse error with the integration tests with the enum names. I haven't had a good chance to sit in the debugger and figure out what is going on. I'll try and circle back next week on it.

It is stuck on a command line parse error with the integration tests with the enum names. I haven't had a good chance to sit in the debugger and figure out what is going on. I'll try and circle back next week on it.

Thanks for the update. No rush. I was just going through my "old" list of revisions to check ;-)

nkreeger updated this revision to Diff 450390.Aug 5 2022, 2:02 PM
nkreeger added a subscriber: Mogball.

Updated patch - passes integration tests.

Problem was that mlir/include/mlir/Dialect/SparseTensor/Pipelines/Passes.h needed to add all the options in struct SparseCompilerOptions.

@aartbik lemme know if you want me to file an issue on that. @Mogball helped me run that down.

Terribly sorry, but can you please rebase this with main? I think some changes will need resolution first.

nkreeger updated this revision to Diff 456474.Aug 29 2022, 3:26 PM

rebased diff.

Terribly sorry, but can you please rebase this with main? I think some changes will need resolution first.

Let me know if this updated one looks good and I'll land it finally :-)

aartbik accepted this revision.Sep 1 2022, 4:32 PM

I am fine submitting this, since I have kept you waiting for (too) long.
But the duplication of the options in td/h file worries me, that seems like a consistency nightmare.
Can you please file an issue on that, and add a TODO in the header file (as in, // TODO(issue): need to duplicate enums, but will be fixed....

Done, filed https://github.com/llvm/llvm-project/issues/57514 - from when I tried to run it down it looked like a parser bug in mlir.

I'll land later today or tomorrow - thanks!

nkreeger updated this revision to Diff 457456.Sep 1 2022, 5:37 PM
This revision was landed with ongoing or failed builds.Sep 3 2022, 1:46 PM
This revision was automatically updated to reflect the committed changes.
nkreeger reopened this revision.Sep 3 2022, 1:48 PM

Looks like CI is funny again. I'll circle back on Monday and try again.

This revision is now accepted and ready to land.Sep 3 2022, 1:48 PM
nkreeger updated this revision to Diff 457820.Sep 3 2022, 2:27 PM

header madness needed to move below declared structs.