自动机处理中的确定性与非确定性有限自动机
Deterministic vs. Non Deterministic Finite Automata in Automata Processing
摘要:
线性时间模式匹配引擎使用有限自动机(FA)作为其计算模型已经看到了有希望的结果。在不同的FA变体中,确定性(DFA)和非确定性(NFA)是基于FA的模式匹配引擎最常用的计算模型。此外,NFA是空间架构上的模式匹配引擎中流行的模型。原因是:i)DFA大小,如在#状态中,与等效NFA相比可以是指数级的,ii)DFA不能利用空间架构上可用的大规模并行性。本文进行了实证研究的#状态的最小化DFA和优化的NFA在不同的现实世界的基准集,并表明,如果不同的DFA生成不同的模式,#状态的最小化DFA通常等于其等效的优化NFA。然而,NFA在维持一些基准的低#状态方面更稳健。因此,对于空间架构,NFA与DFA的选择不如为每个模式生成不同的DFA并支持这些不同的DFA的并行处理的需要重要。最后,本文提出了一个冯诺依曼的架构为基础的(CPU)与空间架构为基础的(FPGA)自动机处理引擎的吞吐量研究。研究表明,基于CPU的自动机处理引擎和基于FPGA的自动机处理引擎都不是明显的赢家。如果每个工作负载匹配的模式数增加,则基于CPU的自动机处理引擎的吞吐量会降低。另一方面,基于FPGA的自动机处理引擎缺乏内存溢出选项;因此,如果它不适合FPGA的逻辑结构,它就无法容纳整个自动机。在最好的情况下,CPU的加速比是FPGA的4.5倍,而在一些基准测试中,FPGA的加速比是CPU的32,530倍。
英文摘要:
Linear-time pattern matching engines have seen promising results using Finite Automata (FA) as their computation model. Among different FA variants, deterministic (DFA) and non-deterministic (NFA) are the most commonly used computation models for FA-based pattern matching engines. Moreover, NFA is the prevalent model in pattern matching engines on spatial architectures. The reasons are: i) DFA size, as in #states, can be exponential compared to equivalent NFA, ii) DFA cannot exploit the massive parallelism available on spatial architectures. This paper performs an empirical study on the #state of minimized DFA and optimized NFA across a diverse set of real-world benchmarks and shows that if distinct DFAs are generated for distinct patterns, #states of minimized DFA are typically equal to their equivalent optimized NFA. However, NFA is more robust in maintaining the low #states for some benchmarks. Thus, the choice of NFA vs. DFA for spatial architecture is less important than the need to generate distinct DFAs for each pattern and support these distinct DFAs' parallel processing. Finally, this paper presents a throughput study for von Neumann's architecture-based (CPU) vs. spatial architecture-based (FPGA) automata processing engines. The study shows that, based on the workload, neither CPU-based automata processing engine nor FPGA-based automata processing engine is the clear winner. If #patterns matched per workload increases, the CPU-based automata processing engine's throughput decreases. On the other hand, the FPGA-based automata processing engine lacks the memory spilling option; hence, it fails to accommodate an entire automata if it does not fit into FPGA's logic fabric. In the best-case scenario, the CPU has a 4.5x speedup over the FPGA, while for some benchmarks, the FPGA has a 32,530x speedup over the CPU.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。