一句话:提出非阻塞自动机处理引擎 ngAP,通过预取、记忆化和计算私有化提升 GPU 自动机吞吐。
有限自动机是许多高吞吐应用的核心计算模式,但 GPU 在处理自动机时存在并行度不足、重复计算多以及线程-状态映射动态切换导致数据局部性差三大挑战。本文提出非阻塞自动机处理(ngAP),其核心是打破“一次一个符号”的串行执行,允许并行处理输入流中的不同符号;并进一步采用计算预取提高多符号并行机会,用记忆化表将重复计算替换为查表,私有化部分计算以保持线程与状态的映射并改善数据局部性。在 20 个应用上,该方法平均比当前最优 GPU 自动机处理引擎快 7.9 倍,最高快 901 倍。
Finite automata serve as compute kernels for various applications that require high throughput. However, despite the increasing compute power of GPUs, their potential in processing automata remains underutilized. In this work, we identify three major challenges that limit GPU throughput. 1) The available parallelism is insufficient, resulting in underutilized GPU threads. 2) Automata workloads involve significant redundant computations since a portion of states matches with repeated symbols. 3) The mapping between threads and states is switched dynamically, leading to poor data locality. Our key insight is that processing automata "one-symbol-at-a-time" serializes the execution, and thus needs to be revamped. To address these challenges, we propose Non-blocking Automata Processing, which allows parallel processing of different symbols in the input stream and also enables further optimizations: 1) We prefetch a portion of computations to increase the chances of processing multiple symbols simultaneously, thereby utilizing GPU threads better. 2) To reduce redundant computations, we store repeated computations in a memoization table, enabling us to substitute them with table lookups. 3) We privatize some computations to preserve the mapping between threads and states, thus improving data locality. Experimental results demonstrate that our approach outperforms the state-of-the-art GPU automata processing engine by an average of 7.9× and up to 901× across 20 applications.