arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2412.14975cs.DC
收藏

最小化正则文本并行识别器中的推测开销

Minimizing speculation overhead in a parallel recognizer for regular texts

Angelo Borsotti, Luca Breveglieri, Stefano Crespi Reghizzi, Angelo Morzenti

AI总结:

提出基于 RI-DFA 的正则文本数据并行识别算法,在保留确定性转移速度的同时减少推测启动状态数,理论正确且多核性能优于或持平现有 DFA/NFA 方案。

摘要:

用于语言识别的推测式数据并行算法已针对各类有限状态自动机(FA)——确定性(DFA)和非确定性(NFA)——进行了广泛实验,这些自动机通常由正则表达式(RE)导出。此类算法将输入字符串切分为若干块,借助相同的 FA 独立并行识别每个块,最后合并各块结果并检查整体一致性。在块识别中,必须推测性地让 FA 从任意状态启动,由此产生的开销会降低相对于串行算法的加速比。现有基于 DFA 的数据并行识别器受困于启动状态数量过多,而基于 NFA 的识别器则受困于非确定性转移的数量。我们的数据并行算法基于一种称为缩减接口 DFA(RI-DFA)的新型 FA,它能最小化推测开销,同时不会带来非确定性转移的代价,也不会造成 DFA 机器规模不切实际地膨胀。该算法被证明是正确且在理论上高效的,因为它将 NFA 的状态缩减与确定性转移的速度相结合,从而改进了现有基于 DFA 和基于 NFA 的实现。RI-DFA 方法的实际适用性,通过在一个包含复杂 FA 的大型公开基准上对启动状态数量进行定量比较而得到确认。在多核计算架构上,RI-DFA 识别器在所有基准上都远快于基于 NFA 的识别器;同时,它在某些基准上与基于 DFA 的识别器表现相当,而在另一些基准上则表现得好得多。与 DFA 相比,构造 RI-DFA 所需的额外时间成本适中,并与实际使用相容。

英文摘要:

Speculative data-parallel algorithms for language recognition have been widely experimented for various types of finite-state automata (FA), deterministic (DFA) and nondeterministic (NFA), often derived from regular expressions (RE). Such an algorithm cuts the input string into chunks, independently recognizes each chunk in parallel by means of identical FAs, and at last joins the chunk results and checks overall consistency. In chunk recognition, it is necessary to speculatively start the FAs in any state, thus causing an overhead that reduces the speedup compared to a serial algorithm. Existing data-parallel DFA-based recognizers suffer from the excessive number of starting states, and the NFA-based ones suffer from the number of nondeterministic transitions. Our data-parallel algorithm is based on the new FA type called reduced interface DFA (RI-DFA), which minimizes the speculation overhead without incurring in the penalty of nondeterministic transitions or of impractically enlarged DFA machines. The algorithm is proved to be correct and theoretically efficient, because it combines the state-reduction of an NFA with the speed of deterministic transitions, thus improving on both DFA-based and NFA-based existing implementations. The practical applicability of the RI-DFA approach is confirmed by a quantitative comparison of the number of starting states for a large public benchmark of complex FAs. On multi-core computing architectures, the RI-DFA recognizer is much faster than the NFA-based one on all benchmarks, while it matches the DFA-based one on some benchmarks and performs much better on some others. The extra time cost needed to construct an RI-DFA compared to a DFA is moderate and is compatible with a practical use.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