-
Notifications
You must be signed in to change notification settings - Fork 27
Streamline sdc for real sample density compensation factors (DCFs)
#160
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@JeffFessler I took a look at the allocations with Profile.Allocs.@profile sample_rate=1.0 NFFTTools.sdc!(p, 10,
w2,
weights_tmp,
workg,
workf,
workv,
)and I think the allocations are fairly minimal. Most allocations seem to happen due to the multi-threading book-keeping, either in FFTW or our In regards to reusing Maybe I am missing something there though and it is possible |
|
Thanks for the notes about allocs - makes sense. Would it make sense to retreat from |
|
tests are failing because "NFFTPlan has no field size_in" sigh. |
|
@JeffFessler I think it makes sense to retreat from AbstractNFFT and change both the types in the methods and the dependency fot NFFTPlans/NFFT.jl for now. I'm not sure if I'd even classify this as a breaking change, because the code as written never worked before 😅 Going foward, we could "fix" this by:
If I remember correctly, AbstractNFFT.jl has Still it would be good to have fitting function to retrieve the values we need, if those are something that are generally required for an NFFT |
|
I think the missing value is only As far as I know, at the moment only NonuniformFFTs.jl would be a possible candidate for another package which could be used for NFFTTools and I don't think it implements the convolve! calls |
|
@nHackel there is a probley with our plan of removing AbstractNFFTs from |
|
@JeffFessler ah good catch! I didn't think about that. Some day I might find the necessary time (and understanding of the maths) to port more convolutions options than just Or as a temporary workaround, I could try to make the NFFTPlan parametric enough for GPU arrays and then just leave most of the unused fields empty. Either way, I think for this PR it's good enough if we simply:
|
|
I have made the suggested changes I think, except for this one that I didn't grok:
So now my main remaining question is whether I can cut the commented out code about |
|
@JeffFessler I just had time to take a look at this again. I think I meant dropping the AbstractNFFT dependency and just doing: # in NFFTTools.jl
using NFFT, NFFT.AbstractNFFTs but ultimately it doesn't really make a difference. And we can just leave it as it is now I think we can cut the comment and "worst" case it's still referred to in the PR and releases. IF the bug turns up again, we should try to turn it into a MWE. Lastly, we also need to update the project.toml of NFFT.jl for your fix to the GPU extension |
I think you mean a version bump, right? I bumped versions for both NFFTTools and NFFT. |
This PR has the following changes:
convolveto work withRealarrays with arbitrary precision #159 to also work with GPU arrays, i.e.,convolve!now works with real (GPU) array types.Realcapabilities ofconvolve!so that weights are always real insdc, avoidingabsand other conversions between real and complex types.cinsdcto avoid calling\.weights_tmp .+= eps(T)that seems unnecessary. (Are there corner cases where it is needed? If so, then the tests should be expanded to cover such a case.)sdc!.sdc!- one with and one without the final "scaling" step that is not always essential.conversion to Array is a workaround for CuNFFT.The one aspect I could not figure out how to address here is how to recycle the working space in the complex array
p.tmpVecas a real array. My attempts to do this usingreinterprethave failed. It could be refined with another PR later if anyone has ideas.