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

Add GPU support with cupy and dask #49

Open
mwakok opened this issue Sep 5, 2022 · 1 comment
Open

Add GPU support with cupy and dask #49

mwakok opened this issue Sep 5, 2022 · 1 comment
Assignees

Comments

@mwakok
Copy link
Member

mwakok commented Sep 5, 2022

I have added support for GPU processing for CUDA-enabled GPUs through cupy. Calling ddm.processing.dmm will automatically determine whether cupy is installed properly.

Installation

In order to use cupy, you will need the following requirement: https://docs.cupy.dev/en/stable/install.html#requirements

I have excluded cupy from the environment.yml as not everyone has a GPU and the cuda-toolkit is ~1Gb. In order to install it, add the cuda option to the pip installation of the package.

pip install -e .[dev,cuda]

I used these references:

TODO
In order to make use of the dask dashboard, you will need to install dask-cuda. However, this package is currently only available for Linux.

@mwakok mwakok self-assigned this Sep 6, 2022
@mwakok mwakok mentioned this issue Sep 12, 2022
@mwakok
Copy link
Member Author

mwakok commented Sep 12, 2022

Benchmark

Dataset
Simulated dataset with 1000 frames of 512x512, totalling 512 MB.

CPU
Intel i7-8665U @ 1.9GHz (TU Delft laptop)

  • Chunk size = (5,512,512)
  • Calling dask.compute on entire tau range
  • Hyperthreading enabled (2 threads per core)
  • Boost enabled @ 3GHz (not stable during calculation)

Result: Calculating ddm for taus=np.arange(1,100) takes ~270 seconds

GPU
Nvidia Geforce GTX 1070 with 8GB of dedicated GPU memory

Benchmark 1:

  • Chunk size = (50,512,512)
  • Calling dask.compute on every tau separately

Result: Calculating ddm for taus=np.arange(1,100) takes ~40 seconds
Uses ~1.5Gb of GPU memory

Benchmark 2:

  • Chunk size = (50,512,512)
  • Calling dask.compute on entire tau range

Result: Calculating ddm for taus=np.arange(1,100) takes ~15 seconds
Uses ~4.5Gb of GPU memory

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

No branches or pull requests

1 participant