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

GPU acceleration roadmap [WIP] #47

Open
6 of 7 tasks
dkazanc opened this issue Jan 27, 2023 · 1 comment
Open
6 of 7 tasks

GPU acceleration roadmap [WIP] #47

dkazanc opened this issue Jan 27, 2023 · 1 comment
Assignees
Labels
enhancement New feature or request

Comments

@dkazanc
Copy link
Collaborator

dkazanc commented Jan 27, 2023

The list of the modules that require code optimisation and GPU acceleration. Please approach them in the following priority order.

  • Normalisation module. Contains two implementations, CuPy one and the one using CUDA kernel. The latter produces the result different from the CuPy implementation and needs to be checked. Also the grid/block sizes affect the result as well. The input to the normalisation module is uint16 data type.
  • Median/dezinger filter. The raw CUDA kernel has been ported from the code in the Larix toolbox. The code does compile, however the result is incorrect. For comparison one can use scipy.ndimage.median_filter(np.float32(Input), size=3) . Arranging in the similar fashion using templates would be great. Block and grid sizes to be checked if correct. The input to the median filter module is uint16 and float32 data type.
  • Centering module. Has got two methods in the file, the one for the normal 180 degrees data and 360 degrees one.
  • Distortion correction module
  • Stripes removal module
  • Reconstruction module. Please check this CuPy code here that does the filtering, if it can be further optimised/accelerated.
  • Phase retrieval module

To run full pipelines with the series of the modules above please see the following script

@dkazanc dkazanc added the enhancement New feature or request label Jan 27, 2023
@yousefmoazzam
Copy link
Contributor

An alternative raw CUDA kernel to perform normalisation has been added: https://github.com/DiamondLightSource/httomolib/blob/9ca14934e338028fdd3a10e72a4d58ccefc68bd9/src/httomolib/prep/normalize.py#L128-L234
which appears to replicate the implementation in normalize_cupy(); possibly could be useful for comparison purposes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants