This is an archive of the discontinued LLVM Phabricator instance.

[mlir][sparse] fix crash on sparse_tensor.foreach operation on tensors with complex<T> elements.
ClosedPublic

Authored by Peiming on Nov 17 2022, 9:49 AM.

Diff Detail

Event Timeline

Peiming created this revision.Nov 17 2022, 9:49 AM
Herald added a project: Restricted Project. · View Herald Transcript
Peiming requested review of this revision.Nov 17 2022, 9:49 AM
bixia accepted this revision.Nov 17 2022, 9:54 AM
This revision is now accepted and ready to land.Nov 17 2022, 9:54 AM
aartbik accepted this revision.Nov 17 2022, 10:09 AM
aartbik added inline comments.
mlir/lib/Dialect/SparseTensor/Transforms/SparseTensorRewriting.cpp
783–784

Can we push this into a util?

Peiming updated this revision to Diff 476175.Nov 17 2022, 10:29 AM

move foreach on constant in a separate util function.

Peiming updated this revision to Diff 476192.Nov 17 2022, 11:25 AM

go deeper

This revision was landed with ongoing or failed builds.Nov 17 2022, 11:36 AM
This revision was automatically updated to reflect the committed changes.
wrengr added inline comments.Nov 17 2022, 12:41 PM
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
1047

Should we also be checking for f16/bf16? I ask because those two generally pattern together with complex when it comes to issues like this

Peiming added inline comments.Nov 17 2022, 12:43 PM
mlir/lib/Dialect/SparseTensor/Transforms/CodegenUtils.cpp
1047

I assume that ArrayAttr carrys the f16 will be typed, so that the complexOp will be set to the right element type.

Peiming marked an inline comment as done.Nov 17 2022, 12:50 PM