cytoscape / cytoscape.js

Graph theory (network) library for visualisation and analysis
https://js.cytoscape.org
MIT License
10.1k stars 1.64k forks source link

WebGPU Support #3261

Open apowers313 opened 3 months ago

apowers313 commented 3 months ago

Description of new feature

networkx has an ability to use GPUs to accelerate algorithms resulting in orders of magnitude faster processing time for algorithms like centrality.

There is an emerging WebGPU browser standard with some desktop implementations that enables the use of the GPU in the browser for parallelizing algorithms.

Just throwing it out there that it might be interesting for cytoscape.js to either integrate GPU acceleration or expose a backend plugin API similar to networkx to enable others to do so.

For reviewers

Reviewers should ensure that the following tasks are carried out for incorporated issues:

mikekucera commented 3 months ago

I'm currently working on WebGL support full time, primarily to support large networks. WebGL is much more broadly adopted and works on most mobile browsers.

apowers313 commented 3 months ago

My understanding is that it's two different purposes. WebGL is for graphics and will help visualization run faster, especially with large networks. WebGPU can also do graphics (I'm not advocating that) but it can also be used as thousands of tiny CPUs to parallelize graph algorithms and make them run faster. For example, calculating betweenness centrality on a graph with 3M nodes and 17M edges takes 513 seconds to run on a CPU and 16 seconds to run on a GPU.

maxkfranz commented 3 months ago

@apowers313, does your team currently have capacity to contribute in this direction?

kelciocasemiro commented 3 months ago

Waiting for this...

apowers313 commented 3 months ago

@maxkfranz I wish. Unfortunately this is a personal project, not Amazon related.

jpmateo022 commented 2 months ago

Please make this happen :) I really need this feature.