Skip to content

Conversation

@simonbyrne
Copy link
Contributor

This fixes the onnxscript export for the irfft function.

Fixes onnx/onnx#5920, and adds support to the changes in onnx/onnx#7574 and microsoft/onnxruntime#27028.

Most of the diff is due to the onnx_opset generated code changes from onnx/onnx#5920. That can be removed if you would prefer.

@codecov
Copy link

codecov bot commented Jan 16, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 70.45%. Comparing base (1080d6a) to head (ccbf132).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
onnxscript/function_libs/torch_lib/ops/fft.py 66.66% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2770   +/-   ##
=======================================
  Coverage   70.45%   70.45%           
=======================================
  Files         228      228           
  Lines       27257    27258    +1     
  Branches     2760     2761    +1     
=======================================
+ Hits        19203    19204    +1     
  Misses       7102     7102           
  Partials      952      952           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

lintrunner found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Signed-off-by: Simon Byrne <sbyrne@nvidia.com>
@justinchuby justinchuby changed the title fix onnxscript export for irfft [torchlib] export for irfft Jan 23, 2026
@justinchuby justinchuby changed the title [torchlib] export for irfft [torchlib] Fix irfft Jan 23, 2026
Signed-off-by: Simon Byrne <sbyrne@nvidia.com>
Copy link
Collaborator

@justinchuby justinchuby left a comment

Choose a reason for hiding this comment

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

Thank you!

@justinchuby justinchuby added the module: torchlib Related to the torch/aten function lib in development label Jan 23, 2026
@simonbyrne
Copy link
Contributor Author

Unfortunately I think the tests won't pass until onnx/onnx#7574 and microsoft/onnxruntime#27028 are both merged.

@justinchuby
Copy link
Collaborator

justinchuby commented Jan 23, 2026

Could you make a special case for len(dim)=1, such that existing tests can pass? Or, do you think the original implementation were wrong (did not account for the neg frequencies)?

@justinchuby
Copy link
Collaborator

If you think the original impl was wrong. Please feel free to skip the tests

Signed-off-by: Simon Byrne <sbyrne@nvidia.com>
@simonbyrne
Copy link
Contributor Author

No, the existing implementation is definitely wrong. I added an xfail until onnx and onnxruntime can be updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: torchlib Related to the torch/aten function lib in development

Projects

Development

Successfully merging this pull request may close these issues.

Clarify DFT behavior when inverse=True

2 participants