Skip to content

Conversation

@peterbell10
Copy link
Collaborator

@peterbell10 peterbell10 commented Sep 17, 2020

Stack from ghstack:

Differential Revision: D23866715

[ghstack-poisoned]
@dr-ci
Copy link

dr-ci bot commented Sep 17, 2020

💊 CI failures summary and remediations

As of commit cd37267 (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 55 times.

peterbell10 added a commit to peterbell10/pytorch that referenced this pull request Sep 19, 2020
ghstack-source-id: 21b330d
Pull Request resolved: pytorch#44876
@mruberry mruberry added this to the 1.7.0 milestone Sep 22, 2020

Tensor fft(const Tensor& self, const int64_t signal_ndim, const bool normalized) {
TORCH_WARN_ONCE(
"torch.fft is deprecated and will be removed in pytorch 1.8. "
Copy link
Collaborator

Choose a reason for hiding this comment

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

Reviewing this now because I'd like to get this in for 1.7 (branch cut next week Tuesday) so torch.fft() is deprecated in 1.7 and can be removed in 1.8. Realistically this PR and the one it's stacked will need to be done and landable before Monday to make that happen. Let me know if there's something I can do to help, @peterbell10.

Overall this looks good but it needs two things:

  • the _tensor_docs.py for torch.fft also need a (deprecation) warning with language like this (except it can link to the torch.fft module documentation)
  • this warning should tell people to import torch.fft to get access to the functions that are replacing torch.fft()

Maybe something like:

"The function torch.fft is deprecated and will be removed in a future PyTorch release. Use the new torch.fft module functions, instead, by importing torch.fft and calling torch.fft.fft or torch.fft.fftn."

?

Copy link
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 updated the docs and warning message. Is there a policy on giving the version a deprecated function will be removed? I've put torch.fft() as expiring in 1.8 but left the others as "a furture PyTorch release" since that's not a priority.

Copy link
Collaborator

Choose a reason for hiding this comment

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

No policy. "In a future PyTorch release" gives us some latitude.


Tensor rfft(const Tensor& self, const int64_t signal_ndim, const bool normalized,
const bool onesided) {
TORCH_WARN_ONCE(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Deprecating torch.fft() is the priority (since its name conflicts with the module), but deprecating these is OK if the same pattern is followed. I.e.:

""The function torch.rfft is deprecated and will be removed in a future PyTorch release. Use the new torch.fft module functions, instead, by importing torch.fft and calling torch.fft.rfft or torch.fft.rfftn."

And also updating the torch.rfft and torch.irfft docs.

.. deprecated:: 1.7.0
The function :func:`torch.fft` is deprecated and will be removed in a
PyTorch 1.8. Use the new :mod:`torch.fft` module functions instead, by
importing :mod:`torch.fft` and calling :func:`torch.fft.fft` or
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'll note that torch.fft unfortunately links to the function instead of the module. I was hoping :mod: would disambiguate, but I guess it's unlikely to work properly until the function is removed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Darn. I guess we can just write the url by hand for now? It's very unlikely to change.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Used a reference so I didn't have to hard-code the URL.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Smart solution.

@ailzhang ailzhang added the triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module label Sep 22, 2020
Copy link
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.

Nice work, @peterbell10. Just a few minor corrections to be applied. Ping me when this is ready.

@peterbell10
Copy link
Collaborator Author

@mruberry I've corrected the warnings.

The inverse of this function is :func:`~torch.ifft`.
.. deprecated:: 1.7.0
The function :func:`torch.fft` is deprecated and will be removed in a
Copy link
Collaborator

Choose a reason for hiding this comment

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

"in a PyTorch 1.8" -> "in PyTorch 1.8"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@mruberry fixed.

Copy link
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.

Awesome! Thanks @peterbell10!

@codecov
Copy link

codecov bot commented Sep 23, 2020

Codecov Report

Merging #44876 into gh/peterbell10/11/base will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@                   Coverage Diff                   @@
##           gh/peterbell10/11/base   #44876   +/-   ##
=======================================================
  Coverage                   68.08%   68.08%           
=======================================================
  Files                         393      393           
  Lines                       50765    50765           
=======================================================
+ Hits                        34564    34565    +1     
+ Misses                      16201    16200    -1     
Impacted Files Coverage Δ
torch/_torch_docs.py 100.00% <ø> (ø)
torch/testing/_internal/expecttest.py 78.57% <0.00%> (+1.02%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9bccee0...cd37267. Read the comment docs.

@facebook-github-bot
Copy link
Contributor

@mruberry merged this pull request in dc67b47.

@facebook-github-bot facebook-github-bot deleted the gh/peterbell10/11/head branch September 27, 2020 14:15
@fritzo
Copy link
Collaborator

fritzo commented Oct 28, 2020

Note the 1.7 release notes state

Please use torch.fft.foo as a drop-in replacement for torch.foo for the following functions: fft, ifft, rfft and irfft.

however the rfft and irfft signatures have changed. Would PyTorch devs have time to update release notes with old-versus-new translations for these changed functions?

@mruberry
Copy link
Collaborator

Note the 1.7 release notes state

Please use torch.fft.foo as a drop-in replacement for torch.foo for the following functions: fft, ifft, rfft and irfft.

however the rfft and irfft signatures have changed. Would PyTorch devs have time to update release notes with old-versus-new translations for these changed functions?

The release notes are, unfortunately, incorrect. All of these functions are different from each other, as described in the Wiki article here: https://github.com/pytorch/pytorch/wiki/The-torch.fft-module-in-PyTorch-1.7. You can translate rfft and irfft calls to rfftn and irfftn calls, however.

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

Labels

Merged open source triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants