<?xml-model href='http://www.tei-c.org/release/xml/tei/custom/schema/relaxng/tei_all.rng' schematypens='http://relaxng.org/ns/structure/1.0'?><TEI xmlns="http://www.tei-c.org/ns/1.0">
	<teiHeader>
		<fileDesc>
			<titleStmt><title level='a'>Rumor Has It: Optimizing the Belief Propagation Algorithm for Parallel Processing</title></titleStmt>
			<publicationStmt>
				<publisher></publisher>
				<date>08/17/2020</date>
			</publicationStmt>
			<sourceDesc>
				<bibl> 
					<idno type="par_id">10211604</idno>
					<idno type="doi">10.1145/3409390.3409401</idno>
					<title level='j'>49th International Conference on Parallel Processing - ICPP : Workshops</title>
<idno></idno>
<biblScope unit="volume"></biblScope>
<biblScope unit="issue"></biblScope>					

					<author>Michael Trotter</author><author>Timothy Wood</author><author>H. Howie Huang</author>
				</bibl>
			</sourceDesc>
		</fileDesc>
		<profileDesc>
			<abstract><ab><![CDATA[By modelling how the probability distributions of individuals’ states evolve as new information flows through a network, belief propagation has broad applicability ranging from image correction to virus propagation to even social networks. Yet, its scant implementations confine themselves largely to the realm of small Bayesian networks. Applications of the algorithm to graphs of large scale are thus unfortunately out of reach. To promote its broad acceptance, we enable belief propagation for both small and large scale graphs utilizing GPU processing. We therefore explore a host of optimizations including a new simple yet extensible input format enabling belief propagation to operate at massive scale, along with significant workload processing updates and meticulous memory management to enable our implementation to outperform prior works in terms of raw execution time and input size on a single machine. Utilizing a suite of parallelization technologies and techniques against a diverse set of graphs, we demonstrate that our implementations can efficiently process even massive networks, achieving up to nearly 121x speedups versus our control yet optimized single threaded implementations while supporting graphs of over ten million nodes in size in contrast to previous works’ support for thousands of nodes using CPU-based multi-core and host solutions. To assist in choosing the optimal implementation for a given graph, we provide a promising method utilizing a random forest classifier and graph metadata with a nearly 95% F1-score from our initial benchmarking and is portable to different GPU architectures to achieve over an F1-score of over 72% accuracy and a speedup of nearly 183x versus our control running in this new environment.]]></ab></abstract>
		</profileDesc>
	</teiHeader>
	<text><body xmlns="http://www.tei-c.org/ns/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xlink="http://www.w3.org/1999/xlink">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">INTRODUCTION</head><p>Born from "attempts to devise a computational model for humans' inferential reasoning, namely, the mechanism by which people integrate data from multiple sources and generate a coherent interpretation of that data" <ref type="bibr">[13, p. 241]</ref>, belief propagation (BP) models broadly how a change to a node begins a chain reaction of updates which permeates throughout a graph <ref type="bibr">[10]</ref>. Such a simple yet general model has thus wide utility in countless fields including physics, medical imaging, artificial intelligence, computer vision, language understanding, sociology and error correction <ref type="bibr">[18]</ref>. However, the few public implementations of BP limit themselves to graphs of thousands of nodes in size in the inefficient Bayesian Interchange Format (BIF) <ref type="bibr">[4]</ref>. Thus, any application beyond such a small scale is simply infeasible with what is available.</p><p>Moreover, BP's amenability to parallelization holds much promise for optimization research <ref type="bibr">[13]</ref>. In the context of trees, updates flow forward from the root nodes level by level to the terminal nodes and then backwards from the terminal nodes to the source nodes and thus can execute concurrently for all nodes in a given level <ref type="bibr">[10]</ref>. Furthermore, a variation of the algorithm called the loopy BP better suits parallelization and supports general graphs versus just trees <ref type="bibr">[12]</ref>. In this case, all nodes in the graph emit their updates at once continuously until the states of each of the nodes converge individually within a given threshold <ref type="bibr">[7]</ref>. This broadcasting has no dependencies aside from the previous state of the graph beforehand and thus runs simultaneously per iteration until the nodes converge <ref type="bibr">[12]</ref>. Thus, loopy BP in particular is ripe for further refinement.</p><p>Alas, there are many obstacles which stymie this endeavor. Operators must take into account the numerous processing intricacies inherent to the algorithm. Without doing so, naive optimization attempts falter, as we demonstrate with our introductory analysis of the OpenMP and OpenACC-based parallelization efforts. Hence, we utilize a host of fine-grained improvements and techniques to realize the potential of the loopy BP algorithm.</p><p>Herein, we describe in depth Credo which can perform BP efficiently on both large and small graphs by leveraging a suite of refined solutions and a classification method to automatically match the best solution to a given graph. To that end, we first detail two valid approaches to parallelizing loopy BP. We then briefly discuss our initial parallelization efforts with OpenMP and OpenACC before exploring our CUDA work in depth. Moreover, we provide a method to automatically execute the best suited implementation for a given graph by its metadata a priori with portability in mind. Additionally, we provide memory and processing optimizations to maximize the performance of our custom built solution. Furthermore, to support processing graphs of a far larger scale compared to previous works, we alter an existing large scale graph file format called the Matrix Market file format utilized already to store graphs of sizes beyond billions of nodes <ref type="bibr">[16]</ref>. Finally, we evaluate all of our efforts with a diverse benchmark of graphs. We thus make the following contributions to realize the full utility of BP:</p><p>&#8226; A more flexible input file format to support massive sized graphs to represent Bayesian networks, Markov Random Fields or any similarly complex graph beyond the thousands of nodes scale of the existing standard &#8226; Optimized methods for processing graphs by node or edge encompassing improvements such as memory footprint minimization and supporting work queues tuned to this task &#8226; Support for these methods on both CPU and GPU platforms to enable our system to significantly outperform prior work &#8226; A method for automatically matching the ideal implementation from our suite of approaches to an arbitrary graph ahead of time based solely on its metadata which is portable to different GPU environments</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">BACKGROUND 2.1 Belief Propagation</head><p>Belief propagation (BP) models how updates to one or more nodes' internal set of beliefs percolate throughout the whole network <ref type="bibr">[10]</ref>.</p><p>The original networks used for BP are the Bayesian network and Markov Random Field (MRF), which represent potentially complex cause and effect relationships <ref type="bibr">[13][3]</ref>. In particular, BP allows for describing how these relationships change when some new information becomes available. Bayesian networks detail how the probability distribution of an event being in one of several states, i.e. its belief about its current state, represented as the nodes in the graph depend on the distributions of their parent nodes in the graph <ref type="bibr">[18]</ref>. Using the prior joint probability distributions of an event occurring given n causes in the form p(x |x 0 , x 1 ,...,x n ) and treating the parents' states as prior distributions, Bayesian networks enable the calculation of posterior distributions of events occurring <ref type="bibr">[13]</ref>. The posterior calculation is of value when there is new information about an event and how that change impacts the graph in a process called observation <ref type="bibr">[3]</ref>.</p><p>During observation, one now knows for certain if an event occurs and consequently statically sets the probability of that event occurring which in turn sets of a chain of updates to the posterior probabilities throughout the network in a process called belief propagation <ref type="bibr">[13]</ref>.</p><p>We provide a slightly modified version of a popular example of a Bayesian network: the family-out problem <ref type="bibr">[3]</ref>. A family has a house with a dog. They leave the dog outside the house if they are out or the dog is being punished. Similarly, they may leave the lights on when they are out. Finally, the dog may bark if it is out. The prior probabilities and joint distributions are all given in Figure <ref type="figure">1</ref>.</p><p>Although the direct posterior calculations in the family-out are simple enough, they become unwieldy for more complex Bayesian networks and typically necessitate the Markov assumption, wherein an event node's state only depends upon the immediate parents' states and not on the other nodes in the dependency chain <ref type="bibr">[3]</ref> However, this move necessitates using MRFs instead of Bayesian networks, as the latter does not allow for this assumption yet the former does at the expense of only allowing for undirected pairwise relationships <ref type="bibr">[18]</ref>. The calculation of the state of an individual node x i with parents x j and a joint probability distribution p(x i |x j ) linking the two thus is shown below.</p><p>Using the Markov assumption, each node in the dependency chain must compute its new state before broadcasting it down the chain. Due to the undirected nature of the MRF graph though, child events can now affect their parents' own states. Such an event occurs with multiple parents, and in such a case, the child node does not broadcast its update to the parent that initially prompted its update <ref type="bibr">[7]</ref>. Thus, this calculation must occur in both directions except for the additional case of statically fixated observed nodes. Yet another complication to this computation is that an event needs not have a single binary state.</p><p>Indeed, an event may be in one of a wide range of discrete states beyond merely true or false. Therefore, the probability of an event being a given state is of particular value <ref type="bibr">[18]</ref>. This marginal probability computation requires normalizing the final probabilities of the event's states <ref type="bibr">[13]</ref>. Thus, the belief calculation of a node x i with parent node x j , child node x k , functions (i, j) = p(x j )p(x i |x j ) and (i, k) = p(x k )p(x i |x k ) both subject to the aforementioned constraints and the marginalization factor Z is shown in the below equation:</p><p>To simplify processing, one can break up the BP into three phases. First, one emits the -based updates before emitting the -based updates. Afterwards, one calculates the marginals. A major limitation of this method is that the updates must be ordered. The -value emissions must start from the root nodes and work their way down the tree. Likewise, the -value emissions must start from the terminal nodes work their way up the tree to the roots.</p><p>An alternative to this processing is the loopy BP variant as shown in Algorithm 1 as described by Gonzalez et al. <ref type="bibr">[5]</ref>.</p><p>This form provides two major benefits. First, all nodes emit allvalues simultaneously before likewise emitting all -values. Second, these emissions relax the constraint that the graph needs to be acyclic. sum+=di f f ( belief s , belie f s pre ious )</p><p>However, this method comes with the penalty that requires it to run until the nodes' beliefs converge rather than simply twice as before. Although we implement both versions of the algorithm, an initial, sequentially-processed evaluation reveals that the original BP approach has enormous overheads due to determining the levels of a graph and processing the graph by-level versus the by-node and by-edge methods of implementing loopy BP presented next.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.1">Comparison of Belief Propagation Algorithms.</head><p>Using the 10x40, 100x400, 1kx4k, 10kx4k, 100kx400k, 200kx800k, 400kx1600k, 600kx2400k, 800kx3200k, 1Mx4M and 2Mx8M synthetic graphs alone presented in Table <ref type="table">1</ref> in a single-threaded environment, the non-loopy BP implementation is 1032x slower than the by-edge version and 44x slower than the by-node 10kx40k benchmark. This gap in performance widens to at most 11427x and 379x for the 2Mx8M benchmark respectively. The traditional BP approach is on average circa 1014x and 300x slower than the by-edge and bynode versions. Given such a drastic performance difference between the two algorithms and loopy BP's better affinity for parallelization, we ultimately focus on it for the remainder of this paper.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Algorithmic Refinements for Large Graphs</head><p>We refine our broad description of the algorithm to reduce the memory footprint and to improve performance. Although loopy BP defines unique joint probabilities per edge, this requirement represents by far the largest amount of memory consumption for the graph. The joint probability matrix is a floating point matrix whose dimensions are that of the source and terminal nodes' belief arrays as shown in the Figure <ref type="figure">1</ref> as the probability tables below the fo and bp nodes. Loading and unloading a separate matrix per belief update computation also represents a significant performance and memory bottleneck. Thus, we come to a conclusion: this requirement is untenable for large graphs.</p><p>Indeed, the matrix stems from the statistics assembled to define the beliefs of a particular node given a specific neighbor's beliefs <ref type="bibr">[3]</ref>. For large scale networks, assembling such statistics is unwieldy and necessitates using a single estimation for all nodes <ref type="bibr">[3]</ref>. For instance, the operator assumes that the same error rate for any pixel applies to all others in an image or that a virus affects all people identically. Consequently, this consideration drastically reduces the size of the data and enables us to represent networks of millions of nodes.</p><p>To gauge the utility of a single joint probability matrix, we provide a simple demonstration. With this alteration in place and utilizing a micro-benchmark composed of a subset of just the graphs ranging from 10x40 to 800kx1200k of the previously used synthetic graphs in Section 2.1.1, we observe a 2x speedup on average with both C and the CUDA Edge implementations. Given the high memory access cost on the GPU and the CUDA Node application's many more memory accesses compared to the CUDA Edge version, the impact of this change is far starker, yielding over 25x speedups for the larger graphs. Unfortunately, this optimization does break Credo's ability to support the original use case and forces the network to support nodes with beliefs of a constant size. For graphs not in that form, our initial version of Credo lacking this refinement would suffice for most cases, for they would also benefit from Credo's other processing optimizations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3">GPU Architecture</head><p>GPU architecture departs significantly from CPU architecture and being aware of its intricacies is vital to maximizing of the platform <ref type="bibr">[15]</ref>. A CUDA-compatible GPU consists of a set of Streaming Multiprocessors (SMX) consisting of numerous CUDA cores on which a single GPU thread executes <ref type="bibr">[11]</ref>. GPU code or kernels execute on these SMX units in parallel by marshalling a grid consisting of individual thread blocks running on a single SMX <ref type="bibr">[1]</ref>. Within each thread block are individual warps of 32 threads which may execute concurrently as shown in Figure <ref type="figure">2</ref>  <ref type="bibr">[17]</ref>. Typically, each of these  threads perform the same instruction on different sections of data in parallel similar to SIMD architecture in Flynn's taxonomy <ref type="bibr">[15]</ref>. Threads have several options for placing said data which have huge performance impacts. Each SMX has local memory used for stack allocated data <ref type="bibr">[15]</ref>. Additionally, each thread block is able to access a small shared memory block for each thread block depending on the GPU generation capable of fast memory read and write access <ref type="bibr">[11]</ref>. Constant and texture memory caches enable quick reads with the difference being that the former must be set before the kernel executes while the latter can be reset during kernel execution <ref type="bibr">[15]</ref>. Finally, global memory, while slower than the others, is capable storing large data in the Video RAM (VRAM) of the GPU <ref type="bibr">[1]</ref>.</p><p>Figure <ref type="figure">2</ref> shows the relationships between threads and these different types of memory.</p><p>Given the benefits and drawbacks of each of these types of memory, the programmer must consequently take care in placing data onto the GPU.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.4">OpenMP and OpenACC Parallelization</head><p>Given the difficulty writing such meticulous code with low-level APIs like CUDA, the programmer can instead use higher-level ones like OpenMP and OpenACC. They utilize pragma statements which the compiler then interprets at compile-time to generate parallelized code for each target platform. These pragma statements include information about data sharing, atomic operations, reduction operations, vectorization and in the case of OpenACC, placement on the GPU versus CPU. Nevertheless, they lack the fine grained control afforded by the likes of CUDA and come with additional overheads. We utilize OpenMP to distribute work across 8 CPU cores and Ope-nACC for the same across 1920 GPU cores as part of our preliminary attempts at parallelization with the all of the aforementioned optimizations enabled, save for the work queues which require finer grained control than what OpenACC offers to implement. We apply these statements directly on our fully-optimized, single-threaded C implementations' main loops which govern collecting the updates from the parent nodes, compute the updated states and send out the new information. The latter two operations also avail themselves of the vectorization statements to optimize the vector and matrix operations involved therein. Due to some aspects of the application having critical sections, we additionally utilize the atomic statements to ensure correctness. Moreover, the convergence check calculates via a reduction hint the sum of the differences between the previous and current iterations of the nodes' beliefs. Finally, we utilize Ope-nACC's data placement directives to finely manage data transfers between the CPU and GPU.</p><p>Unfortunately, our effort with OpenMP yields poor results. The performance actually decreases for 131 of the 132 benchmark graphs in Table <ref type="table">1</ref> with the average performance penalty for running with 2 core case is circa 1.17x, with 4 cores is 1.65x and with all 8 cores is 4.03x. There is simply not enough work per thread to justify the overhead of spinning and shutting down threads in the aforementioned blocks of code as determined by gprof, taking on average less than 1ms to complete. Additionally, the tail distribution of the work described earlier which is a poor fit for the default scheduler as determined by Intel vTune, yet switching to the dynamic scheduler worsened the problem due to its additional overheads. Compounding the problem is the memory stalls and hyperthreading due to its usage of shared resources, yet disabling it only reduces the overhead to an average of 1.1x for 2 threads and 1.2x for 4 threads. Alas, our effort with OpenACC fares not much better.</p><p>At best, OpenACC offers a 1.25x increase in performance for the K21 graph with the Edge paradigm. However, BP executes for far more iterations compared with our other implementations due to OpenACC's API failing to precisely compute the convergence check. Thus, they largely run for longer times than their C implementation counterparts by terminating much closer to the cap on iterations. However, the OpenACC execution times per iteration can be smaller, resulting in the slightly better performance of such benchmarks like 2Mx8M and LJ. We are only able to achieve these results by keeping most of the data on the GPU after the initial load and only transfer the convergence check after predetermined number of batched iterations after overriding the default behavior of the OpenACC scheduler to try to schedule full transfers of the data between the CPU and GPU after every iteration. Although both OpenACC and OpenMP offer poor justification for parallelization, our efforts here act as a guide for our CUDA work which is uninhibited by such scheduler and platform overheads while providing the necessary finer grained control to achieve high performance.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">CREDO DESIGN 3.1 Overview</head><p>In the following subsections, we describe the various components of Credo. The full system itself comprises of the optimized C and CUDA implementations derived from our dual processing techniques. Based on a given input graph and its metadata, Credo chooses the best from these implementations before executing BP with that method. To support this general functionality, Credo utilizes the components described in the below subsections.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Input Processing</head><p>In order to begin processing massive graphs, we first need to load them. There are two standards for this data: the Bayesian Interchange Format (BIF) and its XML-based sibling (XML-BIF) <ref type="bibr">[4]</ref>. The former necessitates constructing a custom parser for its context-free grammar (CFG), while the latter requires an XML parser. To begin assembling the input graphs, both parsers must load the entire input file into memory first and then utilize hooks for each of the grammars' production rules for actions like defining a node and its metadata and constructing an edge. Compounding this problem is that both formats greatly exceed the size of the extracted graph. The simple family-out network has a 2KB BIF file size compared to handful of bytes used for its in-memory representation, and even a graph of 413 nodes and 602 edges occupying 5.3MB. Indeed, we could not hold graphs larger than 100,000 nodes in memory on a machine with 32GB of memory. Consequently, we would only be able to operate on 7 of the 34 binary belief benchmark graphs presented later on in Table <ref type="table">1</ref>. Moreover, the overhead of building the graphs is far larger than the actual BP execution time. Thus, we seek to obviate these issues by defining a new input format better suited for large scale graphs.</p><p>We propose a new format derived from the Matrix Market (MTX) format. Although MTX can support graphs of massive size, it simply lists out the edges of the graph by node ids after a header line defining the graph dimensions. Given that MRFs have many floating point numbers for the probabilities of each node's states, i.e. beliefs, and the edge's joint probability matrix, we break up the format in two: one for node data and the other for edge data. For both files, our structure is largely the same: two identifiers followed by the probabilities for the node's states or the edge's joint probability matrix. In preserving the original input format's basic structure of edges linked together by node ids, our node input format appears to be nothing but self-cycling nodes. However, this format is simple enough that it can be read line-by-line first by nodes and then edges without loading either fully into memory unlike BIF and BIF-XML. Additionally, parsing it is trivial, requiring a handful of simple regular expressions rather than complex grammars. Moreover, it is general enough to support any network composed of the interaction of random variables and their state probabilities. Thus, Credo can support graphs of millions of nodes, compared with the thousands of nodes of previous works <ref type="bibr">[12]</ref>[5] <ref type="bibr">[6]</ref>, with our dual processing methods combined with our other optimizations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2.1">Comparison of Input</head><p>Processors. We conduct a simple set of benchmarks to demonstrate the value of this format. The simple family-out graph presented in Figure <ref type="figure">1</ref> takes 162&#181;s and 638&#181;s to process with the BIF and BIF-XML parsers respectively. The largest BIF graph we have is circa of 1000 nodes and 2000 edges in size and takes 21ms to parse, while a similar 1000 node and 2000 XML-BIF file takes 83ms to parse. However, our custom MTX parser takes a mere 2ms to parse an equivalent file and produce the same graph logically. The largest BIF-XML file of 100,000 nodes and 200,000 edges we can parse without exceeding the 32GB of memory for our test system takes 8.4s. In comparison, our MTXbased parser can parse a similar 100,000 and 400,000 graph in .28s. Our BP methods take between 0.05 and 4.7s to process that graph. Indeed, our parser significantly reduces total execution time while being capable of parsing a graph of over 250 million edges.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Per-Node and Per-Edge Processing</head><p>Credo supports two possible ways of processing a using BP: by node and edge. In the former, each edge pulls the current state of the parent node and combines it with the joint probability matrix along the edge and the child node's state to produce the new state of the child node. In contrast, per-node processing pulls the states of all the parent nodes of a given node, combines them with the joint probability matrix for the edges linking the parents with the child before combining the updates with the child node's state to produce its new state as shown in Figure <ref type="figure">3</ref>. Thus, when treating the undirected edges of an MRF as containing two separate edges to account for observed nodes being statically set, these two approaches enable Credo to perform the and calculations described in Equation <ref type="formula">2</ref>and implement lines 6-10 of Algorithm 1. All other BP operations such as marginalization and the convergence check are the same across these designs. However, there are some trade-offs between the two which impact the performance of these approaches.  In particular, there is an issue of the overhead of extra atomic operations versus memory lookups when moving from a single threaded environment to a multi-threaded one as shown in Figure <ref type="figure">3</ref>. With the edge approach, a child node may have many parents and thus must combine each edge's contribution to its new state atomically to avoid race conditions. In contrast, the per-node approach does not require the use of extra atomic operations but performs more memory lookups by querying the state of each parent node for a given node. Additionally, these lookups occur in random order, hampering effective caching. Afterwards, the node approach must combine all of these states in memory with the joint probability matrix for the combined update message sent to the recipient, while the edge approach merely only has one state to combine for its message. Given there are far more edges than nodes in a graph, the latter-based approach requires more iterations to converge than the former. Yet, as our evaluation demonstrates later on, deciding which of these two different approaches for a given graph is not immediately obvious and Credo provides a mechanism to help choose that approach which includes both CPU and GPU-based implementations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.4">Data Structures</head><p>For all of our implementations, we make numerous data structure optimizations to minimize the size of the graph in memory, to minimize costly memory lookups and to maximize performance. We therefore only store the minimum necessary information about the graph which is the nodes' names and beliefs and indices for the edges between nodes. Before our processing refinement, we also store the joint probability matrices per edge. To minimize the overhead of examining each of the edges of the graph during BP computation, Credo indexes the edges' nodes and utilize compressed adjacency lists to represent the edges. Thus, Credo keeps itself largely to these indices and only touches the actual edge and node values when performing the actual mathematics involved in BP. However, we consider two avenues to go about implementing these structures.</p><p>In particular, we have options of a struct of arrays (SoA) and an array of structs (AoS) for storing the belief and joint probability data, which are simply sequences of single precision floating point numbers and their dimensions. During the initial development of Credo, we implement both before the other optimizations below and perform a limited analysis with the synthetic benchmark graphs up to and including 100,000 nodes in size (10x40 to 100kx400k) used for the algorithm comparisons in Section 2.1.1 and profile the code using valgrind's cachegrind utility. With the SoA design, we have large, flattened, parallel-indexed arrays consisting for the probabilities and dimensions, while for the AoS paradigm, we have arrays holding structs consisting of a statically allocated float array and unsigned integers for the dimensions. Regardless of the graph and processing approach, we see that the AoS approach has circa 56% fewer data cache reads and writes. Thus, we opt to only use the AoS design with Credo.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.5">Work Queues</head><p>From profiling, we observe that most nodes converge quickly after a few iterations and that graph convergence becomes dependent on a few nodes. To only process these nodes, we utilize work queues for both approaches. Instead of operating on a full list of node or edge indices depending on the approach, the queues merely consist of the indices of unconverged nodes or edges. However, after every iteration, the queue clears itself and populates atomically with the indices of elements which have yet to converge to a given threshold. As a result, this computation can drastically reduce the processing time overall at the cost of additional overhead in managing the queue. they break the images down significantly to 256x256 blocks for the actual computations which does introduce additional errors into their results from not fully processing the graph. Thus, there is still much opportunity for efficiently parallelizing BP for large graphs without making the sacrifices to input size or actual processing.</p><p>Indeed, efforts utilizing parallelization techniques ranging from dynamically scheduling to MapReduce and MPI have found great success. Nevertheless, they too limit themselves to small graphs. Ma et al. <ref type="bibr">[12]</ref> implement a custom scheduler using pthreads to efficiently schedule updates on a 40-core CPU to process graphs of roughly 4,000 nodes in 4s, while we can process a similar graph in about 1ms. Gonzalez et al. <ref type="bibr">[5]</ref> utilize MapReduce to parallelize traditional BP by performing the updates at a given level of a tree in parallel to process a 460,000 node graph in about 12s, while in another effort, Gonzalez et al. <ref type="bibr">[6]</ref> take 6.4s for a 58,000 edge graph using 40 servers using pthreads and OpenMPI. In contrast, Credo can process graphs of comparable size in 0.7s and 0.06s respectively. Kang et al. <ref type="bibr">[9]</ref> successfully employ BP to process massive-scale graphs consisting of billions of edges using the message passing interface (MPI) library, although this effort necessitates reprocessing the graph into a form amenable to this distributed environment. Additionally, due to network latencies from the frequent message passing inherent to BP, their solution takes hours to process our benchmark graphs as previewed during our analysis. However, Credo can process similar graphs in 2-3s. In contrast to these previous works, our GPU design for BP does not suffer from the overhead of CPU-based pthreads, does not limit itself to trees in terms of input graph structure and can process considerably larger graphs of at least an order of magnitude greater size in seconds rather than hours.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="5.2">Graph GPU-based Frameworks</head><p>Several GPU-based frameworks enable application developers to process massive graphs using common algorithms such as singlesource shortest path (SSSP) and PageRank <ref type="bibr">[17]</ref> such as Gunrock, nvGRAPH and Groute <ref type="bibr">[1]</ref>[15] <ref type="bibr">[17]</ref>. Although they do not implement BP and are heavily reliant on the CSR format, there are several optimizations they utilize of note. nvGRAPH <ref type="bibr">[15]</ref> borrows the concept of semi-rings from linear algebra to genericize common graph operations and provides a custom scheduler optimized for semi-rings. Gunrock abstracts all graph operations as a series of advance, filter and computation steps operating either on nodes or edges utilizing optimizations such as kernel fusion, push-pull traversal, idempotent traversal and priority queues. Groute <ref type="bibr">[1]</ref> asynchronous execution using a custom scheduler for multi-GPU support using nVIDIA's NCCL library. However, all of these optimizations are useless to complex graph algorithms like BP which do not adhere directly to the CSR format and its assumption of one floating point number or integer per node. Consequently, these frameworks cannot perform complex graph processing on the level of BP, despite their impressive results. Meanwhile, our solution can while also profiting from several of their optimizations.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="6">CONCLUSIONS</head><p>Through the course of our research, we successfully enable belief propagation to run for small and large scale graphs utilizing Credo. To support this endeavor, we present a simple yet flexible input format to represent those graphs. We provide a host of designs utilizing significant workload, memory and threading management optimizations to handle a plethora of benchmark graphs. We even attain speedups over 120x in some cases versus our control single threaded implementations on our initial evaluation system and over 184x speedup in other environments. Finally, we describe a viable, portable method for selecting a priori the best implementation for a given graph and process the graph using that method automatically with Credo.</p></div></body>
		</text>
</TEI>
