Trie Compression for GPU Accelerated Multi-Pattern Matching
Paper · 2017 · Xavier Bellekens, Amar Seeam, Christos Tachtatzis et al.
Summary
Searching a text for many strings at once requires a way to keep all those strings available while the search runs. A trie shares the beginnings of strings so the matcher can follow a common path until the strings differ. On a graphics processing unit, or GPU, many threads can search from different positions in the text at the same time. They all need access to the trie, and the way it is stored affects both how much device memory it occupies and how quickly the threads can use it. Bellekens and colleagues study how to reduce that storage cost while keeping the search fast. GPU & parallel computing
The authors extend an earlier GPU matcher in the Aho–Corasick family. The earlier design shortened the trie, merged parts of its remaining branches, and used a bitmap and a child offset to represent each node. Its sparse matrix layout still reserved positions for empty entries. The paper adds compressed row storage, a format that records the occupied entries and their columns, together with a directory that locates the entries for each row. The authors keep the compressed trie data in the GPU’s texture memory and place the row directory in shared memory. The distinction matters because accessing a row in the compressed format requires the directory as well as the entries themselves.
The evaluation uses the King James Bible, with patterns chosen randomly from the text. According to the results section, the method uses 83% less space than the original trie and 56% less than the earlier trie compression method. The abstract gives a separate figure of 85% against the original highly efficient parallel failure-less matcher, and the paper leaves the relationship between these figures unclear. In the throughput comparison, the compressed trie in global memory reaches 12 Gbps. With the trie in texture memory and the row directory in shared memory, the paper reports 22 Gbps for 1000 patterns with an alphabet of 256 symbols.
The two comparisons answer different questions. The space figures concern how much the representation saves against earlier trie layouts. The throughput figures show how much the placement of the compressed data matters on the hardware tested. The size of the saving depends on the patterns and alphabet, and the speed comparison measures texture and shared memory as a combined arrangement.
Deep dive: Trie Compression for GPU Accelerated Multi-Pattern Matching
Bellekens and colleagues compress the trie used for GPU multi-pattern matching and measure how GPU memory placement affects throughput. · about 31 minutes to read
The problem and its context
Searching for many strings in one text
The search problem starts with a text and a collection of patterns. The text is the material to inspect. Each pattern is a string whose occurrences the search is meant to find. When the same beginning occurs in several patterns, the search can reuse the work of matching that beginning. Following the shared part narrows the possible matches until the next character distinguishes their continuations. This is the work a trie organizes.
A trie is a tree in which the route from the root records a string prefix. The root represents the starting point before any character has been read. A transition out of it consumes the first character. Each subsequent transition extends the prefix by another character. Patterns with the same beginning pass through the same nodes while that beginning is being read. Once the patterns require different characters, their paths diverge. The structure saves repetition in the dictionary of patterns and gives the search a way to reject a continuation as soon as the required branch is missing.
The authors place the problem in applications that need to inspect growing volumes of data, sometimes in real time. They mention uses in biology, security, and engineering, with examples ranging from sequence search to antivirus scanning. These settings motivate the same underlying question. If a system must inspect a stream for a large dictionary of strings, storing and consulting that dictionary become part of the cost of keeping up with the input.
The amount of text and the size of the dictionary pose different demands. Increasing the amount of text gives the matcher more input to inspect. Increasing the dictionary can add states and transitions to the structure consulted during that inspection. Sharing prefixes helps with the latter, but the amount of sharing depends on the strings. The representation of a node also matters. Even a trie with substantial sharing can spend much of its space reserving room for characters that seldom continue a given prefix.
That is the problem the paper takes up. The authors start from an existing parallel search procedure and examine the structure it reads. Their concern is whether it is possible to represent that structure more compactly while keeping it suitable for frequent GPU lookups. The unit being compressed is the dictionary’s search structure. The text remains the input against which the dictionary is matched.
What Aho–Corasick shares across a search
The paper’s starting point is Aho–Corasick, which prepares a pattern dictionary so a search can find multiple strings in a single pass through a text. The trie captures the prefixes the strings share. Aho–Corasick adds failure links, which preserve useful progress when the next character cannot extend the current path. A shorter suffix of the characters already consumed may itself be the beginning of another pattern. The failure link gives the search an appropriate state from which to consider that possibility.
Failure links are prepared when the dictionary is constructed. During a sequential search, this lets the state reached at one character carry forward to the next. The algorithm can make progress on multiple patterns by maintaining that state as it moves through the text. The interest of failure links here is the connection they establish between what the search has already read and what it can do next.
A straightforward way to parallelize a text search is to give different workers different chunks. The paper points out the boundary problem in that arrangement. An occurrence can start near the end of one chunk and end in the next. A worker that can see only its own chunk lacks enough input to finish that occurrence. The remedy the authors describe extends a worker’s input into the following chunk by the longest pattern length minus one. Earlier investigations of GPU matching, including work by Bellekens and colleagues and by Tumeo and colleagues, are cited for this issue.
The overlap accounts for how far a match beginning inside one chunk might extend. Its size is governed by the longest pattern because a chunk assignment has to allow the longest possible continuation. The common case can require less inspection, yet the split still has to accommodate the boundary case. The paper presents failure-less matching as a different way to assign work so the search starts directly at the candidate positions.
Starting a thread at each position
The GPU approach the authors build on comes from Lin and colleagues. It assigns a thread to each starting character in the text. That thread begins at the root of the trie and walks forward from its assigned position for as long as the characters continue along a path. When the next character has no corresponding transition, the search from that starting point ends. A different thread already owns the search from the next starting position.
The assignment explains the name failure-less Aho–Corasick. A mismatch ends the thread’s search because recovering a later starting point is outside that thread’s job. If the mismatch leaves a suffix that could begin another pattern, the thread for that later position covers it. Threads may therefore inspect overlapping positions in the text, each in pursuit of the match that begins at its own assigned character.
This organization offers the early termination that the paper emphasizes. A thread whose first character has no root transition can finish immediately. A thread that follows a longer prefix stays active until it either finishes its walk or encounters a mismatch. The authors also identify coalesced access in the initial read. At the start, threads assigned to consecutive positions ask for neighboring input characters, which suits the GPU’s ability to group nearby memory requests. Once the threads follow different prefixes, the transition data they need depends on the paths they encounter.
The paper describes GPU execution in terms of streaming multiprocessors that run threads in a single-instruction, multiple-thread fashion. The threads carry out the same kind of work, with their own starting positions and progress through the trie. This gives the matcher abundant parallel work. It also gives many threads a reason to access the dictionary, some only at the root and others deeper in the structure. The cost of those lookups is part of the design problem even when individual threads can terminate early.
Earlier work on shrinking the dictionary
The paper’s immediate predecessor is the highly efficient parallel failure-less Aho–Corasick implementation, abbreviated HEPFAC. The prior approach already changes both the shape of the trie and its layout in memory. It truncates the trie at a chosen level, shares similar endings, and consolidates final nodes. It also replaces a structure connected by pointers with an array-based representation. The authors describe the resulting layout as a sparse matrix.
The broader lineage includes work by Vasiliadis and Ioannidis on a parallel antivirus engine. The paper identifies that work as an earlier use of trie truncation and says Bellekens studied the technique further. The depth cutoff is thus part of the work inherited by the new proposal. The same is true of sharing endings and representing outgoing transitions compactly at each node.
These precedents expose a particular kind of remaining waste. Making the trie smaller can reduce the number of rows needed to store it. A bitmap can describe a set of possible transitions without giving each transition its own pointer. Yet a rectangular array can still reserve a cell for every column in every row, even when many of the cells are empty. The authors bring compressed row storage to bear on this remaining space, drawing on earlier work on efficient bitmap storage and sparse arrays.
The choice carries a performance question. In a rectangular array, the position of a cell follows from its row and column. In a compressed representation, access first depends on finding the entries stored for that row. The paper therefore treats the representation and the placement of its components as related decisions. How much a format saves depends on which entries it can omit. How much time a lookup takes also depends on where the GPU must go to find the remaining entries and the directory that locates them.
The method, step by step
From the dictionary to a compact trie
The construction begins with the input patterns and ends with a GPU representation that the failure-less matcher can consult. Its earlier stages change the number of nodes the search structure needs. The new compression stage changes how the data for those nodes is packed. Keeping those jobs separate makes it possible to understand what the paper contributes even though the final implementation uses both.
Building the compressed trie for GPU matching
The steps in order.
The first stage builds the trie breadth first. This means constructing or arranging each level before moving to the next. A level corresponds to the number of characters consumed to reach the nodes in it. Near the root, paths can share a node whenever the patterns have the same prefix. A branch separates the paths when the next characters differ. Breadth-first construction gives the authors an ordering tied to the depth of the search.
The prior compression pipeline then arranges the trie in a row-major array. A linked representation uses pointers to connect separately represented nodes. The array layout replaces those links with positions in a common structure. This makes the layout suitable for moving between the host, which prepares or supplies the data, and the GPU device, which performs the parallel search. The paper’s memory-layout illustration starts with the linked representation and uses the array to show this change in how transitions are located.
The authors next cut the trie at a chosen depth. The cutoff limits the number of levels retained in the represented trie. This reduces the space needed for deeper states and gives the subsequent merging stages an end region on which to operate. For the experimental setting discussed in the results, the authors describe truncation to eight levels. They present the appropriate depth as dependent on the alphabet and refer back to their earlier work for the technique.
With that depth selected, the construction merges similar suffixes near the bottom of the retained structure. Prefix sharing arises naturally when two patterns take the same initial path. Suffix sharing concerns the other end of a path. Two routes that started differently can reach parts of the structure with similar remaining continuations. Consolidating such parts can remove repeated storage for the tail of the search. The paper describes merging on the last three levels as part of its earlier pipeline and allows the range to vary with the alphabet.
The pipeline also consolidates the final nodes. A common terminal node can stand in for separate ends in the illustrated trie. Sharing the storage for an end node and distinguishing observations made along different paths are different parts of a matcher’s job. The construction diagram shows the consolidation of ends. The paper’s discussion focuses on the representation and leaves the details of how pattern identities are reported to the surrounding matcher.
Truncation and merging change the set of nodes before sparse packing takes place. With fewer nodes, fewer rows are needed. In particular, the earlier trie compression can leave the storage cost of an individual node unchanged while making the whole structure smaller. The new step can then save space inside the representation of those remaining rows.
What the matcher needs from a node
A node needs to answer whether the current prefix can continue with the next character. If it can, the matcher needs to find the child for that character. The authors pair a bitmap with an offset to represent those two pieces of information.
A bitmap assigns a position to each symbol in the alphabet. The bit at that position says whether the corresponding transition exists. For the ASCII configuration described in the paper, the bitmap has 256 bits. A node can therefore represent several different outgoing characters within the same fixed-size field. The bitmap is modular, so the authors allow the set of represented symbols to be changed for other types of pattern collection.
The offset gives the location of the current node’s first child. The bitmap describes the available choices and the offset anchors their locations in the indexed layout. The authors refer to their earlier HEPFAC work for the method used to locate the remaining children. The paper’s account of the new compression begins with these fields already arranged for that earlier form of access.
The original node size quoted in the results is 36 bytes. The authors account for that with the 256-bit bitmap and four bytes for the offset. This size describes the storage for one node in the regular layout. The earlier shape-reduction steps still use 36 bytes per retained node in the comparison. The amount saved at those stages therefore depends on how many nodes the construction removes or shares.
The distinction between an unset bit and an omitted matrix entry is important. An unset bit says a particular character does not continue a prefix. The sparse format works on the cells into which the bitmap and offset data have already been arranged. It can omit a cell when that entire stored entry is zero. A bitmap can represent many absent transitions while still occupying a matrix cell if that cell contains some non-zero transition information.
The paper illustrates the matrix layout with a trie for 10 patterns. It uses different colors to distinguish occupied cells from empty ones and reserves the last column for the node offsets. Seen this way, the input to compressed row storage is a grid whose empty positions are visible. This example illustrates the structure being compressed. The throughput experiment uses a different pattern count.
Turning the rectangular layout into rows of occupied entries
The rectangular representation gives each row the same set of possible column positions. Its advantage is that a column has a stable location within a row. Its cost is that unused positions still belong to the allocated array. The authors’ additional step replaces these fixed-width rows with a compact representation that stores a row’s non-zero entries together.
Compressed row storage separates the information in the matrix into values, column indices, and row pointers. The value vector, called val, contains the non-zero entries. The column-index vector, called col-ind, records the original column position of each stored entry. The column information matters because closing the gaps between values removes their original horizontal positions. Two entries adjacent in storage may have occupied columns far apart in the matrix.
The third vector, row ptr, divides the packed arrays into rows. A row pointer identifies where the entries for a row begin. The next pointer supplies the boundary beyond those entries. The same range selects the values and their corresponding columns. A row with few occupied cells takes a short range. A row with no occupied cells can be represented by an empty range, which is the general case in which consecutive row boundaries coincide.
The paired value and index vectors make the original positions interpretable. For a row in the compressed trie, the directory identifies the relevant portion of the vectors. Within that portion the column indices say which original fields are present, and the values carry their contents. A column absent from the range corresponds to a zero in the rectangular representation. This is the connection between compression and matching. Zero entries can disappear from storage while their meaning remains available from the positions that the format does store.
The paper presents this element count for the compressed representation.
2nnz + n + 1
Here nnz is the number of non-zero entries of the original matrix and n is the number of elements along a side in the paper’s notation. The coefficient 2 accounts for storing a value and a column index for each non-zero entry. The term n + 1 counts the row boundaries, with a final boundary marking the end of the last row. The plus signs add these parts into the total number of stored elements.
The paper introduces the expression when discussing savings. The expression itself gives the compressed storage count in elements. The saving depends on the size of the corresponding rectangular representation. This also makes the distinction between element counts and byte counts important. The expression accounts for what the vectors contain. A byte count additionally depends on the space taken by the values, column indices, and row pointers.
There is no single compression percentage implied by the format. Every non-zero matrix entry brings a corresponding column index, and the row directory has a cost tied to the number of rows. The savings come from omitting enough zero cells to pay for that additional information. The more occupied the rows are, the more entries and column indices remain. The authors explicitly connect the resulting compression to the alphabet and the kinds of patterns being searched.
The paper illustrates the accounting with a small layout example that goes from 36 elements to 24 elements. In that comparison, the smaller count includes the entries used to describe the packed layout. The example explains how recording positions can still take less space than leaving gaps in the array. Its counts concern elements in the illustrated layouts. The separately reported 36 bytes concerns a node in the original trie and measures a different object.
Dividing the packed data between GPU memories
The layout diagram in the paper follows the trie through several physical representations. A linked version establishes which data the structure originally holds. A row-major representation replaces pointers with array locations. A two-dimensional arrangement exposes a regular matrix layout suitable for texture memory. Compressed row storage then packs that sparse matrix and creates a separate directory for its rows.
The final GPU arrangement places the compressed trie in texture memory and the row directory in shared memory. The paper emphasizes texture memory’s cached access. In this use, texture memory serves the matcher’s table lookups. The name reflects a type of GPU memory access, while the data being read is the compressed pattern dictionary.
Shared memory is an on-chip area used by GPU threads. The authors put the row directory there to reduce the access cost of finding the relevant segment of the compressed trie. That choice follows from the structure of a lookup. The directory is needed to locate the values and indices for the current state. If the directory takes a long time to fetch, finding the row delays the accesses that follow. Placing it on chip addresses the first part of that path, and using texture memory addresses access to the packed trie.
The design therefore has two kinds of metadata with different roles. The offset encoded in a trie node locates a child or anchors the group of children in the trie. A row pointer in the sparse format locates the stored entries that describe a node. A thread can need both to continue a match. The row pointer leads to the representation of the current node, while the node’s offset helps the search reach the next state.
The distinction also explains why the representation and memory placement can be evaluated separately. The sparse format determines which information is stored and how it is indexed. The same compressed representation can be placed in global memory, providing a comparison with the arrangement that uses texture and shared memory. The format incurs its lookup dependencies in either case. The memory arrangement changes the conditions under which the thread resolves them.
Walking the trie during a search
During matching, a thread uses its assigned text position as the beginning of a possible occurrence. The first lookup concerns the root and the character at that position. A successful lookup advances along a path in the trie. The following character then determines whether the path can continue. The walk ends when there is no suitable extension. This is the same division of search work the authors inherit from failure-less Aho–Corasick.
In the compressed version, the thread needs access to the stored row for the state it has reached. In terms of the representation, the search first has to locate the row’s packed span. The span tells it where the stored columns and values are, which makes the node’s transition information and offset available. When a suitable continuation exists, the search moves to the appropriate child. A missing continuation ends the search at the current starting point.
That sequence describes what the representation must support. The paper gives the format and the placement of its parts, and refers to the earlier work for the child lookup. It gives less detail about the instructions used to interpret a packed row inside the GPU search. In particular, the format specifies how to locate the span for the row, while the implementation still has to find the fields of interest within that span.
The trie is constructed from the patterns the search will use. The preparation procedure establishes the dictionary before the matcher has a stream of text positions to query. For the experiments, the pattern source is the King James Bible, with random selection carried out using Mersenne Twister. The structure produced by the construction pipeline reflects those chosen strings and the configured alphabet. The paper measures how that prepared structure performs in a search.
The notation behind the setup
The paper uses P for a search pattern and T for the text being searched. A trie represents the available prefixes of the patterns. A GPU thread begins at a position in T and tests which of those prefixes occur there. In the earlier chunked approach discussed by the authors, the necessary overlap is written here using L to name the longest pattern length.
L − 1
L is the length of the longest pattern, measured in characters, and 1 is the character already included in the chunk at the last possible starting position. The subtraction gives the number of additional characters needed beyond that position to cover a complete longest pattern. This quantity describes the chunk-boundary issue that motivates the failure-less assignment.
The authors specify the alphabet in the throughput experiment as follows.
Σ = 256
Σ denotes the alphabet in the paper’s compact notation. The equality gives its size, and 256 is the number of symbol positions supported in the experiment. The bitmap layout assigns a bit position to each of those symbols. The number of distinct symbols that happen to appear in the input or in a sampled pattern collection can be smaller than the configured alphabet size.
Experiments and results
The corpus, patterns, and machine
The evaluation uses the King James Bible. The authors choose patterns at random from within the text, using Mersenne Twister as the random generator. The corpus therefore supplies the search material and the sampled strings from which the dictionary is built. The experiment compares ways of representing and searching such a dictionary. Its main outcomes are the memory used by the trie and the amount of text searched per unit of time.
Random selection establishes how the patterns enter the experiment at a high level. For interpreting compression, the characters that happen to be selected matter because shared beginnings influence the size of the trie, and shared endings influence how much the authors can consolidate. The selection also affects the occupied cells in the bitmap layout. For interpreting throughput, it matters how long each thread can follow a prefix before encountering a mismatch. Both metrics are consequently attached to a search workload, even when the focus of the comparison is the representation.
The reported measurements come from an Nvidia 1080 GPU. The paper describes 2560 CUDA cores distributed across 20 streaming multiprocessors. The hardware description specifies a 1733 MHz memory clock, 8 GB of GDDR5X device memory, 48 KB of L1 cache, and 96 KB of shared memory. These details identify the device on which the layouts were compared. The capacities and access paths available on that device are part of the context for the placement experiment.
The host has 2 Intel Xeon processors and 32GB of RAM. The software environment uses Ubuntu Server 14.04, CUDA 8.0, and C99. The comparison is conducted on a single GPU node. Though the host is needed to describe the setup, the central throughput comparison concerns the placement of the trie on the GPU. The paper gives no CPU throughput baseline for the numbers reported in that comparison.
The authors use the corpus in both the compression evaluation and their discussion of matching speed. The illustrated trie with 10 patterns explains the matrix layout and its empty entries. The throughput comparison describes searching with 1000 patterns. A reader can understand the shape of the data from the small illustration, then assess the speed numbers under the explicitly stated larger workload.
How the representation changes the space cost
The memory comparison starts with the original trie and the earlier trie compression approach. This gives the new format two points of comparison. The original layout provides a reference for the whole construction pipeline. The earlier compressed trie provides a reference closer to the representation that is fed into the new sparse packing stage.
The authors report that the original trie uses 36 bytes per node. That figure is also the per-node cost quoted for the earlier compression stage, where the savings arise from the smaller trie. The stated cutoff for the example in the results is eight levels. Similar suffixes and terminal nodes are consolidated after truncation. The earlier method thus changes which nodes have to be stored, and the bitmap and offset account for the stated cost of each remaining node.
The new stage works on the sparse matrix built from that reduced structure. This removes the storage for zero cells and adds the column indices and row directory needed to recover the positions of the values. The paper’s space comparison treats the combined format as the result. The most direct comparison for the added stage is therefore against an earlier compression method that already changes the trie’s shape.
In the results section, the authors report an 83% space reduction compared with the original trie. They also report a 56% space reduction compared with the earlier trie compression algorithm. The conclusion repeats 83% and 56%, naming HEPFAC as the comparator for 56%. These are reductions in storage requirements, with the named reference layout supplying the denominator in each case.
The abstract uses a different description. It gives 85% less space against the original highly efficient parallel failure-less Aho–Corasick approach. That percentage and baseline wording differ from the detailed result. The paper leaves the figures unreconciled. The results section is the place where the authors distinguish the original trie from the prior compression method and give separate comparisons for them.
The memory illustration and the headline percentages describe different scales of evidence. The move from 36 to 24 elements explains the effect of packing an example matrix. The per-node figure gives the cost of the original fields. The percentage reductions compare complete trie representations. None of these measures supplies a count of how much each individual merging operation contributed, and the element-count example does not specify the total device allocation in the measured workload.
What changes when the packed trie moves
The speed experiment compares two placements of the compressed row storage trie. The baseline stores the compressed trie in global memory. The other arrangement stores the trie data in texture memory and the row pointers in shared memory. The metric is throughput, in gigabits of searched input per second. A higher number means the matcher processes the text faster.
King James Bible search throughput by memory placement of the CRS trie
Texture memory for the trie and shared memory for the row directory give higher throughput.
The numbers
| System or setting | Gbps |
|---|---|
| CRS trie in global memory | 12 |
| CRS trie in texture memory with shared row pointers (this paper) | 22 |
The global-memory configuration reaches 12 Gbps. The authors explain the result in terms of memory access cost and give up to 600 clock cycles for an access to global memory in their discussion. They attribute the faster configuration to the use of cached texture access and on-chip storage for the row directory. The comparison records throughput for the whole search, so the access-cost explanation is the authors’ account of what drives that measurement.
The texture and shared memory configuration is reported at 22 Gbps while matching 1000 patterns under the alphabet setting of 256 symbols. The abstract and conclusion describe throughput as over 22 Gbps. The results discussion gives 22 Gbps, which is the value used in the chart. The paper does not supply more decimal places for a more precise comparison.
The relevant baseline for this figure is the same kind of compressed trie in global memory. This matters because a reader might otherwise take the throughput change to be the effect of adding compressed row storage to HEPFAC. The experiment instead shows how much the measured speed of the compressed representation varies with its memory placement. The HEPFAC baseline is used in the discussion of storage requirements.
The comparison also helps explain the authors’ design choice. For the compact structure to be useful in a parallel matcher, its encoded rows have to be reachable during a large number of thread-local walks. The global-memory result gives a sense of how that structure performs under one access arrangement. The texture and shared memory result shows that the compressed representation can support higher throughput under another. Together, the space and speed measurements show a viable combination on the tested workload.
Reading the throughput figure as a workload result
Throughput measures how much input the matcher processes over time. It differs from a count of the matches found, because the search does work even when no pattern occurs. A thread can inspect an initial character and terminate immediately, or it can read farther while a prefix remains active. Both behaviors contribute to the measured rate. The distribution of patterns and text determines how often each behavior occurs.
The result depends on the pattern set as well as the corpus. A search in which many positions share long prefixes with the dictionary can give the threads more work per starting character. A dictionary that rules out many starting positions quickly permits more early exits. Both situations can use the same alphabet and the same number of patterns. Pattern count identifies the scale of the given experiment, while the actual strings help determine its workload.
The reported rate also reflects the behavior of the trie as a memory object. Threads that visit nearby or repeatedly used data can make different demands on the memory system from threads whose paths spread out across many rows. The paper motivates texture storage through caching. Its results show a throughput benefit for the tested arrangement, with the corpus and the sampled dictionary forming part of the context in which that benefit is measured.
The experiment’s most specific conclusion is therefore about the tested pair of placements. It establishes the measured ordering and throughput levels for the configurations that the authors compare. The space results provide a complementary reason to use the compressed format. These results answer whether the final compressed structure can be both smaller than the earlier trie and fast on the tested GPU. A direct speed comparison with the earlier layout would address the distinct question of how the added compression changes throughput at matched placement.
What the ablations show
The paper gives no full component-by-component ablation, though it compares storage across trie representations and throughput across memory placements of the compressed trie.
How much can be assigned to each change
The storage comparison shows the effect of the construction at successive levels of representation. The original trie is the reference for the savings of the overall pipeline. Truncation and merging reduce what the earlier compressed trie has to represent. The compressed row format then reduces the space occupied by the matrix layout for a trie that already incorporates that earlier work.
This comparison supports a narrower interpretation of the 56% figure than of the 83% figure. The 56% reduction uses the earlier compression approach as the reference, so it gives a comparison against a trie that has already benefited from shaping and merging. The 83% reduction uses the original trie and includes the savings the pipeline gains before row packing. The two percentages have different baselines and should be read individually.
The paper accounts for why the stages can save space through different mechanisms. A smaller number of retained nodes reduces storage even at 36 bytes per node. Sparse packing matters because the array still reserves cells for fields with no stored value. The node-size accounting and the matrix example explain those mechanisms. They leave the percentage contribution of each individual cutoff or merge choice unspecified.
The small matrix example provides a check on the role of storage overhead. After packing, the format has to retain the columns and row boundaries as well as the values. The reduction from 36 to 24 elements shows a case in which those extra entries still occupy less space than the full grid. The example shows what can happen with sparse rows. The workload-level percentages supply separate evidence that the format also reduces storage in the authors’ comparison with the earlier trie.
What the placement comparison isolates
The speed comparison keeps compressed row storage in both configurations. That makes it a useful test of how the compressed data are placed. The faster result comes from switching the trie to texture memory and keeping the row boundaries in shared memory. Both changes affect accesses the matcher makes during a trie walk.
The test changes those placements together. It therefore measures the combined benefit available from that arrangement. The paper gives no separate timing for texture storage with the row directory still in global memory, or for adding shared storage for the directory while leaving the trie otherwise in global memory. The relative contribution of each move is consequently unresolved.
The design gives a reason for both choices that is independent of the exact split in measured speed. A compressed row has to be located through its boundaries before its contents can be read as a row. The authors use shared memory for this often needed directory. The packed contents then come from texture memory, where the authors expect cached access to help. The results are consistent with that account. They do not time the two parts of the lookup independently.
The reported comparison also leaves open how much speed comes from the sparse representation itself. A comparison holding placement fixed while changing between the earlier layout and compressed row storage would measure that effect. Here the speed chart holds the format fixed while changing placement, and the space comparison changes the format to measure storage. Reading the two experiments together explains why the authors chose the final arrangement, while preserving what each measurement can support.
Where the examples help
The trie diagram shows what it means to shorten the structure and let several paths share an ending. The matrix diagram shows how the resulting node data can still have conspicuous gaps. The layout example then shows how row boundaries and column indices can encode the data that remain when those gaps are removed. Each example addresses a different point in the construction.
These examples make the experiment easier to interpret. A trie can be small in node count and still be a candidate for sparse packing. A sparse layout can save space and still have costly lookups when stored in a slower access arrangement. The paper provides evidence for both considerations through its storage and throughput comparisons. It leaves further isolation of the individual layout changes outside the measured study.
Limitations
Limits identified by the authors
The authors state that the amount of compression depends on the patterns. They also say that the alphabet affects the outcome. The bitmap has a configurable set of symbol positions, and the pattern collection determines which transitions are present in the nodes. The result of packing a particular matrix therefore depends on how the alphabet and the strings together determine its occupied entries.
They also allow the suffix-merging configuration to vary with the alphabet. The construction they describe uses the last three levels of the trie for this step, with room to adapt the choice. The experimental discussion specifies a trie truncated to eight levels for its setting. The paper presents this as a design choice tied to the alphabet rather than establishing a uniform depth rule for every dictionary.
The authors identify the evaluation as work on a single GPU node. They suggest that the method could be adapted to cloud computing or field-programmable gate arrays. Those suggestions describe possible extensions of the approach. The measured performance concerns the Nvidia 1080 setup and supplies no speed or memory comparison for either of the proposed environments.
Limits of the workload and measurement
The evaluation is grounded in one named corpus and in patterns sampled from it. This establishes a concrete test of the representation, but leaves the breadth of its performance open. The paper mentions applications such as biological sequence search and intrusion detection as motivation. Its results do not measure the pattern distributions or input data of those applications. The authors’ own observation that compression is pattern dependent is a reason to keep that scope in view.
The account names the random generator and the source of the patterns. It leaves the finer details of the sample unspecified, including the pattern-length distribution and the random seed used to select the strings. Those details matter to interpreting both of the reported metrics. A pattern’s length can affect how deep its path would naturally extend, and the sampled beginnings and endings affect the amount of sharing. Reconstructing the workload exactly would require a more complete description of the selected dictionary.
The paper reports throughput values for the given configuration without an accompanying measure of variation across trials or sampled dictionaries. The figures thus describe the reported cases. A reader cannot tell from them how stable the rate would be under another draw of patterns from the same text, or how much of a spread successive runs might have on the same machine. Likewise, the paper supplies no systematic sweep of different alphabet sizes to show how the space and speed change together.
The measurement boundary for throughput is also left implicit. The paper describes moving between host and device layouts and reports the rate of matching. It does not give a separate timing breakdown for trie construction, the conversion to compressed row storage, transfers, and search. The throughput is most directly read as a measure of the reported matching test. The time needed to prepare a new pattern set, and the resulting cost of using the method for a short search, remain open.
The compressed representation has metadata whose size matters as the trie grows. The element-count expression describes the row directory and column indices. The evaluated design places the row directory in shared memory, which the hardware description gives a finite capacity. The paper offers no measured boundary for how large a directory can be supported by this placement or how throughput behaves when the directory grows beyond the setting used in the experiment.
Limits of the design account
The paper shows the structure of the bitmapped nodes and the position of the offset column. It describes the placement of the compressed arrays and refers back to prior work for parts of the lookup. This level of detail explains the design choices and the memory comparisons. A complete reimplementation would need further decisions about how to retrieve a desired field inside a packed row and how to map the available transition to a particular child.
Truncation is another point where the performance account gives more detail than the match-reporting account. The paper explains where the represented trie is cut and how its retained ending is compressed. It gives less detail about the handling of long patterns at that boundary and about reporting distinct patterns when storage for terminal states is shared. For a reader evaluating exact output behavior, those parts of the implementation would matter alongside the data layout.
The reported metrics are space and throughput. They establish that the compressed structure is smaller in the comparison and that its speed depends on its placement. There is no dedicated match-output comparison that documents agreement with the original matcher as an experimental result. The sparse row encoding has a clear way to represent the matrix’s non-zero values and their positions. The quality of the end-to-end match reporting involves additional parts of the algorithm beyond that representation.
Finally, the headline space claim needs to be read with its baseline attached. The results report 83% relative to the original trie and 56% relative to the earlier compression scheme. The 85% claim in the abstract identifies the original highly efficient failure-less implementation as its reference. The differing baseline descriptions and percentages make a single overall space figure ambiguous. The detailed results supply the more specific statement of how each of their comparisons was framed.
What came after
Documented follow-up evaluations are unavailable for this paper. The authors identify possible extensions to cloud computing and field-programmable gate arrays. Those directions would carry forward the problem studied here: how to store the packed trie and make its row directory accessible during parallel matching. The paper reports its evidence for that design on a single GPU node.
Cite
Cite as Xavier Bellekens, Amar Seeam, Christos Tachtatzis and Robert Atkinson. 2017. Trie Compression for GPU Accelerated Multi-Pattern Matching. arXiv 2017.
@misc{bellekens2017trie,
title = {{Trie Compression for GPU Accelerated Multi-Pattern Matching}},
author = {Xavier Bellekens, Amar Seeam, Christos Tachtatzis and Robert Atkinson},
year = {2017},
eprint = {1702.03657},
archivePrefix = {arXiv},
url = {https://arxiv.org/abs/1702.03657}
}This page in Markdown https://md.research.elamur.ai/free/en/papers/bellekens-2017-trie-compression-gpu-accelerated-multi/