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

Implement GPU-accelerated edge bundling #1124

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

scottagfox
Copy link

@scottagfox scottagfox commented Sep 22, 2022

FFT bundling is an alternative edge bundling method to Datashader's existing Edgehammer bundling implementation. It runs magnitudes faster than Edgehammer on larger graphs (10k+ edges) thanks to GPU-acceleration and cuFFT.

FFT bundling takes input in the form of two dataframes (cuDF or Pandas) containing normalized node coordinates and an edge list, and outputs a cuDF dataframe containing line segments.

Performance and the end result depend greatly on several parameters:

Iterations: The maximum number of passes over the edge segments (bundling will end if kernel grows too small).
Accuracy: Resolution of possible edge positions.
Move Distance: How far an edge segment will be moved along the gradient.
Kernel Size: Initial size of Gaussian kernel.
Kernel Decay: Rate of Gaussian kernel decay.
Resample Frequency: How often edges will be resampled.
Resample Distance: How far apart edge segments can be from each other; resolution of an edge.
Final Smooth: Number of smoothing passes to perform on the final graph.

The FFT edge bundling pipeline is similar to Edgehammer's with a few key differences.

  • Edge segments are stored on GPU in a CuPy array (which is resized when resampling occurs).
  • The gradient map that the edge segments are moved along is generated by convoluting the Fourier transforms of the density map and a Gaussian kernel.

Pipeline:

    read edge segments from df
    initial sample
        generate gaussian kernel
        resample edges
        generate density map
        generate gradient map
        move edge segments
        smooth
    final smooth

FFT bundling is still missing some features supported by the Edgehammer bundling method and could use some additional features such as support for weighted graphs, and 'batching' edges to avoid memory constraints. @ianthomas23 mentioned introducing it as an "experimental" feature for now.

@exactlyallan

Added alternate, faster edge bundling method on GPU.
@exactlyallan
Copy link

@ianthomas23 Would love it if you reviewed this and suggested next steps.

@jbednar
Copy link
Member

jbednar commented Sep 22, 2022

Looks cool, thanks! Before we could release it we'd need some documentation, preferably including comparisons with the existing edge bundling, and some tests. I don't suppose NVidia has ever worked out a way we could get CUDA-enabled workers for our Github Actions so we can keep this working? :-)

@exactlyallan
Copy link

@jbednar we are in the process on updating our DevOps to enable more testing with external libraries using GitHub Actions, though that would still only be accessible within NVIDIA. We'll work on getting some more docs for this!

@ianthomas23 ianthomas23 added this to the v0.14.x milestone Oct 24, 2022
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

Successfully merging this pull request may close these issues.

4 participants