# Changeset 895 for docs/EuroPar2011

Ignore:
Timestamp:
Feb 5, 2011, 5:05:29 PM (8 years ago)
Message:

Trim intro and tighten section 2.

Location:
docs/EuroPar2011
Files:
7 edited

Unmodified
Added
Removed
• ## docs/EuroPar2011/Demo/bitutil.py

 r879 stream >>= 1 return str def string2bitstream(s): rslt = 0 for i in s[::-1]: rslt *= 2 if i == '1': rslt += 1 return rslt def print_aligned_streams(stream_list):
• ## docs/EuroPar2011/Demo/europar.py

 r884 cursor = lex.Digit & ~ bitutil.Advance(lex.Digit) cursor2 = cursor + lex.Digit bitutil.print_aligned_u8_byte_streams([('source data', chardata[::-1]), bitutil.print_aligned_u8_byte_streams([('source data $\\vartriangleleft$', chardata[::-1]), ('cursor', bitutil.bitstream2stringLE(cursor, lgth, zero_ch)), ('[0-9] stream', bitutil.bitstream2stringLE(lex.Digit, lgth, zero_ch)), cursor = lex.Digit & ~ bitutil.Advance(lex.Digit) cursor2 = cursor + lex.Digit return bitutil.latex_streams([('source data', chardata[::-1]), ('$C_0$', bitutil.bitstream2stringLE(cursor, lgth, zero_ch)), return bitutil.latex_streams([('source data $\\vartriangleleft$', chardata[::-1]), ('$M_0$', bitutil.bitstream2stringLE(cursor, lgth, zero_ch)), ('$D$', bitutil.bitstream2stringLE(lex.Digit, lgth, zero_ch)), ('$C_1 = C_0 + D$', bitutil.bitstream2stringLE(cursor2, lgth, zero_ch))]) ('$M_1 = M_0 + D$', bitutil.bitstream2stringLE(cursor2, lgth, zero_ch))]) def latex_numeric_scan2(chardata, cursorstr): (u8, control, lex) = byteclass.classify_bytes(bit) (u8x, control2, lex2) = byteclass.classify_bytes(bit2) cursor = lex2.Digit cursor = bitutil.string2bitstream(cursorstr) temp = (cursor + lex.Digit) cursor2 = temp & ~lex.Digit ('$B_1$', bitutil.bitstream2stringLE(bit[6], lgth, zero_ch)), ('$B_0$', bitutil.bitstream2stringLE(bit[7], lgth, zero_ch)), ('\\verb:[#]:', bitutil.bitstream2stringLE(lex.Hash, lgth, zero_ch)), ('\\verb:[0-9]:', bitutil.bitstream2stringLE(lex.Digit, lgth, zero_ch)), ('$D =$\\verb:[0-9]:', bitutil.bitstream2stringLE(lex.Digit, lgth, zero_ch)), ('$M_0 =$\\verb:[#]:', bitutil.bitstream2stringLE(lex.Hash, lgth, zero_ch)), ('$M_0 =$', bitutil.bitstream2stringLE(cursor, lgth, zero_ch)), ('$M_0 + D$',  bitutil.bitstream2stringLE(temp, lgth, zero_ch)), ('$M_1 = (M_0 + D) \\wedge \\neg D$', bitutil.bitstream2stringLE(cursor2, lgth, zero_ch))]) def europar1(): return latex_numeric_scan2('--123----13794----1----456---249371----', '..1......1........1............1.......') '...........1......1....1.....1.........')
• ## docs/EuroPar2011/europar-cameron.aux

 r894 \relax \citation{Asanovic:EECS-2006-183} \citation{Scarpazza:2009} \citation{XMLSSE42} \@writefile{toc}{\contentsline {title}{Parallel Scanning with Bitstream Addition: An XML Case Study}{1}} \@writefile{toc}{\authcount {6}} \@writefile{toc}{\contentsline {author}{Robert D. Cameron \and Ehsan Amiri \and Kenneth S. Herdy \and Dan Lin \and Thomas C. Shermer \and Fred P. Popowich}{1}} \@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}} \citation{Cameron2009,PPoPP08,CameronHerdyLin2008} \citation{CameronHerdyLin2008} \citation{PPoPP08,CameronHerdyLin2008,Green2009} \citation{CameronHerdyLin2008} \citation{Herdy2008} \citation{DaiNiZhu2010} \citation{ZhangPanChiu09} \citation{Cameron2009,PPoPP08} \@writefile{toc}{\contentsline {title}{Parallel Scanning with Bitstream Addition: An XML Case Study}{1}} \@writefile{toc}{\authcount {6}} \@writefile{toc}{\contentsline {author}{Robert D. Cameron \and Ehsan Amiri \and Kenneth S. Herdy \and Dan Lin \and Thomas C. Shermer \and Fred P. Popowich}{1}} \@writefile{toc}{\contentsline {section}{\numberline {1}Introduction}{1}} \@writefile{toc}{\contentsline {section}{\numberline {2}The Parallel Bitstream Method}{2}} \newlabel{sec:parabit}{{2}{2}} \@writefile{toc}{\contentsline {subsection}{\numberline {2.1}Fundamentals}{2}} \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Basis and Character-Class Bitstreams}}{2}} \newlabel{fig:inputstreams}{{1}{2}} \citation{CameronHerdyLin2008} \citation{CameronLin2009,HilewitzLee2006} \@writefile{lof}{\contentsline {figure}{\numberline {1}{\ignorespaces Basis and Character-Class Bitstreams}}{3}} \newlabel{fig:inputstreams}{{1}{3}} \@writefile{toc}{\contentsline {subsection}{\numberline {2.2}A Parallel Scanning Primitive}{4}} \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Bitstream addition}}{4}} \@writefile{toc}{\contentsline {subsection}{\numberline {2.2}A Parallel Scanning Primitive}{3}} \@writefile{lof}{\contentsline {figure}{\numberline {2}{\ignorespaces Parallel Scan Using Bitstream Addition and Mask}}{4}} \newlabel{fig:scan1}{{2}{4}} \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces Parallel Scan Using Addition and Mask}}{5}} \newlabel{fig:scan2}{{3}{5}} \@writefile{toc}{\contentsline {section}{\numberline {3}XML Scanning and Parsing}{5}} \newlabel{sec:errorstream}{{3}{5}} \@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces XML Grammar: Decimal Character References and Start Tags}}{5}} \newlabel{fig:xmlgrmr}{{4}{5}} \@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Parsing Decimal References}}{6}} \newlabel{fig:decref}{{5}{6}} \@writefile{lof}{\contentsline {figure}{\numberline {6}{\ignorespaces Start Tag Parsing}}{7}} \newlabel{fig:stag-ex}{{6}{7}} \@writefile{toc}{\contentsline {section}{\numberline {3}XML Scanning and Parsing}{4}} \newlabel{sec:errorstream}{{3}{4}} \@writefile{lof}{\contentsline {figure}{\numberline {3}{\ignorespaces XML Grammar: Decimal Character References and Start Tags}}{5}} \newlabel{fig:xmlgrmr}{{3}{5}} \@writefile{lof}{\contentsline {figure}{\numberline {4}{\ignorespaces Parsing Decimal References}}{5}} \newlabel{fig:decref}{{4}{5}} \@writefile{lof}{\contentsline {figure}{\numberline {5}{\ignorespaces Start Tag Parsing}}{6}} \newlabel{fig:stag-ex}{{5}{6}} \citation{TR:XML} \@writefile{toc}{\contentsline {section}{\numberline {4}XML Well-Formedness}{8}} \@writefile{toc}{\contentsline {section}{\numberline {4}XML Well-Formedness}{7}} \citation{DaiNiZhu2010} \@writefile{toc}{\contentsline {section}{\numberline {5}Compilation to Block-Based Processing}{10}} \newlabel{sec:compile}{{5}{10}} \@writefile{toc}{\contentsline {section}{\numberline {5}Compilation to Block-Based Processing}{9}} \newlabel{sec:compile}{{5}{9}} \@writefile{toc}{\contentsline {section}{\numberline {6}Performance Results}{10}} \citation{GML04} \@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces XML Document Characteristics}}{11}} \newlabel{XMLDocChars}{{1}{11}} \@writefile{lot}{\contentsline {table}{\numberline {1}{\ignorespaces XML Document Characteristics}}{10}} \newlabel{XMLDocChars}{{1}{10}} \@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Parser Performance (Cycles Per Byte)}}{11}} \newlabel{parsers-cpb}{{2}{11}} \@writefile{toc}{\contentsline {section}{\numberline {7}Conclusion}{11}} \bibstyle{plain} \bibdata{xmlperf} \@writefile{lot}{\contentsline {table}{\numberline {2}{\ignorespaces Parser Performance (Cycles Per Byte)}}{12}} \newlabel{parsers-cpb}{{2}{12}} \@writefile{toc}{\contentsline {section}{\numberline {7}Conclusion}{12}} \bibcite{Asanovic:EECS-2006-183}{1} \bibcite{TR:XML}{2} \bibcite{Cameron2009}{3} \bibcite{PPoPP08}{4} \bibcite{CameronHerdyLin2008}{5} \bibcite{CameronLin2009}{6} \bibcite{DaiNiZhu2010}{7} \bibcite{Herdy2008}{8} \bibcite{HilewitzLee2006}{9} \bibcite{GML04}{10} \bibcite{XMLSSE42}{11} \bibcite{Leventhal2009}{12} \bibcite{Scarpazza:2009}{13} \bibcite{ZhangPanChiu09}{14} \bibcite{PPoPP08}{3} \bibcite{CameronHerdyLin2008}{4} \bibcite{DaiNiZhu2010}{5} \bibcite{Green2009}{6} \bibcite{Herdy2008}{7} \bibcite{GML04}{8} \bibcite{Leventhal2009}{9} \bibcite{ZhangPanChiu09}{10}
