Repository navigation
Name the method that keeps an FFTMethod convolution off the device rule - #1050
Merged
Merged
Conversation
A device call runs the direct method, so an FFTMethod() convolution there keeps plain AD. The notice should name the method rather than the operator. Fails until the convolution names what keeps it from the rule. Refs #1031.
An FFTMethod() convolution on device arrays took plain AD with only the generic 'Convolution has no rule on device arrays'. _device_whys for a convolution now names its method, saying to pass Direct(), and its kernel when that has no device rule. Closes #1031.
The CUDA registry expected the rule for the three 'by the transform' scenarios. A device call runs the direct method, so they keep plain AD there and name their method. Refs #1031.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #1031.
An
FFTMethod()convolution on device arrays still takes plain AD, but the notice now names the method and says to passDirect().The three "by the transform" registry scenarios are listed as plain AD on a device, so the CUDA registry expects what they do.
Needs your decision: keep this, or let the device rule take
FFTMethod()too (gate onConvolution{<:_DeviceKernel}, since a device call runs the direct method anyway), or refuse FFT on a device with a message.Claude Opus 5.5 [medium]
What happened before
A device call runs the direct method whatever was asked: the FFTW extension sends any non-host array to it.
The device gate only takes
Convolution{<:_DeviceKernel, Direct}(andDirectfor computed kernels), so anFFTMethod()convolution on a device took plain AD.It was not fully silent: the generic
_device_whyslogged "Convolution has no rule on device arrays".That names neither the field nor the fix, unlike the #955 notices.
Change
_device_whys(::Convolution)insrc/operators/convolution.jlnames what keeps a convolution off the device rule:Direct():the method, FFTMethod(), has no rule on device arrays: pass Direct(), the method a device call runs;the kernel, a TimeVarying, has no rule on device arrays.The kernel check reuses
_device_readyonConvolution(c.kernel), so it covers fixed, dense time-varying, ragged and computed kernels without a second list. It only runs once per signature, on the notice path.test/unit/device_rules.jlchecks, on JLArrays, that anFFTMethod()convolution routes to:plain, that_stopped_whysgives the method message, that_note_stoppedlogs it once and then nothing, and that a change-point kernel is named by its kernel.test/registry/tests.jladds the three "by the transform" scenarios toDEVICE_PLAIN. This is what the CUDA run in An FFTMethod() convolution on device arrays takes plain AD, not the rule #1031 failed on.The device rule itself is unchanged.
Making the gate ignore the method (
Convolution{<:_DeviceKernel}) looks close to trivial, since both passes call_fft_path, which isfalsefor device arrays with FFTW loaded.It is left out as #1031 frames it as a design decision on #1027.
Checks
On Julia 1.13.4, locally:
The CUDA registry is not run in CI, and I have no GPU here, so the
DEVICE_PLAINentries are not checked on a device.This was opened by a bot. Please ping @seabbs for any questions.