Vitis Graph Library Provisions

The Vitis™ Graph Library provides:

  • A fast FPGA-accelerated implementation of graph analytics in a variety of use cases
  • High-level software interfaces written in C/C++ for the ease of use without any additional hardware configurations
  • Low-level hardware interfaces written in HLS for greater flexibility and control 
Vitis Graph Library Image

Vitis Graph Library - Functions

Currently Vitis Graph Library includes the following functions for the implementations of graph algorithm:

  • Functions for Similarity Analysis
    • Cosine Similarity, Jaccard Similarity, K-nearest Neighbor
  • Functions for Centrality Analysis
    • PageRank
  • Functions for Pathfinding
    • Single Source Shortest Path, Multi-Source Shortest Path, Minimum Spanning Tree and Estimated Diameter
  • Functions for Connectivity Analysis
    • Weakly Connected Components and Strongly Connected Components.
  • Functions for Community Detection
    • Louvain Modularity (From 22.1, Louvain API can support large-scale graphs), Label Propagation and Triangle Count.
  • Functions for Search
    • Breadth First Search and 2-Hop Search.
  • Functions for Graph Format
    • Renumber, Degree Calculation and Format Conversion between CSR and CSC.

Vitis Graph Library - Function Implementation Types

Vitis Graph Library provides three types of function implementations, namely L1 primitive functions, L2 kernel functions and L3 software API functions. L1 primitive functions can be leveraged by FPGA hardware developers. L2 kernel functions are built by integrating L1 primitive functions and data movers, which can be called by host codes with XRT Runtime Library. L3 software API functions provide C++ function interfaces to allow pure software developers to offload graph operations to AMD platforms without additional hardware related configurations. Some functions of the three types are listed in the table below. Note that Vitis Graph library currently does not provide any functions running on Versal AI Engine. 

Vitis Graph Library functions L1 primitive functions
denseSimilarity: similarity function for dense graph
generalSimilarity: similarity function which support both dense and sparse
sortTopK: sorting function for the top K of input data
sparseSimilarity: similarity function for sparse graph
L2 kernel functions
bfsImpl: breath-first search algorithm
calcuDegree: degree calculation algorithm
connectedComponentImpl: connected component calculation algorithm
convertCsrCsc: convert graph format between Csr and Csc 
labelPropagation: the label propagation algorithm
pageRankTop: pagerank algorithm 
Note: Full L2 kernel function list and introduction can be found here
L3 software API functions
opBFS class: bread-fist search algorithm
opSCC class: strongly connected component calculation
opTriangleCount class: counting the number of triangles 
Note: Full L3 software API function list and introduction can be found here.

For the detailed differentiation of L1 primitive and L2 kernel functions, please refer to the table below. 

L1 primitive functions

  • Mainly provided for hardware-savvy developers who want to know the underlying implementation logic and make performance optimizations;
  • Always have stream interfaces;
  • Normally implemented for a single computation module;
  • can’t be called by host code directly;

L2 kernel functions

  • Mainly provided for host code developers who know XRT APIs;
  • Always have memory (DDR/HBM) interfaces;
  • Formed by chaining L1 primitive functions with some data mover modules;
  • Host-callable;

L3 Software API functions

  • Mainly provided for pure software engineer;
  • Function parameters are independent of hardware;
  • Normally used for deployment;
  • Host-callable;

Vitis Graph Library - Organization

The three types of implementations are organized in their corresponding L1, L2 and L3 directories in Github. The diagram below shows the major organization of the Vitis Graph Library, each relating to a different stage of application development.

For L1 sub-directories:

  • include/hw: the header files for primitive functions
  • tests/hw/kernel: the top modules including data movers and primitive functions
  • tests/hw/host: the testbench and infrastructure support for calling primitive functions
  • tests/hw/Makefile: used to build and run primitive functions

For L2 sub-directories:

  • include/hw: the header files for kernel functions
  • tests/hw/kernel: a function wrapper for each kernel function
  • tests/hw/host: the host modules for calling compiled kernel functions
  • tests/hw/Makefile: used for build and run kernel functions

For L3 sub-directories:

  • include: the header files for software API functions
  • tests/Makefile: used for build and run software API functions
Vitis Graph Library Organization Image

Execution in Vitis GUI

The libraries available in the Vitis GitHub repository can be compiled by using either the provided Makefiles for L2 and L3 functions as introduced above or the Vitis IDE. To use the library in the IDE, it must be downloaded as a library template at first, then a new Vitis project must be created by using the template. More information about creating L2 or L3 applications using the library template in Vitis GUI can be found here.

Getting Started