This is an archive of the discontinued LLVM Phabricator instance.

[mlir][gpu] Add target attribute to GPU modules.
ClosedPublic

Authored by fmorac on Jun 29 2023, 10:12 AM.

Details

Summary

For an explanation of these patches see D154153.

Commit message:
Adds support for Target attributes in GPU modules. This change enables attaching
an optional non empty array of GPU target attributes to the module.

Depends on D154104

Diff Detail

Event Timeline

fmorac created this revision.Jun 29 2023, 10:12 AM
fmorac updated this revision to Diff 536064.Jun 29 2023, 5:29 PM

Rebasing.

fmorac edited the summary of this revision. (Show Details)Jun 29 2023, 6:17 PM
fmorac added a reviewer: mehdi_amini.
fmorac published this revision for review.Jun 30 2023, 6:29 AM

Seems reasonable to me, I'd be willing to approve

mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
1039

We could also have a version of this that takes ArrayRef<Attribute> and/or ArrayRef<GPUTargetAttr> (not sure of that second name)

fmorac updated this revision to Diff 543176.Jul 22 2023, 6:38 AM

Added a builder taking ArrayRef<Attribute> and a couple of utility methods.

mehdi_amini accepted this revision.Jul 24 2023, 12:37 AM
mehdi_amini added inline comments.
mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
1019

Can you update the description explaining what does it mean to have a target, when is it used in the pipeline, etc.?

mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
1527

What about forwarding to the other builder above?

1541

You can just write result.getOrAddProperties<Properties>() I believe

This revision is now accepted and ready to land.Jul 24 2023, 12:37 AM
fmorac added inline comments.Jul 24 2023, 4:33 AM
mlir/include/mlir/Dialect/GPU/IR/GPUOps.td
1019

Yes.

mlir/lib/Dialect/GPU/IR/GPUDialect.cpp
1527

I'll make the change to fwd it.

fmorac updated this revision to Diff 544513.Jul 26 2023, 2:11 PM
fmorac marked 3 inline comments as done.

Addressed comments.

fmorac marked an inline comment as done.Jul 26 2023, 2:12 PM
fmorac updated this revision to Diff 545490.Jul 30 2023, 5:16 PM

Rebasing.

fmorac updated this revision to Diff 546284.Aug 1 2023, 6:10 PM

Rebasing.

fmorac updated this revision to Diff 547732.Aug 7 2023, 5:13 AM

Rebasing.

This revision was automatically updated to reflect the committed changes.