An FPGA accelerator for Graph Neural Networks following the Message Passing Mechanism.
Explore the docs »
View Demo
·
Report Bug
·
Request Feature
Table of Contents
In recent times, Graph Neural Networks (GNNs) have attracted great attention due to their performance on non-Euclidean data. Custom hardware acceleration proves particularly beneficial for GNNs given their irregular memory access patterns, resulting from the sparse structure of the graphs. Despite the relative success of hardware approaches to accelerate GNN inference on FPGA devices, previous works are limited to small graphs with up to 20k nodes, such as Cora, Citeseer and Pubmed. Since the computational overhead of GNN inference grows with increasing graph size, existing accelerators are unable to process medium to large-scale graphs.
AGILE is an FPGA accelerator aimed at enabling GNN inference on large graphs by exploring a range of hardware optimisations:
- Event-driven programming flow, which reduces pipeline gaps by addressing the non-uniform distribution in node degrees.
- Multi-precision dataflow architecture, enabling quantized GNN inference in hardware at node granularity.
- Efficient prefetcher unit is implemented to support the large graph use case
Evaluation on the set of Planetoid graphs, containing up to 19717 nodes, shows up to 2.8x speed-up against GPU counterparts, and up to 6.6x against CPU.
Follow these instructions to set up your workarea. The following steps assume you have Vivado 2019.2 and Modelsim 2019.2 installed.
- Start by cloning the repository.
git clone https://github.com/pgimenes/agile.git
- Set the
WORKAREA
environment variable.
cd agile
export WORKAREA=$(pwd)
- If you don't have
conda
installed yet, download the installation file for your platform from the link and execute with all default settings. For example:
wget https://repo.anaconda.com/archive/Anaconda3-2023.09-0-Linux-x86_64.sh
chmod +x Anaconda3-2023.09-0-Linux-x86_64.sh
./Anaconda3-2023.09-0-Linux-x86_64.sh -b
- Create a conda environment from the defined yaml file and install pip dependencies.
conda env create -f environment.yml
conda activate agile
pip install -r $WORKAREA/requirements.txt
Note: a common error is that conda does not update the path to use the environment version of python and pip. Check this by running
which pip
and ensuring this points to a path within your anaconda installation.
- Run the build script to update submodules, build register banks and the Vivado build project. This will ask you for the Airhdl password associated with the project. Contact a project contributor for access to this.
source $WORKAREA/scripts/build.sh
- Generate the simulation payloads. For example, for the KarateClub dataset:
python3 $WORKAREA/scripts/initialize.py --karate --gcn --payloads --random
- Build the testbench.
cd $WORKAREA/hw/sim
make build
- Run the simulation.
make sim GUI=1
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request