Page MenuHomePhabricator

[MLIR][OpenMP] Added target data, exit data, and enter data operation definition for MLIR.
Needs ReviewPublic

Authored by abidmalikwaterloo on Jun 30 2021, 6:42 PM.

Details

Summary

This includes a basic implementation for the OpenMP target data, exit data, and enter data constructs
operation.

Diff Detail

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Made changes to alignment
Made AnyType to AnyInteger for map_type_modifier

clementval added inline comments.Sep 23 2021, 6:16 AM
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
151

Extra line doesn't seem to fit the file format.

466

Extra line doesn't seem to fit the file format.

565

Extra line doesn't seem to fit the file format.

674

What's the purpose of the region on enter data?

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
674

If I am correct, it is defining the region within which the scope exit.

Remove space as mentioned by the reviewer

clementval requested changes to this revision.Sep 24 2021, 5:39 AM
clementval added inline comments.
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
674

I'm pretty sure enter data does not need an attached region. It's a standalone directive so no other operation will be nested inside its region. target exit data does not have one so these two operations are very close and it should be reflected in their MLIR design.

This revision now requires changes to proceed.Sep 24 2021, 5:39 AM
abidmalikwaterloo marked 5 inline comments as done.Oct 18 2021, 6:01 PM

made changes in the data enter operation

clementval added inline comments.Oct 19 2021, 12:08 AM
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
584

There still lines exceeding the 80 characters limit. Can you double check the whole patch so we can approve it.

abidmalikwaterloo marked an inline comment as done.Oct 22 2021, 12:00 PM

Correct indentation for comments

I have kind of lost track on this. Is this up to date and ready to go?

Will try to finalize this week.

Sorry for the delay. Will work on it

Herald added a project: Restricted Project. · View Herald TranscriptMar 22 2022, 8:08 AM
shraiysh added a comment.EditedApr 25 2022, 7:40 PM

Looks okay to me, please wait for Kiran/Valentin's comments. Also, will you be adding assembly format/verifier for this later?

The summary says map clause is not supported but there are map operands in the patch. Can we get these two in sync - we should either update summary or remove map-related operands.

Also, please rebase before further reviews.

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
588

