Skip to content

Use new FFT operators in stft#47601

Closed
peterbell10 wants to merge 12 commits intogh/peterbell10/24/basefrom
gh/peterbell10/24/head
Closed

Use new FFT operators in stft#47601
peterbell10 wants to merge 12 commits intogh/peterbell10/24/basefrom
gh/peterbell10/24/head

Conversation

@peterbell10
Copy link
Copy Markdown
Collaborator

@peterbell10 peterbell10 commented Nov 9, 2020

Fixes #42175 (comment)

Stack from ghstack:

Differential Revision: D25457217

[ghstack-poisoned]
@dr-ci
Copy link
Copy Markdown

dr-ci Bot commented Nov 9, 2020

💊 CI failures summary and remediations

As of commit f4cc17c (more details on the Dr. CI page):


💚 💚 Looks good so far! There are no failures yet. 💚 💚


This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.

Please report bugs/suggestions on the GitHub issue tracker or post in the (internal) Dr. CI Users group.

See how this bot performed.

This comment has been revised 41 times.

peterbell10 added a commit that referenced this pull request Nov 11, 2020
ghstack-source-id: a4329b8
Pull Request resolved: #47601
peterbell10 added a commit that referenced this pull request Nov 11, 2020
ghstack-source-id: 06a8974
Pull Request resolved: #47601
peterbell10 added a commit that referenced this pull request Nov 21, 2020
ghstack-source-id: 035805a
Pull Request resolved: #47601
facebook-github-bot pushed a commit that referenced this pull request Dec 5, 2020
Summary:
Ref #42175

This removes the 4 deprecated spectral functions: `torch.{fft,rfft,ifft,irfft}`. `torch.fft` is also now imported by by default.

The actual `at::native` functions are still used in `torch.stft` so can't be full removed yet. But will once #47601 has been merged.

Pull Request resolved: #48594

Reviewed By: heitorschueroff

Differential Revision: D25298929

Pulled By: mruberry

fbshipit-source-id: e36737fe8192fcd16f7e6310f8b49de478e63bf0
Comment thread aten/src/ATen/native/SpectralOps.cpp Outdated
}
}

// Like view_as_complex but may clone if the input can't be directly viewed as complex
Copy link
Copy Markdown
Collaborator

@mruberry mruberry Dec 8, 2020

Choose a reason for hiding this comment

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

Can you elaborate on how you expect this function to be used?

It's a little odd to me that it's so aggressive at coercing tensors to complex, but I guess that makes sense for the current state deprecated state of stft and istft. If that's the case, however, the comment should probably clarify.

Is this the right PR to update stft to the next stage in the deprecation process where it requires return_complex? Also, should we deprecate istft accept a float tensor mimicking a half tensor now? Then after 1.8 we can have stft always return a complex tensor and istft always accept a complex tensor.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

It's a little odd to me that it's so aggressive at coercing tensors to complex

I don't see the issue. It converts any tensor from the old complex format, to a complex dtype tensor. view_as_complex is limited by the fact that it has to create a view of the original tensor but there's no reason to force that limitation onto the user now. Would it be clearer if the comment didn't mention view_as_complex?

Is this the right PR to update stft to the next stage in the deprecation process where it requires return_complex?

That doesn't simplify anything in this PR and I guess could hold up merging, so I would say no. I can open a separate PR for it though.

Also, should we deprecate istft accept a float tensor mimicking a half tensor now? Then after 1.8 we can have stft always return a complex tensor and istft always accept a complex tensor.

Sure, I can do that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A separate PR for those latter issues sounds good.

As for this particular function, mentioned view_as_complex in the comment seems fine. Maybe just making the comment more specific by saying that this function is only intended to be used for istft and picking a name for it that matches? That is, I would think that once istft is updated to ONLY accept complex inputs this function will be killed, right?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

@mruberry I've reworded the comment, PTAL.

@mruberry mruberry self-requested a review December 10, 2020 06:52
Copy link
Copy Markdown
Collaborator

@mruberry mruberry left a comment

Choose a reason for hiding this comment

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

Cool! Thanks @peterbell10!

@facebook-github-bot
Copy link
Copy Markdown
Contributor

@mruberry merged this pull request in 524adfb.

@facebook-github-bot facebook-github-bot deleted the gh/peterbell10/24/head branch December 14, 2020 15:17
peterbell10 added a commit to peterbell10/pytorch that referenced this pull request Dec 15, 2020
ghstack-source-id: 4391fdf
Pull Request resolved: pytorch#47601
@peterbell10 peterbell10 mentioned this pull request Dec 16, 2020
37 tasks
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Ref pytorch#42175

This removes the 4 deprecated spectral functions: `torch.{fft,rfft,ifft,irfft}`. `torch.fft` is also now imported by by default.

The actual `at::native` functions are still used in `torch.stft` so can't be full removed yet. But will once pytorch#47601 has been merged.

Pull Request resolved: pytorch#48594

Reviewed By: heitorschueroff

Differential Revision: D25298929

Pulled By: mruberry

fbshipit-source-id: e36737fe8192fcd16f7e6310f8b49de478e63bf0
laurentdupin pushed a commit to laurentdupin/pytorch that referenced this pull request Apr 24, 2026
Summary:
Pull Request resolved: pytorch#47601

Fixes pytorch#42175 (comment)

Test Plan: Imported from OSS

Reviewed By: ngimel

Differential Revision: D25457217

Pulled By: mruberry

fbshipit-source-id: 455d216edd0b962eb7967ecb47cccc8d6865975b
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