Skip to content

Split loops to work around loop vectorizer weakness #3406

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

Closed
wants to merge 1 commit into from

Conversation

MatzeB
Copy link
Contributor

@MatzeB MatzeB commented Nov 22, 2024

Summary:
I noticed LLVM loop vectorization making bad calls for loops with trip-counts that are not a multiple of the preferred vector size.

This can be worked around by manually splitting into two loops with the first one processing in multiples of the preferred block size and a separate loop for the remainder.

Reviewed By: helloguo

Differential Revision: D65574038

Copy link

netlify bot commented Nov 22, 2024

Deploy Preview for pytorch-fbgemm-docs ready!

Name Link
🔨 Latest commit c3460f5
🔍 Latest deploy log https://app.netlify.com/sites/pytorch-fbgemm-docs/deploys/6740cf901c84ba00083f14a4
😎 Deploy Preview https://deploy-preview-3406--pytorch-fbgemm-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D65574038

Summary:

X-link: facebookresearch/FBGEMM#494

I noticed LLVM loop vectorization making bad calls for loops with trip-counts that are not a multiple of the preferred vector size.

This can be worked around by manually splitting into two loops with the first one processing in multiples of the preferred block size and a separate loop for the remainder.

Reviewed By: helloguo

Differential Revision: D65574038
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D65574038

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in f110630.

q10 pushed a commit to q10/FBGEMM that referenced this pull request Apr 10, 2025
Summary:
X-link: pytorch#3406

Pull Request resolved: facebookresearch/FBGEMM#494

I noticed LLVM loop vectorization making bad calls for loops with trip-counts that are not a multiple of the preferred vector size.

This can be worked around by manually splitting into two loops with the first one processing in multiples of the preferred block size and a separate loop for the remainder.

Reviewed By: helloguo

Differential Revision: D65574038

fbshipit-source-id: 491c63954b0ceb49eb65c4afb6f1a93706dfa525
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.

2 participants