Skip to content

BE: Use NotImplementedError/TypeError for unsupported FFT dtypes - #192349

Closed
malfet wants to merge 6 commits into
gh/malfet/1003/basefrom
gh/malfet/1003/head
Closed

malfet wants to merge 6 commits into
gh/malfet/1003/basefrom
gh/malfet/1003/head

Conversation

@malfet

@malfet malfet commented Aug 6, 2026 •

Copy link
Copy Markdown
Collaborator

Stack from ghstack (oldest at bottom):

FFT ops rejected unsupported dtypes with a plain RuntimeError. Half precision and integer stft become NotImplementedError (unimplemented, not undefined); a complex input to rfft/ihfft/rfftn or a non-complex input to istft is a domain error and becomes TypeError. Covers the native helpers, the MKL/pocketfft r2c kernels and the refs.

Authored with the assistance of Claude (Claude Code).

Co-Authored-By: Claude Opus 4.8 [email protected]

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit 7c3e807 with merge base b35bd63 (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]
malfet added 2 commits August 8, 2026 05:22
[ghstack-poisoned]
[ghstack-poisoned]
malfet added a commit that referenced this pull request Aug 10, 2026
FFT ops rejected unsupported dtypes with a plain RuntimeError. Half precision and integer stft become NotImplementedError (unimplemented, not undefined); a complex input to rfft/ihfft/rfftn or a non-complex input to istft is a domain error and becomes TypeError. Covers the native helpers, the MKL/pocketfft r2c kernels and the refs.

Authored with the assistance of Claude (Claude Code).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
ghstack-source-id: b01993b
Pull-Request: #192349
[ghstack-poisoned]
malfet added a commit that referenced this pull request Aug 10, 2026
FFT ops rejected unsupported dtypes with a plain RuntimeError. Half precision and integer stft become NotImplementedError (unimplemented, not undefined); a complex input to rfft/ihfft/rfftn or a non-complex input to istft is a domain error and becomes TypeError. Covers the native helpers, the MKL/pocketfft r2c kernels and the refs.

Authored with the assistance of Claude (Claude Code).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
ghstack-source-id: 4213bc5
Pull-Request: #192349
[ghstack-poisoned]
@malfet

malfet commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Aug 10, 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

pytorchmergebot pushed a commit that referenced this pull request Aug 10, 2026
#186780 introduced number of regressions to the logic, namely it only rebuilded one file and assumed its part of torch_python, rendering the tool useless for ATen changes (torch_cpu, torch_cuda) and also compile .metal shaders with line information.

Build the plan from Ninja's command graph and transitively run every command that consumes the requested source's outputs. This restores rebuilding through intermediate libraries and custom steps, including Metal commands, while limiting debug flags to the requested source compilation.

Extend test accordingly

Authored with the assistance of Codex (OpenAI).
Pull Request resolved: #192729
Approved by: https://github.com/atalman, https://github.com/albanD
ghstack dependencies: #192349
ankitbhrdwj pushed a commit to ankitbhrdwj/pytorch that referenced this pull request Aug 12, 2026
…orch#192349)

FFT ops rejected unsupported dtypes with a plain RuntimeError. Half precision and integer stft become NotImplementedError (unimplemented, not undefined); a complex input to rfft/ihfft/rfftn or a non-complex input to istft is a domain error and becomes TypeError. Covers the native helpers, the MKL/pocketfft r2c kernels and the refs.

Authored with the assistance of Claude (Claude Code).

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Pull Request resolved: pytorch#192349
Approved by: https://github.com/Skylion007
ankitbhrdwj pushed a commit to ankitbhrdwj/pytorch that referenced this pull request Aug 12, 2026
pytorch#186780 introduced number of regressions to the logic, namely it only rebuilded one file and assumed its part of torch_python, rendering the tool useless for ATen changes (torch_cpu, torch_cuda) and also compile .metal shaders with line information.

