8000 [Inductor][CPP] Fix Codegen Issue when Parallel Reduction under the vectorization by leslie-fang-intel · Pull Request #151887 · pytorch/pytorch · GitHub
[go: up one dir, main page]

Skip to content

[Inductor][CPP] Fix Codegen Issue when Parallel Reduction under the vectorization #151887

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

Conversation

leslie-fang-intel
Copy link
Collaborator
@leslie-fang-intel leslie-fang-intel commented Apr 22, 2025

Stack from ghstack (oldest at bottom):

Summary
Fixes #151290 and #151523, which are regressions introduced by #144020. That PR enabled parallelization at the inner loop level.

However, a currently unsupported case arises when parallel reduction occurs under the vectorization loop level, specifically in patterns like:

for vec_loop_level:
    do_parallel_reduction

In such cases, a temporary buffer tmp_acc_array is allocated for tail scalar kernels, and another temporary buffer tmp_acc_array is also defined for parallel reduction. This results in a conflict due to overlapping temporary buffers. This PR disables the problematic case to avoid the conflict until proper support is implemented.

Test Plan

python test/inductor/test_flex_attention.py -k test_make_block_mask_cpu
python test/inductor/test_cpu_repro.py -k test_parallel_reduction_vectorization

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

[ghstack-poisoned]
Copy link
pytorch-bot bot commented Apr 22, 2025

🔗 Helpful Links

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

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

✅ You can merge normally! (1 Unrelated Failure)

As of commit e1cc555 with merge base 9680016 (image):

BROKEN TRUNK - The following job failed but were present on the merge base:

👉 Rebase onto the `viable/strict` branch to avoid these failures

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

leslie-fang-intel added a commit that referenced this pull request Apr 22, 2025
…ectorization

ghstack-source-id: 036aa97
Pull Request resolved: #151887
@leslie-fang-intel leslie-fang-intel added topic: not user facing topic category ciflow/trunk Trigger trunk jobs on your pull request labels Apr 22, 2025
@leslie-fang-intel leslie-fang-intel marked this pull request as draft April 22, 2025 05:55
@leslie-fang-intel leslie-fang-intel marked this pull request as ready for review April 22, 2025 07:28
@leslie-fang-intel
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

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.

4 participants
0