source: docs/HPCA2011/09-pipeline.tex @ 1320

Last change on this file since 1320 was 1320, checked in by lindanl, 8 years ago

multi-thread section

File size: 4.8 KB
Line 
1\section{Multi-threaded Parabix}
2The general problem of addressing performance through multicore parallelism
3is the increasing energy cost. As discussed in previous sections,
4Parabix, which applies SIMD-based techniques can not only achieves better performance but consumes less energy.
5Moreover, using mulitiple cores, we can further improve the performance of Parabix while keeping the energy consumption at the same level.
6
7The typical approach to parallelizing software (data parallelism)
8requires nearly independent data, which is a difficult task
9for dividing XML data. A simple division determined by the
10segment size can easily make most of the segments illegal
11according to the parsing rules while the data as a whole is legal.
12Therefore, instead of dividing the data into segments and
13assigning different data segments to different cores,
14we divide the process into several stages and let each core work with one single stage.
15
16The interface between stages is implemented using a circular array,
17where each entry consists of all ten data structures for one segment as listed in Table \ref{pass_structure}.
18Each thread keeps an index of the array ($I_N$),
19which is compared with the index ($I_{N-1}$) kept by its previous thread before processing the segment.
20If $I_N$ is smaller than $I_{N-1}$, thread N can start processing segment $I_N$,
21otherwise the thread keeps reading $I_{N-1}$ until $I_{N-1}$ is larger than $I_N$.
22The time consumed by continuously loading the value of $I_{N-1}$ and
23comparing it with $I_N$ will be later referred as stall time.
24When a thread finishes processing the segment, it increases the index by one.
25
26\begin{table*}[t]
27\begin{center}
28\begin{tabular}{|c|c|c|c|c|c|c|c|c|c|c|c|}
29\hline
30       & & \multicolumn{10}{|c|}{Data Structures}\\ \hline
31       &                & srcbuf & basis\_bits & u8   & lex   & scope & ctCDPI & ref    & tag    & xml\_names & check\_streams\\ \hline
32Stage1 &fill\_buffer    & write  &             &      &       &       &        &        &        &            &               \\ 
33       &s2p             & read   & write       &      &       &       &        &        &        &            &               \\ 
34       &classify\_bytes &        & read        &      & write &       &        &        &        &            &               \\ \hline
35Stage2 &validate\_u8    &        & read        & write&       &       &        &        &        &            &               \\ 
36       &gen\_scope      &        &             &      & read  & write &        &        &        &            &               \\ 
37       &parse\_CtCDPI   &        &             &      & read  & read  & write  &        &        &            & write         \\ 
38       &parse\_ref      &        &             &      & read  & read  & read   & write  &        &            &               \\ \hline
39Stage3 &parse\_tag      &        &             &      & read  & read  & read   &        & write  &            &               \\ 
40       &validate\_name  &        &             & read & read  &       & read   & read   & read   & write      & write         \\ 
41       &gen\_check      &        &             & read & read  & read  & read   &        & read   & read       & write         \\ \hline
42Stage4 &postprocessing  & read   &             &      & read  &       & read   & read   &        &            & read          \\ \hline
43\end{tabular}
44\end{center}
45\caption{Relationship between Each Pass and Data Structures} 
46\label{pass_structure} 
47\end{table*}
48
49Figure \ref{multithread_perf} demonstrates the XML well-formedness checking performance of
50the multi-threaded Parabix in comparison with the single-threaded version.
51The multi-threaded Parabix is more than two times faster and runs at 2.7 cycles per input byte on the \SB{} machine.
52
53\begin{figure}
54\begin{center}
55\includegraphics[width=0.5\textwidth]{plots/performance.pdf}
56\end{center}
57\caption{Processing Time (y axis: CPU cycles per byte)}
58\label{multithread_perf}
59\end{figure}
60
61Figure \ref{power} shows the average power consumed by the multi-threaded Parabix in comparison with the single-threaded version.
62By running four threads and using all the cores at the same time, the power consumption of the multi-threaded Parabix is much higher
63than the single-threaded version. However, the energy consumption is about the same, because the multi-threaded Parabix needs less processing time.
64In fact, as shown in Figure \ref{energy}, parsing soap.xml using multi-threaded Parabix consumes less energy than using single-threaded Parabix.
65
66\begin{figure}
67\begin{center}
68\includegraphics[width=0.5\textwidth]{plots/power.pdf}
69\end{center}
70\caption{Average Power (watts)}
71\label{power}
72\end{figure}
73\begin{figure}
74\begin{center}
75\includegraphics[width=0.5\textwidth]{plots/energy.pdf}
76\end{center}
77\caption{Energy Consumption (nJ per byte)}
78\label{energy}
79\end{figure}
80
Note: See TracBrowser for help on using the repository browser.