1.0.0 • Published 2 years ago

@antv/webgpu-graph v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

AntV Graph Algorithm based on WebGPU

webgpu-graph is a GPU accelerated graph analytics library, with functionality like WebGPU which provides modern features such as compute shader(in WGSL). Compared with CPU version, we almost gain ~100x speed up with big datasets.

It's inspired by cuGraph and other implementations based on CUDA.

Docs:

Prerequisite

How to use WebGPU

For our examples, we use origin trial. The origin trial is expected to end in Chrome 101 (May 18, 2022).

Since we are using latest syntax of WGSL, you'd better update your Chrome to the latest version.

Usage

import { pageRank, WebGPUGraph } from '@antv/webgpu-graph';

// initialize WebGPU context
const graph = new WebGPUGraph();

// call async method
const result = await graph.pageRank(graph_data, eps, alpha, max_iter);

Building

  • Install dependencies: yarn install
  • For production, compile the project: yarn build

Benchmark

namevertices and edgesCPU time elapsedGPU time elapsedSpeed up
SSSP1k vertices & 5k edges27687.10 ms261.60 ms~100x
PageRank1k vertices & 500k edges13641.50 ms130.20 ms~100x