Build the plan from Ninja's command graph and transitively run every command that consumes the requested source's outputs. This restores rebuilding through intermediate libraries and custom steps, including Metal commands, while limiting debug flags to the requested source compilation.

Extend test accordingly

Authored with the assistance of Codex (OpenAI).
Pull Request resolved: pytorch#192729
Approved by: https://github.com/atalman, https://github.com/albanD
ghstack dependencies: pytorch#192349
copybara-service Bot pushed a commit to google-pytorch/torch_tpu that referenced this pull request Aug 14, 2026
…id signature suppression

Updated `print_reproducer` to catch `TypeError` and `NotImplementedError` in addition to `RuntimeError`. This accommodates upstream changes where domain errors (such as supplying complex inputs to real-to-complex FFTs) and unsupported dtypes now raise these specific exceptions during FX tracing, preventing test harness crashes on unsupported signature samples.

Upstream PyTorch (pytorch/pytorch#192349) refined FFT operator error handling, moving from generic `RuntimeError` to specific types:
  - `TypeError` for domain violations (e.g., passing complex inputs to `rfft`).
  - `NotImplementedError` for unsupported dtypes (e.g., half precision or unimplemented kernels).

Generated from cl/964834640

PiperOrigin-RevId: 964834640
copybara-service Bot pushed a commit to google-pytorch/torch_tpu that referenced this pull request Aug 14, 2026
…ature suppression

  Updated `print_reproducer` to catch all `Exception`s instead of a specific list of error types. This makes reproducer generation robust against upstream refinements to error types (e.g., moving from `RuntimeError` to `TypeError` or `NotImplementedError`), preventing trace failures on invalid samples from crashing the test harness.

For example, upstream PyTorch: (pytorch/pytorch#192349) refined FFT operator error handling, moving from generic `RuntimeError` to specific types:
  - `TypeError` for domain violations (e.g., passing complex inputs to `rfft`).
  - `NotImplementedError` for unsupported dtypes (e.g., half precision or unimplemented kernels).

Generated from cl/964834640

PiperOrigin-RevId: 964834640
copybara-service Bot pushed a commit to google-pytorch/torch_tpu that referenced this pull request Aug 14, 2026
…ature suppression

  Updated `print_reproducer` to catch all `Exception`s instead of a specific list of error types. This makes reproducer generation robust against upstream refinements to error types (e.g., moving from `RuntimeError` to `TypeError` or `NotImplementedError`), preventing trace failures on invalid samples from crashing the test harness.

For example, upstream PyTorch: (pytorch/pytorch#192349) refined FFT operator error handling, moving from generic `RuntimeError` to specific types:
  - `TypeError` for domain violations (e.g., passing complex inputs to `rfft`).
  - `NotImplementedError` for unsupported dtypes (e.g., half precision or unimplemented kernels).

Generated from cl/964834640

PiperOrigin-RevId: 964834640
copybara-service Bot pushed a commit to google-pytorch/torch_tpu that referenced this pull request Aug 14, 2026
…ature suppression

  Updated `print_reproducer` to catch all `Exception`s instead of a specific list of error types. This makes reproducer generation robust against upstream refinements to error types (e.g., moving from `RuntimeError` to `TypeError` or `NotImplementedError`), preventing trace failures on invalid samples from crashing the test harness.

For example, upstream PyTorch: (pytorch/pytorch#192349) refined FFT operator error handling, moving from generic `RuntimeError` to specific types:
  - `TypeError` for domain violations (e.g., passing complex inputs to `rfft`).
  - `NotImplementedError` for unsupported dtypes (e.g., half precision or unimplemented kernels).

Generated from cl/964926357

PiperOrigin-RevId: 964926357
@github-actions
github-actions Bot deleted the gh/malfet/1003/head branch November 2, 2026 01:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ciflow/trunk Trigger trunk jobs on your pull request Merged open source topic: not user facing topic category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants