-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Create a GPU accelerated examples/extra-large-graphs
#1252
base: main
Are you sure you want to change the base?
Conversation
194da17
to
dee3fc0
Compare
Spending some time cleaning up "my end" of this at |
d8149dc
to
9f5143c
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Pinging this one, any interest? |
Hello @thomcom, this looks interesting but I don't have any NVIDIA gpu to test your PR on unfortunately. What I understand from this is there is basically two things to make this work? 1. A gpu-backed implementation of graphology's interface (at least the subset necessary to sigma, by cleverly repurposing forEach methods etc.) and 2. programs that are the same as ours but that don't need byte array processing since the backing buffers are already encapsulated into the make-believe graphology instance. This is quite clever and seems to work nicely indeed. The fact is it can very well work from userland also so the question on our side is probably to decide whether we want to merge your example (which cannot work without proper hardware, as I understand?) or if we can just point to your code somewhere in our docs, no? What do you think @jacomyal ? |
Hey @Yomguithereal, thanks for your consideration! Your analysis is essentially correct. The GPU is able to read graphology data files and pack them into the serialized backing buffers that It is true that you can't run the demo without the proper hardware - but that raises another interesting question. The GPU in this situation is accessed through a web server. I'll talk to some people internally and see if we can put the server that this demo depends on somewhere public for you to play with or at least see the demo work! We love |
Thanks for the answer @thomcom, I think we'll link to your resources then when we find time to release the next version of the lib (which should be sooner than later now :) ). |
Hi @jacomyal ! I've been working on an NVIDIA backed
sigma.js
extension for a few weeks and I'm sharing it with you today. We're writing GPU accelerated, open-source libraries for data visualization, among other things, and wanted to try to integrate withsigma.js
. It's lead me to have plenty of ideas for optimizing thesigma.js
process/render pipeline, if you're interested. Hopefully you like my contribution! Below is the README.md for this contribution.Extra Large Graphs Demo with
@rapidsai/node
GPU accelerationRAPIDS.ai is an open source GPU-acceleration project. We're building new
tools with familiar APIs and extending existing tools to that more
scientists and users can take advantage of GPU performance.
This project creates a
RapidsGraphologyGraph
subclass ofGraph
,plus a modified
index.ts
to make GPU-stored graph vertices and edgesavailable to your browser session. It talks to the
@rapidai/demo-api-server
that has been built using node-rapids.
Performance
Using a GPU for graph rendering offers substantial performance increases.
In this demo, I've included screenshots of performance comparison's between
using our GPU-backed
RapidsGraphologyGraph
and the original rendererincluded in the
large-graphs
demo.When the complexity of the graph matches the original demo, performance
is comparable:
When the complexity increases substantially, the GPU performance improvement
is marked:
It is important to note in the larger case that the "I/O" benchmark for
the original
large-graphs
demo includes the graph generation time, whichis substantial. However, were the file stored in a 500MB .json (as in the
GPU case) and parsed in-browser, execution time is similar or longer.
What Is Happening
In order to run this demo, you need the
@rapidsai/demo
npm package,a system with an NVIDIA GPU from around 2018 forward (Turing architecture
and up), and have previously installed the [CUDA Toolkit] (https://developer.nvidia.com/cuda-toolkit).
The node-rapids workspace demo-api-server
is available as a backend to any HTTP client. At this time only limited
functionality is available to parse JSON files in the
graphology
graph dataset format, plus API requests to request Dataframes and
their Columns via
apache-arrow
.Two endpoints,
graphology/nodes
andgraphology/edges
specificallyreturn pre-formatted arrays that can be used directly with the
sigma.js renderer.
Additional Dependencies
To run the demo
Due to native dependency distribution complexity, pre-packaged builds of
the node-rapids modules are presently only available via our public docker images.
See USAGE.md for more details.
Run
@rapidsai/demo-api-server
via docker:We expect to have full
npm
support soon.Next generate a graph of your liking, or provide another:
Finally run the
extra-large-graphs
demo in the normal fashion:Dataset
Run the graph generator at https://github.com/thomcom/sigma.js/blob/add-gpu-graph-to-example/examples/extra-large-graphs/generate-graph.js
to create a very large graph using the command:
Any dataset that matches the schema of
graphology.json
is supported.This closes #1258