please put variables in documentation within backticks(`). This is because when the documentation is rendered on mlir.llvm.org, $ and _ interact to give unexpected text if backticks are not used.

Looks okay to me, please wait for Kiran/Valentin's comments. Also, will you be adding an assembly format/verifier for this later?

Yes

The summary says the map clause is not supported but there are map operands in the patch. Can we get these two in sync - we should either update the summary or remove map-related operands.

Also, please rebase before further reviews.

Will do

Looks okay to me, please wait for Kiran/Valentin's comments. Also, will you be adding an assembly format/verifier for this later?

Yes

The summary says the map clause is not supported but there are map operands in the patch. Can we get these two in sync - we should either update the summary or remove map-related operands.

Also, please rebase before further reviews.

Will do

Do you or did you work on the rest of the lowering to OpenMPIRBuilder/LLVM IR? Might be good to have the broader pictures sometime before designing the operation.

Looks okay to me, please wait for Kiran/Valentin's comments. Also, will you be adding an assembly format/verifier for this later?

Yes

The summary says the map clause is not supported but there are map operands in the patch. Can we get these two in sync - we should either update the summary or remove map-related operands.

Also, please rebase before further reviews.

Will do

Do you or did you work on the rest of the lowering to OpenMPIRBuilder/LLVM IR? Might be good to have the broader pictures sometime before designing the operation.

I put the line of action that we had in mind ( based on the OpenACC translation) in the FLANG meeting with other team members. I will work on the same line. My thinking is to work on translation and see what we need to change in the operation API at this level. But, I will clean and update the patch based on the feedback as it is hanging around too long.

abidmalikwaterloo edited the summary of this revision. (Show Details)May 3 2022, 12:08 PM

Looks okay to me, please wait for Kiran/Valentin's comments. Also, will you be adding an assembly format/verifier for this later?

Yes

The summary says the map clause is not supported but there are map operands in the patch. Can we get these two in sync - we should either update the summary or remove map-related operands.

Also, please rebase before further reviews.

Will do

I have updated the summary.

I have updated the summary.

Do we have any comments on this? I can submit the "assembly format" later. Need the operation definition for the next step : lowering to LLVM IR

Please rebase, I cannot download this patch because it is too old :(

abidmalikwaterloo edited the summary of this revision. (Show Details)

Rebase the patch and clean some formatting as needed

Herald added a project: Restricted Project. · View Herald TranscriptMay 13 2022, 7:21 AM

Minor nits about documentation.

LGTM given that verifier and assembly format will be added soon for each of these as a separate patch soon. Please wait for atleast one more +1.

The OpenMP IRBuilder work does not have to wait for this patch to merge. You can start working on that while keeping this patch as a dependency.

clang/lib/Testing/CMakeLists.txt
6 ↗(On Diff #429235)

nit: Merge conflict. Please remove.

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
588

nit: Ping on this comment. The variable names have not been put in backticks and this is going to cause issues with autogenerated documentation.

594

Data mapping is very similar to data privatization. Would it be a good idea to push this to the frontends while we have not concretely decided on openmp dialect privatization/mapping? If you have an idea on how to implement mapping in OpenMP Dialect to LLVM IR maybe we can go ahead with this.

CC @kiranchandramohan for suggestions regarding privatization.

661

It is not clear which element in this list corresponds to which map type. It would be nice if we could either document that here, or have separate operands for each map type. (same for other two constructs too)

shraiysh requested changes to this revision.May 18 2022, 2:15 AM
This revision now requires changes to proceed.May 18 2022, 2:15 AM
clang/lib/Testing/CMakeLists.txt
33 ↗(On Diff #429235)

Are these okay? In D105584 these were not

shraiysh added inline comments.May 26 2022, 7:30 PM
clang/lib/Testing/CMakeLists.txt
33 ↗(On Diff #429235)

No, this is not okay. There is some issue with these patches and I don't know what it is, but these unrelated changes should not be seen here. Thank you for pointing this out :)

abidmalikwaterloo marked 2 inline comments as done.Jun 13 2022, 11:51 AM
abidmalikwaterloo added inline comments.
clang/lib/Testing/CMakeLists.txt
6 ↗(On Diff #429235)

removed

33 ↗(On Diff #429235)

removed them manually

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
594

@kiranchandramohan @raghavendhra I would like to keep it like this! Any comments

661

I feel keeping it in vector makes more sense. I will document it here. As per OpenMP Specifications:
The map-type can be to, from, tofrom, or alloc.

718

will document map type here as wekk

abidmalikwaterloo marked 2 inline comments as done.Jun 13 2022, 5:57 PM
abidmalikwaterloo added inline comments.
mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
661

Correction: map_type_modifier can be "always, close, and mapper"

Revised the patcg according to the reviews of the reviewers.
clean the code and add some comments

@abidmalikwaterloo ninja check-mlir is failing with your most upto date patch. Can you please double check?

Thanks!

Update ops.mlir test cases. llvm-lit is working and all tests are passing

Why not adding the assemblyFormat directly for these operations like your patch D105584?

Why not adding the assembly format directly for these operations like your patch D105584?

OK, I will do it!

Added assembly format
changed the type of mape_type_modifier

I just updated the patch. Something went wrong. I used arc diff --update <patch> for uploading. However, it seems it is not comparing the last submitted patch.

@abidmalikwaterloo Can you please check your last patch pushed for review? https://buildkite.com/llvm-project/diff-checks/builds/117796 states it can not apply your patch something to do with usage of diff --update <patch>? Can you please check?

abidmalikwaterloo added a comment.EditedAug 8 2022, 9:53 AM

@abidmalikwaterloo Can you please check your last patch pushed for review? https://buildkite.com/llvm-project/diff-checks/builds/117796 states it can not apply your patch something to do with the usage of diff --update <patch>? Can you please check?

@raghavendhra I tried to correct it but could not figure out the solution. Do you have any? I am not experienced with the phabricator framework. One solution is to submit another patch with all changes till today and abandon this one.

@abidmalikwaterloo Can you please check your last patch pushed for review? https://buildkite.com/llvm-project/diff-checks/builds/117796 states it can not apply your patch something to do with the usage of diff --update <patch>? Can you please check?

@raghavendhra I tried to correct it but could not figure out the solution. Do you have any? I am not experienced with the phabricator framework. One solution is to submit another patch with all changes till today and abandon this one.

Sorry, I am new to phabricator as well. I use "arc diff" to upload my revisions for review after addressing review comments. If no one responds probably I am fine with new review and abandoning this one.

@abidmalikwaterloo Can you please check your last patch pushed for review? https://buildkite.com/llvm-project/diff-checks/builds/117796 states it can not apply your patch something to do with the usage of diff --update <patch>? Can you please check?

@raghavendhra I tried to correct it but could not figure out the solution. Do you have any? I am not experienced with the phabricator framework. One solution is to submit another patch with all changes till today and abandon this one.

Sorry, I am new to phabricator as well. I use "arc diff" to upload my revisions for review after addressing review comments. If no one responds probably I am fine with new review and abandoning this one.

Did you try arc diff --update D105255 from your branch?

@abidmalikwaterloo Can you please check your last patch pushed for review? https://buildkite.com/llvm-project/diff-checks/builds/117796 states it can not apply your patch something to do with the usage of diff --update <patch>? Can you please check?

@raghavendhra I tried to correct it but could not figure out the solution. Do you have any? I am not experienced with the phabricator framework. One solution is to submit another patch with all changes till today and abandon this one.

Sorry, I am new to phabricator as well. I use "arc diff" to upload my revisions for review after addressing review comments. If no one responds probably I am fine with new review and abandoning this one.

Did you try arc diff --update D105255 from your branch?

yes, I tried this. Actually, I updated the patch. through this

@abidmalikwaterloo Can you please check your last patch pushed for review? https://buildkite.com/llvm-project/diff-checks/builds/117796 states it can not apply your patch something to do with the usage of diff --update <patch>? Can you please check?

@raghavendhra I tried to correct it but could not figure out the solution. Do you have any? I am not experienced with the phabricator framework. One solution is to submit another patch with all changes till today and abandon this one.

Sorry, I am new to phabricator as well. I use "arc diff" to upload my revisions for review after addressing review comments. If no one responds probably I am fine with new review and abandoning this one.

Did you try arc diff --update D105255 from your branch?

yes, I tried this. Actually, I updated the patch. through this

The problem is likely that the commit before the commit of this patch is not in tree,

The easiest way is to create a new branch from main and cherry-pick the commit you need for this patch on the top of it. Then you just use arc diff --update and it should work.

[MLIR][OpenMP] Added target data, exit data, and enter data operation definition for MLIR

[MLIR][OpenMP] Added target data, exit data, and enter data operation definition for MLIR

Looks like it's not the complete revision. There are almost no diffs anymore.

[MLIR][OpenMP] Added target data, exit data, and enter data operation definition for MLIR

Looks like it's not the complete revision. There are almost no diffs anymore.

My OS system crashed last week. I am working on it.

clementval resigned from this revision.Nov 2 2022, 1:53 PM
kiranchandramohan resigned from this revision.Nov 3 2022, 10:21 AM