Integrated example of GNN functionality in ROOT's TorchGNN.
- A Python virtual environment with:
- PyTorch
- PyTorch Geometric
- ROOT
- C++
- LibTorch: Can be downloaded from the PyTorch homepage. We used version TorchLib 2.0.1 ( cxx11 ABI).
- BLAS: We used OpenBLAS.
- PyTorch Scatter: See installation instructions at the PyTorch Scatter repository.
- PyTorch Sparse: See installation instructions at
the PyTorch Sparse repository.
- Make sure that the third-party library parallel-hashmap is included in the
third_partydirectory.
- Make sure that the third-party library parallel-hashmap is included in the
Both PyTorch Scatter and Sparse can be installed in the following way:
cd source_code_directory
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="path/to/libtorch" -DCMAKE_BUILD_TYPE="Release" ..
make
make install
The model can be trained and parsed by running the Python code GNN_generator.py.
The C++ benchmarking code main.cxx can be compiled and run in the following way:
cd code_directory
mkdir build
cd build
cmake -DCMAKE_PREFIX_PATH="path/to/libtorch" -DCMAKE_BUILD_TYPE="Release" ..
make
export OMP_NUM_THREADS=1
./TorchGNN
Alternatively, one can use the provided bash script collect_statistics.sh, to collect all statistics mentioned in the report. Make sure to change the CMAKE_PREFIX_PATH variable and activate the virtual environment before calling the bash script.