Skip to content

Fix stride handling in FFT meta registrations#175731

Closed
XAheli wants to merge 3 commits intopytorch:mainfrom
XAheli:fix/fft-stride-compilation
Closed

Fix stride handling in FFT meta registrations#175731
XAheli wants to merge 3 commits intopytorch:mainfrom
XAheli:fix/fft-stride-compilation

Conversation

@XAheli
Copy link
Copy Markdown
Contributor

@XAheli XAheli commented Feb 25, 2026

Fixes #167636

Summary

  • Fix meta_fft_r2c missing CPU/MKL code path
  • Fix _sort_dims no-op also add reverse=True to match C++ descending sort
  • Fix _exec_fft signal dim ordering
  • Add PocketFFT early return paths for meta_fft_c2c and meta_fft_c2r on CPU without MKL
  • Move FFT ops from CHECK_STRIDES_SKIPS to CHECK_STRIDES in test_meta.py
  • Use torch.backends.mkl.is_available() per this

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

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Feb 25, 2026

🔗 Helpful Links

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

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

✅ No Failures

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

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

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Feb 25, 2026

This PR needs a release notes: label

If your changes are user facing and intended to be a part of release notes, please use a label starting with release notes:.

If not, please add the topic: not user facing label.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "topic: not user facing"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Feb 25, 2026

CLA Signed

The committers listed above are authorized under a signed CLA.

@XAheli
Copy link
Copy Markdown
Contributor Author

XAheli commented Feb 25, 2026

@pytorchbot label "module: inductor"

@XAheli
Copy link
Copy Markdown
Contributor Author

XAheli commented Feb 25, 2026

@pytorchbot label "module: fft"

@isuruf
Copy link
Copy Markdown
Collaborator

isuruf commented Mar 2, 2026

@pytorchbot merge

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 2, 2026

Pull workflow has not been scheduled for the PR yet. It could be because author doesn't have permissions to run those or skip-checks keywords were added to PR/commits, aborting merge. Please get/give approval for the workflows and/or remove skip ci decorators before next merge attempt. If you think this is a mistake, please contact PyTorch Dev Infra.

@isuruf
Copy link
Copy Markdown
Collaborator

isuruf commented Mar 2, 2026

@pytorchbot merge

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 2, 2026

Pull workflow has not been scheduled for the PR yet. It could be because author doesn't have permissions to run those or skip-checks keywords were added to PR/commits, aborting merge. Please get/give approval for the workflows and/or remove skip ci decorators before next merge attempt. If you think this is a mistake, please contact PyTorch Dev Infra.

@isuruf
Copy link
Copy Markdown
Collaborator

isuruf commented Mar 9, 2026

@pytorchbot merge

@pytorch-bot
Copy link
Copy Markdown

pytorch-bot bot commented Mar 9, 2026

Pull workflow has not been scheduled for the PR yet. It could be because author doesn't have permissions to run those or skip-checks keywords were added to PR/commits, aborting merge. Please get/give approval for the workflows and/or remove skip ci decorators before next merge attempt. If you think this is a mistake, please contact PyTorch Dev Infra.

@XAheli XAheli force-pushed the fix/fft-stride-compilation branch from b41647d to feb5132 Compare March 9, 2026 19:46
@XAheli XAheli requested a review from isuruf March 10, 2026 05:16
@isuruf
Copy link
Copy Markdown
Collaborator

isuruf commented Mar 12, 2026

@pytorchbot merge

@pytorch-bot pytorch-bot bot added the ciflow/trunk Trigger trunk jobs on your pull request label Mar 12, 2026
@pytorchmergebot
Copy link
Copy Markdown
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

EmanueleCoradin pushed a commit to EmanueleCoradin/pytorch that referenced this pull request Mar 30, 2026
Fixes pytorch#167636

#### Summary
- Fix `meta_fft_r2c` missing CPU/MKL code path
- Fix `_sort_dims` no-op also add `reverse=True` to match C++ descending sort
- Fix `_exec_fft` signal dim ordering
- Add PocketFFT early return paths for `meta_fft_c2c` and `meta_fft_c2r` on CPU without MKL
- Move FFT ops from `CHECK_STRIDES_SKIPS` to `CHECK_STRIDES` in `test_meta.py`
- Use `torch.backends.mkl.is_available()` per [this](pytorch#167636 (comment))

Pull Request resolved: pytorch#175731
Approved by: https://github.com/isuruf
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.

TorchDynamo Compilation Error: Invalid Stride Handling for FFT in Custom Model During Compilation

4 participants