Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
cuFFT now supports a new callback mechanism that is not only more performant but also more friendly to dynamic languages like Python and Julia, currently under public preview and will be released in a future CUDA version.
The new approach does not require any ugly compilation of host & device code; instead, we just need to use NVRTC to compile a user-provided device function (currently supporting raw CUDA C++ strings; once we support user-provided types in
@cupyx.jit.rawkernel
(#6663) we can also support pure Python functions as device functions) into LTO IR, and pass it to the new cuFFT APIcufftXtSetJITCallback
which will be responsible for linking the LTO IR with the cuFFT kernel.The existing callback manager (
_CallbackManager
) is renamed to_LegacyCallbackManager
, to be distinguished with the new_JITCallbackManager
. My suggestion is once this feature is officially released (generally accessible), we add a deprecation warning to_LegacyCallbackManager
. Users can currently pick either callback approach via the new optioncp.fft.config.set_cufft_callbacks(..., cb_ver=...)
.Currently, this feature requires users loading libcufft EA version:
LD_PRELOAD=/path/to/EA/libcufft.so python ...
, including running the test suite or sample code, so that the libcufft copy from CUDA Toolkit is not used. I'd like to have this capability included in CuPy sooner, so that users can give it a try and share feedbacks for final adjustment.