• ## docs/EuroPar2011/europar-cameron.bbl

 r879 \newblock W3C Recommendation, 2008. \bibitem{Cameron2009} Rob Cameron, Ken Herdy, and Ehsan Amiri. \newblock Parallel bit stream technology as a foundation for {XML} parsing performance. \newblock In {\em International Symposium on Processing {XML} Efficiently: Overcoming Limits on Space, Time, or Bandwidth}, August 2009. \bibitem{PPoPP08} Robert~D. Cameron. York, NY, USA, 2008. ACM. \bibitem{CameronLin2009} Robert~D. Cameron and Dan Lin. \newblock Architectural support for swar text processing with parallel bit streams: the inductive doubling principle. \newblock In {\em {ASPLOS} '09: Proceeding of the 14th international conference on Architectural support for programming languages and operating systems}, pages 337--348, New York, NY, USA, 2009. ACM. \bibitem{DaiNiZhu2010} Zefu Dai, Nick Ni, and Jianwen Zhu. New York, NY, USA, 2010. ACM. \bibitem{Green2009} J.R. Green, H.~Mahmoud, and M.~Dumontier. \newblock Modeling tryptic digestion on the {Cell BE} processor. \newblock In {\em Proceedings of the Canadian Conference on Electrical and Computer Engineering (CCECE '09)}, May 2009. \bibitem{Herdy2008} Kenneth~S. Herdy, David~S. Burggraf, and Robert~D. Cameron. presentation of geographic data in web-based mapping systems. \newblock In {\em Proceedings of {SVG} Open 2008}, August 2008. \bibitem{HilewitzLee2006} Yedidya Hilewitz and Ruby~B. Lee. \newblock Fast bit compression and expansion with parallel extract and parallel deposit instructions. \newblock In {\em {ASAP} '06: Proceedings of the IEEE 17th International Conference on Application-specific Systems, Architectures and Processors}, pages 65--72, Washington, DC, USA, 2006. IEEE Computer Society. \bibitem{GML04} \newblock John Wiley \& Sons, Inc., 2004. \bibitem{XMLSSE42} Zhai Lei. \newblock {XML} parsing accelerator with intelÂ® streaming {SIMD} extensions 4 (intelÂ® {SSE4}). \newblock {http://software.intel.com/en-us/articles/xml-parsing-accelerator-with-intel% -streaming-simd-extensions-4-intel-sse4/}, 2008. \bibitem{Leventhal2009} Michael Leventhal and Eric Lemoine. \newblock In {\em International Symposium on Processing {XML} Efficiently: Overcoming Limits on Space, Time, or Bandwidth}, August 2009. \bibitem{Scarpazza:2009} Daniele~Paolo Scarpazza and Gregory~F. Russell. \newblock High-performance regular expression scanning on the cell/b.e. processor. \newblock In {\em Proceedings of the 23rd international conference on Supercomputing}, ICS '09, pages 14--25, New York, NY, USA, 2009. ACM. \bibitem{ZhangPanChiu09}
• ## docs/EuroPar2011/europar-cameron.tex

 r894 \section{Introduction} Traditional byte-at-a-time parsing technology is increasingly mismatched to the capabilities of modern processors.   Current commodity processors generally possess 64-bit general purpose registers as well as 128-bit SIMD registers, with 256-bit registers now appearing.   General purpose processing on graphics processors can make available 512-bit or wider registers.   Parsing models based on the traditional loading and processing of 8 bits at a time would seem to be greatly underutilizing processor resources. Unfortunately, parsing is hard to parallelize.   Indeed, in their seminal report outlining the landscape of parallel computing research, researchers from Berkeley identified the finite state machine methods underlying parsing and lexical processing as the hardest of the "13 dwarves" to parallelize, concluding at one point that "nothing helps." \cite{Asanovic:EECS-2006-183}   SIMD methods, in particular, would seem to be ill-suited to parsing, because textual data streams are seldom organized in convenient 16-byte blocks, tending to consist instead of variable-length items in generally unpredictable patterns. Nevertheless, there have been some notable works such as that of Scarpazza in applying the multicore and SIMD capabilities of the Cell/BE processor to regular expression matching \cite{Scarpazza:2009}. Intel has also signalled the importance of accelerated string processing to its customers through the introduction of new string processing instructions in the SSE 4.2 instruction set extension, demonstrating how those features may be used to advantage in activities such as XML parsing \cite{XMLSSE42}. Our research has been exploring a promising alternative approach, however, based on the concept of {\em parallel bitstreams} \cite{Cameron2009,PPoPP08,CameronHerdyLin2008}. In this approach, byte streams are first sliced into eight basis bitstreams, one for each bit position within the byte.  Bit stream $i$ thus comprises the $i$th bit of each byte.   Using 128-bit SIMD registers, then, bitwise logic operations on these basis bitstreams allows byte classification operations to be carried out in parallel for 128 bytes at a time.  For example, consider a character class bitstream \verb:[<]: using a 1 bit to mark the position of opening angle brackets in a byte stream.  This stream may computed as logical combination of the basis bitstreams using only seven bitwise logical operations per 128 bytes. Based on this approach, our prior work has shown how parallel bitstreams may be used to accelerate XML parsing by further taking advantage of processor {\em bit scan} instructions, commonly found within commodity processors \cite{CameronHerdyLin2008}. On current Intel or AMD processors, for example, these instructions allow one to determine the position of the first 1 bit in a group of 64 in a single instruction.   Using these techniques, our Parabix 1 parser demonstrated offered considerable accelaration of XML parsing in statistics gathering \cite{CameronHerdyLin2008} as well as GML to SVG conversion \cite{Herdy2008}. Although the finite state machine methods used in the scanning and parsing of text streams is considered to be the hardest of the 13 dwarves'' to parallelize \cite{Asanovic:EECS-2006-183}, parallel bitstream technology shows considerable promise for these types of applications\cite{PPoPP08,CameronHerdyLin2008,Green2009}. In this approach, character streams are processed $N$ positions at a time using the $N$-bit SIMD registers commonly found on commodity processors (e.g., 128-bit XMM registers on Intel/AMD chips). This is achieved by first slicing the byte streams into eight separate basis bitstreams, one for each bit position within the byte. These basis bitstreams are then combined with bitwise logic and shifting operations to compute further parallel bit streams of interest, such as the \verb:[<]: bit stream marking the position of all opening angle brackets in an XML document. Using these techniques as well as the {\em bit scan} instructions also available on commodity processors, the Parabix 1 XML parser was shown to considerably accelerate XML parsing in comparison with conventional byte-at-a-time parser in applications such as statistics gathering \cite{CameronHerdyLin2008} and as GML to SVG conversion \cite{Herdy2008}. Other efforts to accelerate XML parsing include the use of custom XML chips \cite{Leventhal2009}, FPGAs \cite{DaiNiZhu2010}, and In this paper, we further increase the parallelism in our methods by introducing a new parallel scanning primitive using bitstream addition.   In essence, multiple 1 bits in a marker stream identify current scanning positions for multiple instances of a particular syntactic context within a byte stream. These multiple marker positions may each be independently advanced in parallel using addition and masking. The net result is a new scanning primitive that allows multiple instances of syntactic elements to be parsed simultaneously.   For example, in dense XML markup, one might find several instances of particular types of markup tags within a given 64-byte block of text; parallel addition on 64-bit words allows all such instances to be processed at once. addition.   In essence, this primitive replaces the sequential bit scan operations underlying Parabix 1 with a new approach that independently advances multiple marker bits in parallel using simple addition and logic operations.   This paper documents the technique and evaluates it in application to the problem of XML parsing and well-formedness checking. Section 2 reviews the basics of parallel bitstream technology and introduces our new parallel scanning primitive.  Section 3 goes on to show how this primitive may be used in XML scanning and parsing, while Section 4 discusses the construction of a complete XML well-formedness checker based on these techniques. Section 5 then briefly describes the compiler technology used to generate the low level code for our approach.  A performance study in Section 6 shows that the new Parabix 2 parser is dramatically faster than traditional byte-at-a-time parsers as well as the original Parabix 1 parser, particularly for dense XML markup.  Section 7 concludes the paper. % The remainder of this paper is organized as follows. A bitstream is simply a sequence of $0$s and $1$s, where there is one such bit in the bitstream for each character in a source data stream. For parsing, and other text processing tasks, we need to consider multiple properties of characters at different stages during the parsing process. A bitstream can be associated with each of these properties, and hence there will be multiple (parallel) bitstreams associated with a source data stream of characters \cite{Cameron2009,PPoPP08}. For parsing, and other text processing tasks, we need to consider multiple properties of characters at different stages during the parsing process. A bitstream can be associated with each of these properties, and hence there will be multiple (parallel) bitstreams associated with a source data stream of characters. The starting point for bitstream methods are \emph{basis} bitstreams transposition and less than 1 CPU cycle per byte for all the character classes needed for XML parsing \cite{CameronHerdyLin2008}. Improved instruction sets using parallel extract operations or inductive doubling techniques may further reduce this overhead significantly \cite{CameronLin2009,HilewitzLee2006}. %Improved instruction sets using parallel extract operations or %inductive doubling techniques may further reduce this overhead significantly \cite{CameronLin2009,HilewitzLee2006}. Beyond the bitwise logic needed for character class determination, Figure \ref{fig:scan1} illustrates the basic concept underlying parallel parsing with bitstream addition. As with the previous figures, all streams are shown in little-endian All streams are shown in little-endian representation, with streams reading from right-to-left. The first row shows a source data stream that includes three spans of digits, $13840$, $1139845$, and $127$, with other nondigit characters shown The first row shows a source data stream that includes several spans of digits, together with other nondigit characters shown as hyphens.  The second row specifies the parsing problem using a marker bitstream $M_0$ to mark three initial marker positions at the start of each span of digits. using a marker bitstream $M_0$ to mark four initial marker positions.  In three instances, these markers are at the beginning (i.e., little end) of a span, while one is in the middle of a span. The parallel parsing task is to move each of the three markers forward through the corresponding spans of of the four markers forward through the corresponding spans of digits to the immediately following positions. \begin{figure}[tbh] \begin{center} \begin{tabular}{l@{}lr}\\ \multicolumn{2}{l}{source data $\vartriangleleft$} & \verb--721----5489311-----04831------\\ $M_0$ &                   & \verb....1..........1.........1......\\ $D$   & $= \verb[0..9]$ & \verb..111....1111111.....11111......\\ $M_1$ & $= M_0 + D$      & \verb.1......1...........1........... \begin{tabular}{cr}\\ source data $\vartriangleleft$ & \verb----173942---654----1----49731----321--\\ $M_0 =$ & \verb.........1.....1....1......1...........\\ $D =$\verb:[0-9]: & \verb....111111...111....1....11111....111..\\ $M_0 + D$ & \verb...1........1......1....1...11....111..\\ $M_1 = (M_0 + D) \wedge \neg D$ & \verb...1........1......1....1.............. \end{tabular} \end{center} \caption{Bitstream addition} \caption{Parallel Scan Using Bitstream Addition and Mask} \label{fig:scan1} \end{figure} class bitstreams.  As a marker 1 bit is combined using binary addition to a span of 1s, each 1 in the span becomes 0, generating a carry to add to the next position to the left. For each span, the process terminates at the left end a carry to add to the next position to the left. For each such span, the process terminates at the left end of the span, generating a 1 bit in the immediately following position.   In this way, binary addition produces the marker bitstream $M_1$, with each of the three markers moved independently through their respective spans of digits to the position at the end. However, the simple addition technique shown in Figure \ref{fig:scan1} does not account for digits in the source stream that do not play a role in a particular scanning operation. Figure \ref{fig:scan2} shows an example and how this may be resolved.   The source data stream is again shown in row 1, and the marker bitstream defining the initial marker positions for the the parallel parsing tasks shown in row 2. Row 3 again contains the character class bitstream for digits $D$. Row 4 shows the result of bitstream addition, in which marker bits are advanced, but additional bits not involved in the scan operation are included in the result. However, these are easily removed in row 5, by masking following position.   These generated 1 bits represent the moved marker bits.   However, the result of the addition also produces some additional bits that are not involved in the scan operation. However, these are easily removed as shown in the fifth row, by applying bitwise logic to mask off any bits from the digit bitstream; these can never be marker positions resulting from a scan. (conflict-free) set of initial markers specified in $M_0$. \begin{figure}[tbh] \begin{center} \begin{tabular}{l@{}lr}\\ \multicolumn{2}{l}{source data $\vartriangleleft$} & \verb--134--31--59127---3--3474--\\ $M_0$ &                                                 & \verb....1.........1..........1..\\ $D$   & $= \verb[0..9]$ & \verb..111..11..11111...1..1111..\\ $M_1$ & $= M_0 + D$       & \verb.1.....11.1....1...1.1......\\ $M_2$ & $= (M_0 + D) \wedge \neg D$ & \verb.1........1..........1...... \end{tabular} \end{center} \caption{Parallel Scan Using Addition and Mask} \label{fig:scan2} \end{figure} % The addition and masking technique allows matching of including both document-oriented and data-oriented XML files. The jawiki.xml and dewiki.xml XML files are document-oriented XML instances of Wikimedia books, written in Japanese and German, respectively. The remaining files are data-oriented.  The roads.gml file is an instance of Geography Markup Language (GML), a modeling language for geographic information systems as well as an open interchange format for geographic transactions on the Internet \cite{GML04}.  The po.xml file is an example of purchase order data, while the soap.xml file contains a large SOAP message. a modeling language for geographic information systems as well as an open interchange format for geographic transactions on the Internet.  The po.xml file is an example of purchase order data, while the soap.xml file contains a large SOAP message. Markup density is defined as the ratio of the total markup contained within an XML file to the total XML document size. This metric is reported for each document.
• ## docs/EuroPar2011/xmlperf.bib

 r879 month=aug} @inproceedings{Green2009, title={Modeling Tryptic Digestion on the {Cell BE} Processor}, author = {Green, J.R. and  Mahmoud, H. and  Dumontier, M.}, booktitle = {Proceedings of the Canadian Conference on Electrical and Computer Engineering (CCECE '09)}, year = {2009}, location={St. John's, Newfoundland}, month=may}
Note: See TracChangeset for help on using the changeset viewer.