Comments (6)
What is the estimated overhead in your case?
Is that interpolator that slow? I mean, normal cubic interpolation is much faster hence I wonder what's so different in this case.
Is that better in different libraries?
I observed the following.
Does that match with your experiences? So NUFFT along the last two dims, and a leading batch dim.
voxels = torch.zeros(100,1, 768,768, device="cuda")+ 0j
# 300 angles
nufft, adjnufft, ktraj = prepare_nufft(voxels, 300, numpoints=3, gridfactor=1.25, device="cuda")
%%timeit
torch.fft.fft2(voxels +0j)
torch.cuda.synchronize()
# 9ms
%%timeit
nufft(voxels + 0j, ktraj)
torch.cuda.synchronize()
# 61ms
In that case, a RFFT really would only save ~4 to 5ms. (maybe a little more because of 1.25 padding)
from torchkbnufft.
Hello @roflmaostc, it wasn't a priority for me since MRI data is always complex. Today I'm unable to implement it due to time constraints, but I could possibly consider a PR if someone else did it.
from torchkbnufft.
I can try to help since I would love that feature! Maybe specified with another parameter?
Doing that implicitly might be dangerous. fftmethod="fft"
or fftmethoid="rfft"
.
What is requried?
Would that be here?
There is probably more steps to do with the interpolation?
from torchkbnufft.
I think the interpolator could be a little bit involved. First you'd want to check that it has no imaginary values (I don't remember). Then there might be a question of reflecting the results to the Hermitian-symmetric part of Fourier space so that the k-nearest neighbors algorithm works correctly.
After doing these things I'm actually guessing there would be no speedup, because the interpolator is the bottleneck anyway. Maybe a deeper look into the NUFFT algorithm to consider real inputs would be necessary to get an efficient implementation. I don't think it's as simple as changing the forward FFT op.
from torchkbnufft.
85% overhead seems a little high but could be possible for some trajectories. It's actually trajectory-dependent. If you only have one radial spoke then it's possible the FFT takes longer.
from torchkbnufft.
I actually used 300 radial spokes of length 768 each.
And a batch size of 100 maybe, in max.
What should be the shape of ktraj in this case?
On my case it was (2, 768*300)
.
Tbh, in the documentation I was confused about coils, etc.
Should I rearrange the spokes along another dim for more parallelization?
from torchkbnufft.
Related Issues (20)
- Thread allocation issues with batched density compensation HOT 11
- Basic KB-NUFFT Example HOT 6
- Failed for 3D non-Cartesian trajectory
- MriSenseNufft, AdjMriSenseNufft, AdjKbNufft, ToepSenseNufft removed
- Deprecation warning and shutdown HOT 3
- Accuracy for numpoints = 2 - 7
- nonuniform discrete Fourier transform of type II HOT 4
- grid_size HOT 3
- Make compatible with latest PyTorch HOT 7
- data range changed after processing HOT 4
- KB-NUFFT hangs when used in PyTorch DataLoader with num_workers > 0 HOT 3
- Allow user control of threading
- Could you give an example of implementing a two-dimensional Fourier transform by use torchkbnufft?
- Performance vs FFT HOT 6
- Toeplitz Kernel has boundary artifacts HOT 9
- Basic 1D case
- Batched input with varying size leads to TorchScript error HOT 2
- KbInterpAdjoint gives mismatch results? HOT 3
- Gradients w.r.t. coordinates in ktraj
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from torchkbnufft.