Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AMD] Enable reordering across ops with nested regions #5363

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

karthik-man
Copy link
Contributor

@karthik-man karthik-man commented Dec 7, 2024

Re-enable reordering across ops with nested regions.

  • This PR reverts the changes in PR5203 that prevents reordering across scf ops
  • Passes omitUsesFromAbove=false to mlir::getBackwardSlice(). This ensures that the backward slice captures the values used from above, in ops with nested regions, like scf ops.

New contributor declaration

  • I am not making a trivial change, such as fixing a typo in a comment.

  • I have written a PR description following these
    rules.

  • I have run pre-commit run --from-ref origin/main --to-ref HEAD.

  • Select one of the following.

    • I have added tests.
      • /test for lit tests
      • /unittest for C++ tests
      • /python/test for end-to-end tests
    • This PR does not need a test because the lit test added in PR5203 already makes sure that we don't hoist scf ops above its dependencies
  • Select one of the following.

    • [x ] I have not added any lit tests.
    • The lit tests I have added follow these best practices,
      including the "tests should be minimal" section. (Usually running Python code
      and using the instructions it generates is not minimal.)

@karthik-man
Copy link
Contributor Author

@antiagainst @sjw36 This is the fix we discussed in PR5203. Kindly let me know if it looks good.

Copy link
Contributor

@sjw36 sjw36 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @karthik-man ! This feature does the right thing!

FYI, it does however enable more reorders, so it may cause changes that affect performance.

@karthik-man
Copy link
Contributor Author

Thanks @karthik-man ! This feature does the right thing!

FYI, it does however enable more reorders, so it may cause changes that affect performance.

Thanks for the review. I don't think that this enables more reorders when compared to the state of this pass before PR5203.
Prior to PR5203, ops with regions were being reordered without taking into consideration the values flowing into the regions. This change only allows reorderings that respect the data dependencies, including nested regions.

@sjw36
Copy link
Contributor

sjw36 commented Dec 13, 2024

Thanks for the review. I don't think that this enables more reorders when compared to the state of this pass before PR5203. Prior to PR5203, ops with regions were being reordered without taking into consideration the values flowing into the regions. This change only allows reorderings that respect the data dependencies, including nested regions.

Right, just the cases that used to crash, now will pass and reorder those cases.

@antiagainst antiagainst merged commit 0b18690 into triton-lang:main Dec 13, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants