This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu][sparse] adding initial cusparse sddmm libgen support
ClosedPublic

Authored by K-Wu on May 23 2023, 7:22 PM.

Details

Summary

This diff added the sddmm cuSparse op + roundtrip + lowering to wrapper lib

Diff Detail

Event Timeline

K-Wu created this revision.May 23 2023, 7:22 PM
Herald added a reviewer: aartbik. · View Herald Transcript
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
K-Wu updated this revision to Diff 524981.May 23 2023, 8:17 PM

impl SDDMM representation and rewriter

K-Wu published this revision for review.May 23 2023, 8:20 PM
K-Wu retitled this revision from [mlir][gpu][sparse] adding cusparse sddmm support to [mlir][gpu][sparse] adding initial cusparse sddmm libgen support.
K-Wu edited the summary of this revision. (Show Details)
K-Wu updated this revision to Diff 525273.May 24 2023, 11:10 AM

add test cases

I would split this into adding the new cuSparse op + roundtrip + lowering to wrapper lib in this revision
and then the actual recognition during sparsification + test + integration test perhaps in one or two next revisions

mlir/lib/Dialect/SparseTensor/Transforms/SparseGPUCodegen.cpp
695

Note that I made a small refinement in https://reviews.llvm.org/D151404 which seems safer: keep them all on the same stream (so no blocking wait here) and move the copy after the copy-in only and buffer are released

K-Wu added inline comments.May 24 2023, 9:20 PM
mlir/lib/Dialect/SparseTensor/Transforms/SparseGPUCodegen.cpp
695

noted. I will update this and mark done once I incorporate the rebased-pull into this diff.

aartbik added inline comments.May 25 2023, 9:48 AM
mlir/lib/Dialect/SparseTensor/Transforms/SparseGPUCodegen.cpp
699

sparse output will be more complex than this btw

K-Wu updated this revision to Diff 525692.May 25 2023, 10:18 AM

rebase origin main

K-Wu updated this revision to Diff 525841.May 25 2023, 3:28 PM

fixing compile errors

K-Wu updated this revision to Diff 525862.May 25 2023, 4:23 PM

fixing test error and formatting

K-Wu updated this revision to Diff 526111.May 26 2023, 10:16 AM

rebase origin/main

K-Wu edited the summary of this revision. (Show Details)May 26 2023, 10:17 AM
K-Wu updated this revision to Diff 526132.May 26 2023, 11:09 AM

fix compile error

K-Wu updated this revision to Diff 526156.May 26 2023, 12:16 PM

fix format

K-Wu updated this revision to Diff 526166.May 26 2023, 12:57 PM

rebase origin/main

K-Wu updated this revision to Diff 526171.May 26 2023, 1:03 PM

removing SparseGPUCodegen.cpp from this diff list

Peiming added inline comments.
mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
2025

bad indentation here

K-Wu updated this revision to Diff 526185.May 26 2023, 1:50 PM

fix inden

K-Wu marked an inline comment as done.May 26 2023, 1:51 PM
K-Wu added inline comments.
mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
2025

Good catch. Thank you!

K-Wu marked an inline comment as done.May 26 2023, 2:10 PM
aartbik accepted this revision.May 27 2023, 12:58 PM
aartbik added inline comments.
mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
1944

matrix -> matrices (since we have dense A,B now)

mlir/lib/Conversion/GPUCommon/GPUToLLVMConversion.cpp
1490

note that we have this test + convert test so many times now, that perhaps a helper will be useful
(next revision is fine)

This revision is now accepted and ready to land.May 27 2023, 12:58 PM
K-Wu updated this revision to Diff 526284.May 27 2023, 1:00 PM

fix grammar

This revision was landed with ongoing or failed builds.May 27 2023, 1:01 PM
This revision was automatically updated to reflect the committed changes.