Comments (5)
Hello @ajlok3, I've opened a PR with a batched k-space NUFFT in PR #24. I don't know if you might have some time to try the implementation or look over the new documentation at https://torchkbnufft.readthedocs.io/en/batched_nufft/. Would appreciate any feedback you have. I will merge sometime this week or next week.
from torchkbnufft.
Thanks, I'll look into it!
EDIT
This is a very vague analysis but just from changing the code from the loop version to the batched version the wall time of my algorithm (CS reconstruction, 30 iterations, 192x192x100 2D+t MRI data, 16 spokes per slice) decreased from 4:20 min. to 2:48 min. (on average over 4 runs) which roughy corresponds to the acceleration factor you measured for GPU forward nufft. So, thank you very much, the issue seems to be solved! However, I'm wondering why the CPU version performs better... (I haven't measured it for my solution, though).
Also, very appreciate the performance tips in docs!
Cheers,
ajlok3
from torchkbnufft.
My thought for this is that we can use process forking the same way we do for normal NUFFTs, except we'll apply forking over batches rather than coils. (See current forking behavior here.) This will make the NUFFT for each set of coils slower, but I think the overall NUFFT will be faster as Python won't be waiting on the previous batch to finish.
One question is whether to incorporate this into the existing KbNufft
and KbInterp
or to make new functions. I think my preference would be to use the existing functions to minimize the amount of new documentation, and just have a divergent backend depending on the number of dimensions in omega
.
I don't think any changes are necessary for the Toeplitz NUFFT, but will be checking.
from torchkbnufft.
Yeah, I'm honestly not sure about the CPU version performing better. Could be something strange going on with how it's dispatching the CUDA kernels under the hood. Maybe we could fix it with CUDA streams, but those aren't in torch.jit
yet, so we may be waiting on that.
Glad it's working for you!
from torchkbnufft.
Closing, implemented by PR #24 and released with version 1.1.
from torchkbnufft.
Related Issues (20)
- 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
- Support for NFFTs of real valued Arrays HOT 6
- 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
- torch.func (pytorch 2.0) compatibility HOT 1
- Data dtype error when calling inerpolation function using `torch.complex64`
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.