alibaba / libgrape-lite

🍇 A C++ library for parallel graph processing (GRAPE) 🍇
https://alibaba.github.io/libgrape-lite/
Apache License 2.0
395 stars 93 forks source link

THe performance with GPU backend #118

Open lilux618 opened 2 years ago

lilux618 commented 2 years ago

Do you have questions or need support? Please describe. I run the libgrapelite on A100 with datasets graph500-26 using BFS, the results are as follow:

Additional context Add any other context about the question here.

mengke-mk commented 2 years ago

Hi, @lilux618. libgrape-lite is not ready for the graph500 benchmark and BFS has some specific algorithmic optimizations that libgrape-lite does not apply. This is because these optimizations are hard to generalize thus other algorithms are also hard to gain benefits from them. For example, BFS is idempotent, thus the race condition is benign, which means we can avoid atomic operations in top-down BFS and do early termination in bottom-up BFS. However, other applications can not update without atomic operations and we do not want to keep some "special code path" only for specific algorithms in a programmable framework. Further, libgrape-lite also does not apply direction-optimization or leverage bitmap to avoid redundant memory access in our example code for BFS, this may explain why the performance of libgrape-lite GPU is slower than other graph500 benchmarks.

libgrape-lite just recently supported GPU and we are still working on that these days. It would be great if you are willing to contribute code to help us improve the performance of BFS, you can modify the GPU parallel_engine and implement a fully-optimized version for BFS.

lilux618 commented 2 years ago

Thank you ! I am new in libgrape-lite, and I am learning how to use and modify it. For example, now the BFS code can be used with only one source which is specified at the command line terminal, how can I change it in source code level? Further more, how do I merge other code with this program?

Hi, @lilux618. libgrape-lite is not ready for the graph500 benchmark and BFS has some specific algorithmic optimizations that libgrape-lite does not apply. This is because these optimizations are hard to generalize thus other algorithms are also hard to gain benefits from them. For example, BFS is idempotent, thus the race condition is benign, which means we can avoid atomic operations in top-down BFS and do early termination in bottom-up BFS. However, other applications can not update without atomic operations and we do not want to keep some "special code path" only for specific algorithms in a programmable framework. Further, libgrape-lite also does not apply direction-optimization or leverage bitmap to avoid redundant memory access in our example code for BFS, this may explain why the performance of libgrape-lite GPU is slower than other graph500 benchmarks.

libgrape-lite just recently supported GPU and we are still working on that these days. It would be great if you are willing to contribute code to help us improve the performance of BFS, you can modify the GPU parallel_engine and implement a fully-optimized version for BFS.

mengke-mk commented 2 years ago

how can I change it in source code level?

The BFS source is passed in via gflags. Specifically, the source is set at here.

Further more, how do I merge other code with this program?

To integrate other project with libgrape-lite. You can refer the CreateAndQuery functions.

FYI: libgrape-lite also supports multi-gpu. The computation and communication follow the PIE model. image