-
Notifications
You must be signed in to change notification settings - Fork 88
Implement aten.stft #2645
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
base: main
Are you sure you want to change the base?
Implement aten.stft #2645
Conversation
|
@microsoft-github-policy-service agree |
|
pytorch/pytorch#147052 (comment)
I think this PR’s implementation already uses result = op.STFT(signal, frame_step_const, window, frame_length_const, onesided=onesided)So I don’t think an decay to |
|
Hi! pytorch/pytorch#147052 (comment)
Could you elaborate a bit on this comment at your convenience? (If you think this simplification is necessary.) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements the aten::stft (Short-Time Fourier Transform) operator to resolve issue #147052. The implementation includes handling for various optional parameters like hop_length, win_length, window, normalized, onesided, and return_complex.
Key changes:
- Added STFT operator implementation with helper functions for batch dimension handling, window centering, and FFT normalization
- Registered the operator in test data with appropriate tolerance settings and xfail for float16 dtype
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| onnxscript/function_libs/torch_lib/ops/core.py | Implements aten_stft and five helper functions for STFT processing |
| tests/function_libs/torch_lib/ops_test_data.py | Registers the new operator in test suite with tolerance and xfail configuration |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2645 +/- ##
=======================================
Coverage 70.43% 70.43%
=======================================
Files 224 224
Lines 26778 26833 +55
Branches 2680 2689 +9
=======================================
+ Hits 18862 18901 +39
- Misses 6985 6997 +12
- Partials 931 935 +4 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor comments and this should be the final pass.
cc @justinchuby I remember you said something stft implementation was wrong. This is heavily following the original one. Would you care share about your comments?
|
Thanks - I need to read this more closely to remind myself what was going on then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. I don't have a better idea
|
@moatom Could you do a final pass, and make sure lint is passing. |
|
@titaiwangms I resolved all of them. Could you please confirm when you have a moment? |
|
If possible, could you help add a few tests to https://github.com/microsoft/onnxscript/blob/main/tests/function_libs/torch_lib/e2e_ops_tests.py ? Thanks a lot! |
DONE |
Fixed pytorch/pytorch#147052