Skip to content

[Inductor] simplify indexing_exprs in LoopBody._init_with_copy#135574

Closed
jiayisunx wants to merge 2 commits intogh/jiayisunx/29/basefrom
gh/jiayisunx/29/head
Closed

[Inductor] simplify indexing_exprs in LoopBody._init_with_copy#135574
jiayisunx wants to merge 2 commits intogh/jiayisunx/29/basefrom
gh/jiayisunx/29/head

Conversation

@jiayisunx
Copy link
Collaborator

@jiayisunx jiayisunx commented Sep 10, 2024

Stack from ghstack (oldest at bottom):

This PR uses var_ranges information to simplify indexing_exprs in LoopBody._init_with_copy to to reduce occurrences of FloorDiv and ModularIndexing in the indexing_exprs.

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire @chauhang

[ghstack-poisoned]
@pytorch-bot
Copy link

pytorch-bot bot commented Sep 10, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/135574

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit 6506095 with merge base 9902b34 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

[ghstack-poisoned]
jiayisunx added a commit that referenced this pull request Sep 10, 2024
@jiayisunx jiayisunx added the topic: not user facing topic category label Sep 10, 2024
@jiayisunx jiayisunx marked this pull request as ready for review September 10, 2024 12:16
@jiayisunx jiayisunx added the ciflow/trunk Trigger trunk jobs on your pull request label Sep 10, 2024
)

@config.patch("cpp.enable_tiling_heuristics", False)
def test_group_norm_vec(self):
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the UT also need to check the vectorization is as expected instead of scalarization as fallback

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

we have checked the number of vec kernels here: https://github.com/pytorch/pytorch/pull/135574/files/650609529833142b18d72b7f35ae199228fb896c#diff-042e454a3b5e4ae5aea2ff41066b5646ab068ca92b7e0adb5f9a81c6d7cec422L3446
I removed the patch that disabled the tiling select heuristic, now the UT can correctly check the vectorization is as expected.

Copy link
Collaborator

@jgong5 jgong5 left a comment

Choose a reason for hiding this comment

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

Please improve UT per @leslie-fang-intel 's suggestion.

@jiayisunx
Copy link
Collaborator Author

@jansel , could you please review this PR? Thanks!

@jiayisunx
Copy link
Collaborator Author

@pytorchbot merge

@pytorchmergebot
Copy link
Collaborator

Merge started

Your change will be merged once all checks pass (ETA 0-4 Hours).

Learn more about merging in the wiki.

Questions? Feedback? Please reach out to the PyTorch DevX Team

Advanced Debugging
Check the merge workflow status
here

pytorch-bot bot pushed a commit that referenced this pull request Sep 13, 2024
This PR uses `var_ranges` information to simplify `indexing_exprs` in `LoopBody._init_with_copy` to to reduce occurrences of `FloorDiv` and `ModularIndexing` in the `indexing_exprs`.

Pull Request resolved: #135574
Approved by: https://github.com/jgong5, https://github.com/leslie-fang-intel, https://github.com/jansel
enter-ctrl9 pushed a commit to enter-ctrl9/pytorch11 that referenced this pull request Sep 15, 2024
atalman pushed a commit that referenced this pull request Sep 20, 2024
…) (#135935)

This PR uses `var_ranges` information to simplify `indexing_exprs` in `LoopBody._init_with_copy` to to reduce occurrences of `FloorDiv` and `ModularIndexing` in the `indexing_exprs`.

Pull Request resolved: #135574
Approved by: https://github.com/jgong5, https://github.com/leslie-fang-intel, https://github.com/jansel
Chao1Han pushed a commit to Chao1Han/pytorch that referenced this pull request Sep 20, 2024
…ch#135574)

This PR uses `var_ranges` information to simplify `indexing_exprs` in `LoopBody._init_with_copy` to to reduce occurrences of `FloorDiv` and `ModularIndexing` in the `indexing_exprs`.

Pull Request resolved: pytorch#135574
Approved by: https://github.com/jgong5, https://github.com/leslie-fang-intel, https://github.com/jansel
@github-actions github-actions bot deleted the gh/jiayisunx/29/head branch October 13, 2024 02:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants