Skip to content

Add plan argument to 1D FFT functions in cupyx.scipy.fftpack - #2033

Merged
asi1024 merged 9 commits into
cupy:masterfrom
leofang:fft_plan_arg_backup
Feb 26, 2019
Merged

asi1024 merged 9 commits into
cupy:masterfrom
leofang:fft_plan_arg_backup

Conversation

@leofang

@leofang leofang commented Feb 16, 2019 •

Copy link
Copy Markdown
Member

This is an accompanying PR with #1942 to address the performance issue discussed in #1669. In this PR I changed the signatures for the following functions:

  • cupyx.scipy.fftpack.fft
  • cupyx.scipy.fftpack.ifft

so that they accept a plan argument (defaulted to None). Another change is made to cupyx.scipy.fftpack.get_fft_plan, introduced #1942, so that it can return either a cuFFT Plan1d or PlanNd --- this is a design choice that I'd like to have feedbacks from @grlee77 and perhaps @asi1024. Thanks.

Comment thread cupy/cuda/cufft.pyx Resolved

@grlee77 grlee77 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks for adding this @leofang. It looks good to me aside from some minor comments.

Comment thread cupy/fft/fft.py Resolved
Comment thread cupy/fft/fft.py Resolved
Comment thread cupyx/scipy/fftpack/fft.py Resolved
Comment thread cupyx/scipy/fftpack/fft.py Resolved
Comment thread cupyx/scipy/fftpack/fft.py Resolved
Comment thread cupyx/scipy/fftpack/fft.py Resolved
Comment thread cupy/cuda/cufft.pyx Resolved
@asi1024 asi1024 added the cat:feature New features/APIs label Feb 25, 2019
@asi1024

asi1024 commented Feb 25, 2019

Copy link
Copy Markdown
Member

LGTM excepts the comment.

@asi1024

asi1024 commented Feb 25, 2019

Copy link
Copy Markdown
Member

Jenkins, test this please.

@chainer-ci

Copy link
Copy Markdown
Member

Jenkins CI test (for commit e0a2c2e, target branch master) failed with status FAILURE.
(For contributors, please wait until the reviewer confirms the details of the error.)

@asi1024

asi1024 commented Feb 26, 2019

Copy link
Copy Markdown
Member

Sorry, we want to support this feature experimentally. Could you fix the docstrings?

@asi1024

asi1024 commented Feb 26, 2019

Copy link
Copy Markdown
Member

The above Jenkins failure is irrelevant to this PR.

@leofang

leofang commented Feb 26, 2019 via email

Copy link
Copy Markdown
Member Author

@asi1024

asi1024 commented Feb 26, 2019

Copy link
Copy Markdown
Member

It doesn't mean that we do not want this feature, but merely that the interface can be changed in the future because this argument is not supported by SciPy.

@leofang

leofang commented Feb 26, 2019

Copy link
Copy Markdown
Member Author

Hi @asi1024,

Quoting from my previous PR #1942:

...These are the two deviations from the scipy.fftpack counterpart. But for users don't care about plans, the API is guaranteed compatible

With this in mind, please give me instructions so as to change the docstrings. Thanks.

@leofang

leofang commented Feb 26, 2019 •

Copy link
Copy Markdown
Member Author

By the way, please also take #2035 into consideration when making the suggestions. Likely what you have in mind will need a commit to both PRs. Thanks.

@asi1024 asi1024 mentioned this pull request Feb 26, 2019
@asi1024

asi1024 commented Feb 26, 2019

Copy link
Copy Markdown
Member

get_fft_plan is fine, but we want to make the plan argument in fft and ifft exprimental. You don't need to change #2035. Could you add the following lines in the docstrings of these functions?

    .. note::
       The argument `plan` is currently experimental and the interface may be
       changed in the future version.

@leofang

leofang commented Feb 26, 2019

Copy link
Copy Markdown
Member Author

@asi1024 Thank you, it's much clearer. I just updated it.

@asi1024

asi1024 commented Feb 26, 2019

Copy link
Copy Markdown
Member

Jenkins, test this please.

leofang added a commit to leofang/cupy that referenced this pull request Feb 26, 2019
see PR cupy#2056 as well as the discussion starting at cupy#2033 (comment)
@chainer-ci

Copy link
Copy Markdown
Member

Jenkins CI test (for commit d56c174, target branch master) succeeded!

@asi1024

asi1024 commented Feb 26, 2019

Copy link
Copy Markdown
Member

LGTM! Thanks!

@asi1024
asi1024 merged commit 202e4e8 into cupy:master Feb 26, 2019
@leofang

leofang commented Feb 26, 2019

Copy link
Copy Markdown
Member Author

Thanks a lot @asi1024 and @grlee77 for your help! Looking forward to the day plan becomes officially supported (or a better alternative is implemented)!

By the way, would you like to include this PR in v6.0.0b3?

@asi1024 asi1024 added this to the v6.0.0b3 milestone Feb 27, 2019
@leofang
leofang deleted the fft_plan_arg_backup branch July 26, 2019 16:08
@leofang leofang mentioned this pull request Aug 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cat:feature New features/APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants