GithubHelp home page GithubHelp logo

gswitch's Introduction



DOI

GSWITCH

GSWITCH is a pattern-based algorithmic autotuning system that dynamically switched to the suitable optimization variants with negligible overhead. Specifically, It is a CUDA library targeting the GPU-based graph processing application, it supports both vertex-centric or edge-centric abstractions. By far, GSWITCH can automatically determine the suitable optimization variants in Direction (push, pull), data-structure (Bitmap, Sorted Queue, Unsorted Queue), Load-Balance (TWC, WM, CM, STRICT, 2D-partition), Stepping (Increase, Decrease, Remain), Kernel Fusion(Standalone, Fused). The fast optimization transition of GSWITCH is based on a machine learning model trained from 600+ real graphs from the network repository. The model can be reused by news applications, or be retrained to adapt new architectures. In addition, GSWITCH provides succinct programming interface which hides all low-level tuning details. Developers can implements their graph application with high performance in just ~100 lines of code.

For more details, please visit our website.

Dependency

  • nvcc 7.5+
  • cmake
  • moderngpu

Quickstart

mkdir build
cd build
cmake ..
make

Usage

Here are the basic useages of pre-integrated applications(BFS,CC,PR,SSSP,BC) in GSWITCH.

./EXE <graph_path> [options]
[-r, --src=<int>]         Choose a root vertex. (Default: ch
                          oose randomly).
[-v, --verbose]           Print verbose per iteration info. 
                          (Default: quiet mode)
[-V, --validation]        Process the CPU reference validati
                          on. (Defaule: no validation)
[-H, --with-header]       Input file has header (e.g. nverte
                          xs, nvertexs, nedges, Default: no 
                          header).
[-W, --with-weight]       Input file has weight.(Default: no
                           weight value)
[-i, --ignore-weight]     Ignore the graph weight.(Default: 
                          false)
[-d, --directed]          Graph is directed.(Default: undire
                          cted)
[-c, --configs=Push-Queue-CM-Fused]
                          Set debug strategies, use - to sep
                          arater them (Default: <empty>).
[-D, --device=<int>]      Choose GPU for testing (Default: 0
                          )
[-j, --json=<string>]     set the json path (Default: 0)

Example

Here is a sample codes of BFS for graph soc-orkut. For more details please visit ./application/bfs.cu

#include "gswitch.h"
using G = device_graph_t<CSR, Empty>;

struct BFS:Functor<VC,int,Empty,Empty>{
  __device__ Status filter(int vid, G g){
    int lvl = *wa_of(vid);
    if(lvl == g.get_level()) return Active;
    else if (lvl < 0) return Inactive;
    else return Fixed;
  }
  __device__ int emit(int vid, Empty *w, G g) {return g.get_level();}
  __device__ bool cond(int v, int newv, G g) {return *wa_of(v)==-1;}
  __device__ bool comp(int* v, int newv, G g) {*v=newv; return true;}
  __device__ bool compAtomic(int* v, int newv, G g) {*v=newv; return true;}
};

int main(){
  // load graph
  for(level=0;;level++){
    inspector.inspect(as, g, f, stats, fets, conf);
    if(as.finish(g, f, conf)) break;
    selector.select(stats, fets, conf);
    executor.filter(as, g, f, stats, fets, conf);
    g.update_level();
    executor.expand(as, g, f, stats, fets, conf);
  }
  // copy data back
}

run the with ./BFS soc-orkut.mtx --with-header --src=0 --device=0 --verbose:

run-bfs

Performance

please visit our website

License

All the libraryies, examples, and source codes of GSWITCH are released under Apache 2.0.

gswitch's People

Contributors

jokopi avatar septicmk avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.