Skip to content
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

WIP GPU implementation of FFT-based smoothing in ML #504

Merged
merged 16 commits into from
Mar 8, 2024
Merged

Conversation

pierrethibault
Copy link
Member

Implemented only in cuda_pycuda for now, and does not support stacks of objects.

@ptim0626
Copy link
Contributor

ptim0626 commented Dec 5, 2023

Hello, I temporarily added a dummy _get_smooth_gradient_fft in the serial version to avoid calling the old GSK while using ML_pycuda.

@jcesardasilva
Copy link
Contributor

Hello, I temporarily added a dummy _get_smooth_gradient_fft in the serial version to avoid calling the old GSK while using ML_pycuda.

Ok, thank you @ptim0626. May I kindly ask for your recommendations on the best course of action to pursue? Additionally, are we looking to explore a more long-term solution to the matter at hand? What are the options?

@ptim0626
Copy link
Contributor

Hi @jcesardasilva, the important thing is making sure ML_pycuda here uses the FFT-based smoothing in every smoothing operation, the fix here ensures this.

As with how to proceed, I would suggest first and foremost this is working in some testing dataset, and get the corresponding kernel in cuda_cupy. What do you think? @pierrethibault @bjoernenders @daurer

@daurer
Copy link
Contributor

daurer commented Feb 1, 2024

The current solution seems to fix the problem that was reported when using the smoothing preconditioner in ML_pycuda. But more work is need before this can be merged.

  • should also be implemented in ML_cupy
  • should we provide both convolution-base and fft-based version and let user decide or silently replace with FFT version in pycuda/cupy engines?
  • do we need a similar change in the object smoothing regulariser in DM etc.?

@pierrethibault
Copy link
Member Author

I would just replace the convolution without adding an option, and use this in DM object smoothing also.

@daurer daurer added the 0.8.1 path release label Feb 29, 2024
@daurer daurer force-pushed the gpu-fft-convolution branch 2 times, most recently from 4ee7023 to a472521 Compare March 5, 2024 15:21
@daurer daurer force-pushed the gpu-fft-convolution branch from a472521 to d739843 Compare March 7, 2024 16:45
@daurer
Copy link
Contributor

daurer commented Mar 8, 2024

FFT-based smoothing is now implemented as a kernel for both PyCUDA and CuPy.
The fft-based smoothing regulariser is available in both ML_pycuda and ML_cupy by changing the new parameter smooth_gradient_method from "convolution" (default) to "fft".

FFT-based smoothing for other use cases, i.e. object smoothing in DM is still outstanding, see #546

@daurer daurer requested review from bjoernenders and daurer March 8, 2024 14:19
@daurer daurer merged commit 08e6b2d into dev Mar 8, 2024
4 checks passed
@daurer daurer deleted the gpu-fft-convolution branch March 8, 2024 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.8.1 path release trieste-meeting-2023 Code contribution during dev meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants