question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Mark explicit `plan` in `cupyx.scipy.fftpack.*` a stable API?

See original GitHub issue

The explicit plan argument in cupyx.scipy.fftpack.* and the get_fft_plan() function there were added in v6. I have used it extensively in production since then, and I also heard positive feedbacks (via private communication). The plans (Plan1d or PlanNd) returned by the get_fft_plan() handle can be reused either explicitly as an argument, or implicitly as a context manager. In other words, the plans can be used

  • implicitly in cupy.fft.fft.* (and later cupyx.scipy.fft.*)
  • explicitly in cupyx.scipy.fftpack.*

Given where we are now, and that the cupyx.scipy.fft API will be added soon (#2355) which do not take a plan as argument, I wonder if this nice feature can be removed from the “experimental” status and become a stable API. Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

2reactions
grlee77commented, Dec 20, 2019

Hi @leofang. I think your summary of the SciPy side of things sounds correct.

I understand wanting to keep APIs consistent, but I also think there are practical considerations that warrant exceptions. For example IIRC, cupy.fft.fft has always preserved single precision dtypes while NumPy’s version explicitly casts to double, so apparently an exception was already made in that case. When there is a clear performance or utility benefit to allowing something, then I think it makes sense to do so as long as it is clearly documented. Perhaps there could even be a specific documentation page that collects these exceptions in a central location for easier reference.

I was also under the impression that the cupyx module was perhaps a bit more accepting of such deviations than the core cupy API.

1reaction
leofangcommented, Dec 15, 2019

@asi1024 Don’t worry too much 🙂

First, with scipy.fft being added in v1.4.0 and in preference to scipy.fftpack, the latter is considered as “long term legacy” (https://github.com/cupy/cupy/pull/2355#issuecomment-517325388) and maintained only for backward compatibility. I doubt there will be any change over its API.

Second, in the event that a plan argument is to be added to scipy.fftpack, we can and will try to coordinate the efforts (with @grlee77 and @peterbell10). For example, this SciPy issue title is renamed exactly for the need of CuPy discussed here, see https://github.com/scipy/scipy/issues/10302#issuecomment-517351532.

Read more comments on GitHub >

github_iconTop Results From Across the Web

cupyx.scipy.fftpack.get_fft_plan — CuPy 11.3.0 documentation
Generate a CUDA FFT plan for transforming up to three axes. ... The axes of the array to transform. If None , it...
Read more >
CuPy Documentation - Read the Docs
The returned plan can be used either explicitly as an argument with the cupyx.scipy.fft APIs: import cupyx.scipy.fft.
Read more >
scipy.sparse.csr_matrix — SciPy v1.9.3 Manual
scipy.sparse.csr_matrix# ; getnnz ([axis]). Number of stored values, including explicit zeros. ; getrow (i). Returns a copy of row i of the matrix,...
Read more >
2020年12月_weixin_39805195的博客_CSDN博客
好程序设计擅长JAVA(SSM,SSH,SPRINGBOOT)、PYTHON(DJANGO/FLASK)、THINKPHP、C#、安卓、微信小程序、MYSQL、SQLSERVER等,欢迎咨询在学习知识库管理系统项目的时候,方便 ...
Read more >
CuPy : A NumPy-compatible array library accelerated by CUDA
[x] Add PR description; [x] Add tests; [x] Add comments to code; [x] Mark the public API from scipy/scipy#12512 experimental; [ ] ~~Add ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found