source: docs/HPCA2012/final_ieee/09-pipeline.tex @ 1752

Last change on this file since 1752 was 1743, checked in by ashriram, 8 years ago

First pass final version [ashriram]

File size: 5.0 KB
1\section{Multithreaded Parabix}
3Even if an application is infinitely parallelizable and thread
4synchronization costs are non-existent, all applications are constrained by
5the power and energy overheads incurred when utilizing multiple cores:
6as more cores are put to work, a proportional increase in power occurs.
7Unfortunately, due to the runtime overheads associated with
8thread management and data synchronization, it is very hard to obtain
9corresponding improvements in performance resulting in increased
10energy costs. Parabix-XML can improve performance and reduce energy consumption
11by improving the overall computation efficiency.
12However, up to this point, we restricted Parabix-XML to a
13single core. In this section, we discuss our parallelized version of Parabix-XML
14to study the effects of thread-level parallelism in
15conjunction with Parabix-XML's data parallelism.
18The typical approach to handling data parallelism with multiple threads
19involves partitioning data uniformly across the threads. However XML
20parsing is inherently sequential, which makes it difficult to
21partition the data. Several attempts have been made to address this
22problem using a preparsing phase to help determine the tree structure
23and to partition the XML document accordingly~\cite{dataparallel}.
24Another approach involved speculatively partitioning the data~\cite{Shah:2009} but
25this introduced a significant level of complexity into the overall logic of the program.
35        & functions                                            & latency(C/B)     \\ \hline
36Stage1  & read\_data, transposition, classification            & 1.97             \\ \hline
37Stage2  & validate\_u8,  gen\_scope, parse\_CtCDPI, parse\_ref & 1.22             \\ \hline
38Stage3  & parse\_tag validate\_name gen\_check                 & 2.03             \\ \hline
39Stage4  & postprocessing                                       & 1.32             \\ \hline
42\caption{Stage Division} 
47In contrast to those methods, we adopted a parallelism strategy that requires
48neither speculation nor pre-parsing.
49As described in Section~\ref{section:parser}, Parabix-XML consists of multiple
50passes that, on every chunk of input data, interact with each other
51in sequence with no data movement from later to earlier
52passes. This fits well into the mold of pipeline parallelism. We
53partitioned Parabix-XML into four stages and assigned a core to
54each to stage. One of the key challenges was to determine which passes
55should be grouped together. By analyzing the latency and data dependencies of each of
56the passes in the single-threaded version of Parabix-XML
57(Column 3 in Table~\ref{pass_structure}), and assigned the passes
58to stages such that provided the maximal throughput.
61The interface between stages is implemented using a ring buffer, where
62each entry consists of all ten data structures for one segment.
63Each pipeline stage $S$ maintains
64the index of the buffer entry ($I_S$) that is being processed. Before
65processing the next buffer frame the stage check if the previous stage
66is done by spinning on $I_{S-1}$ (Stage $S-1$'s buffer entry). In
67commodity multicore chips typically all threads share the last level
68cache. If we let the faster pipeline stages run ahead, the data they
69process will increase contention to the shared cache. To prevent this
70we limit how far the faster pipeline stages can run ahead by
71controlling the overall size of the ring buffer. Whenever a faster stage
72runs ahead, it will effectively cause the ring buffer to fill up and
73force that stage to stall. Experiments show that 6 entries of the
74circular buffer gives the best performance.
76Figure~\ref{multithread_perf} demonstrates the performance improvement
77achieved by pipelined Parabix-XML in comparison with the
78single-threaded version.  The 4-threaded version is $\simeq2\times$
79faster compared to the single threaded version and achieves
80$\simeq2.7$ cycles per input byte by exploiting SIMD units of all
81\SB{}'s cores.  This performance approaches the 1 cycle per byte
82performance of custom hardware solutions~\cite{DaiNiZhu2010}. Parabix
83demonstrates the potential to enable an entire new class of
84applications, text processing, to exploit multicores.
87Figure \ref{multithread_perf} also shows the average power consumed by the
88multithreaded Parabix. Overall, as expected the power consumption
89increases in proportion to the number of
90active cores. Note that the increase is not linear, since shared units
91such as last-level-caches consume active power even if only one core
92is active. Perhaps more interestingly there is a reduction in execution time,
93which leads to the energy consumption being similar to the the single-thread execution
94(in some cases marginally less energy e.g., soap.xml). 
102\caption{Average Statistic of Multithreaded Parabix}
Note: See TracBrowser for help on using the repository browser.