TL;DR
This paper presents a novel, work-efficient parallel graph coloring algorithm for GPUs that achieves significantly better performance and coloring quality than existing methods. By refining the speculative greedy scheme and employing GPU-specific optimizations, the authors demonstrate substantial speedups and a reduction in the number of colors used, making graph coloring more practical for large-scale parallel computing.
What Problem Does This Paper Address?
Graph coloring is a fundamental problem with wide applications, including identifying concurrency in parallel computing. However, coloring large graphs efficiently, especially on massively parallel architectures like GPUs, is challenging due to the inherent irregularity of graph data structures and the difficulty of managing GPU resources. Existing GPU graph coloring algorithms often suffer from either poor performance or unsatisfactory coloring quality (i.e., using too many colors, which limits parallelism). This paper aims to bridge this gap by developing a GPU graph coloring algorithm that is both fast and produces high-quality colorings.
Methods
The authors propose a GPU graph coloring implementation based on the speculative greedy (SGR) scheme, which is known to yield better coloring quality than Maximal Independent Set (MIS) based approaches. To achieve high performance on GPUs, they introduce several key techniques:
- Work-efficient Data-Driven Approach: Instead of a topology-driven approach where threads are mapped to vertices, they use a data-driven approach that maintains a worklist of vertices to be processed. This ensures threads are always busy, leading to better work efficiency.
- Algorithm Refinement: The SGR algorithm is carefully refined to better leverage the GPU's bulk-synchronous model. This includes:
- Heuristic Conflict Resolve: Prioritizing coloring vertices with higher degrees first to reduce future conflicts.
- Thread Coarsening: Merging threads to reduce the number of threads and manage conflicts more effectively on the GPU.
- Bitset Operation: Using bitsets for the
color Maskdata structure in theFirstFitkernel to significantly speed up the process of finding the first permissible color. - Common Optimization Techniques: They also incorporate standard GPU optimization techniques:
- Kernel Fusion: Combining multiple GPU kernels into a single one to reduce overhead and improve memory bandwidth.
- Read-only Data Caching: Utilizing the
__ldg()intrinsic to cache read-only data in texture memory for faster access. - Load Balancing: Implementing a hierarchical load balancing strategy to handle irregular graphs with uneven degree distributions.
Datasets
The authors evaluated their approach using:
- Synthetic Graphs: Generated using the R-MAT graph generator with varying parameters to create graphs with different degree distributions and structures.
- Real-world Sparse Graphs: Obtained from the University of Florida Sparse Matrix Collection, which represent diverse application domains.
The paper does not introduce new benchmark datasets but uses a standard suite of graphs commonly used in graph algorithm research.
Key Insights and Ideas
- Algorithm-Specific Optimizations are Crucial: The paper strongly emphasizes that simply porting existing algorithms to GPUs is insufficient. Refining the algorithm itself and tailoring it to the GPU architecture (e.g., through heuristic conflict resolution and data-driven approaches) is critical for achieving high performance and quality.
- Data-Driven vs. Topology-Driven for Irregular Workloads: For graph algorithms, a data-driven approach that dynamically manages a worklist is generally more work-efficient than a topology-driven approach, especially as parallelism decreases in later iterations.
- Trade-offs in Graph Coloring: There's a fundamental trade-off between coloring quality (fewer colors) and performance. MIS-based algorithms are fast but use many colors, while SGR-based algorithms offer better quality but require careful optimization for speed.
- GPU's Strength in Parallelism: GPUs excel at accelerating data-parallel tasks. For graph coloring, recomputing conflicting vertices on the GPU is more efficient than serializing it on the CPU.
Key Results
- Significant Speedup: The proposed optimized GPU implementation achieves an average speedup of 4.08x over the serial implementation.
- Outperforms Existing GPU Methods: It outperforms the NVIDIA CUSPARSE
csrcolor(1.42x speedup) and the 3-step GM GPU implementation (2.21x speedup). - Improved Coloring Quality: The proposed method yields significantly fewer colors than
csrcolor(3.9x to 31x fewer colors) and comparable quality to the serial and OpenMP implementations. - Specific Optimization Gains:
- Bitset operation in
FirstFityields a 61% speedup for that kernel and 28% speedup for the entire program.
- Bitset operation in
- Heuristic conflict resolve leads to an average of 10.3% speedup.
- Thread coarsening provides an average 4.4% speedup.
- Kernel fusion offers an average 10% speedup.
- Load balancing achieves an average 6.4% speedup.
- Scalability: The proposed implementation shows good scalability with increasing graph sizes, consistently outperforming
csrcolorand OpenMP. - Sensitivity to Density: The proposed method is highly efficient for sparse graphs but performance degrades for very dense graphs due to increased conflicts, where CPU-based solutions might be preferred.
Limitations and Future Work
- Dense Graphs: For very dense graphs, the performance of GPU implementations degrades due to frequent conflicts, and the authors suggest using CPUs in such cases.
- Memory Bound Operations: For some sparse graphs, especially those with trivial compute operations, performance is limited by memory access latency, which is difficult to fully mitigate with current optimizations. The authors suggest system software or hardware support for efficient memory access.
- Future Work:
- Investigate the effect of different conflict-resolution heuristics further.
- Implement and optimize the proposal on Intel Xeon Phi coprocessors.
- Evaluate scalability on GPU or MIC clusters.
Summary updated