paperbot · PL 论文追踪

全部论文 待读 收藏

P2 HybridSA: GPU Acceleration of Multi-pattern Regex Matching using Bit Parallelism

HybridSA:基于位并行的多模式正则表达式匹配 GPU 加速
OOPSLA 8(OOPSLA2)2024匹配度 1/10 · 论文聚焦于GPU加速多模式正则匹配与位并行NFA模拟,属于编译与体系结构方向,与用户的静态分析、LLM/Agent、浮点程序分析、贝叶斯程序分析等研究画像无直接关联。引用 9 inbox
Alexis Le Glaunec, Lingkun Kong, Konstantinos Mamouras
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:HybridSA 是异构 CPU-GPU 多模式正则匹配引擎,通过位并行 NFA 模拟与编译优化显著提升吞吐量。

多模式匹配广泛用于蛋白质搜索、网络流量检测等高吞吐场景。GPU 擅长大规模并行,但直接在其上模拟 DFA/NFA 会因不规则访存而效率低下。HybridSA 采用位并行技术高效模拟 NFA,将经典 shift-and 算法扩展至一大类正则表达式,把自动机模拟归约为少量位运算,从而减少访存并提高吞吐。作者还实现编译器,将正则转换为位掩码、执行优化并选择最佳 GPU 算法;对随机访存的模式则在 CPU 上并行执行。在真实基准上,HybridSA 相比最先进 CPU 引擎吞吐量高 4 至 60 倍,相比最先进 GPU 引擎高 4 至 233 倍。

问题
多模式正则匹配需要高吞吐,但 GPU 上直接模拟 DFA/NFA 会产生不规则内存访问,导致效率低下。
方法
HybridSA 用位并行在 GPU 上模拟 NFA,扩展 shift-and 算法并用编译器将正则转为位掩码、优化算法选择,随机访存模式交给 CPU 并行处理。
评估
在真实世界基准上,与最先进 CPU、GPU 及混合引擎比较,HybridSA 吞吐量比 CPU 引擎高 4 至 60 倍,比 GPU 引擎高 4 至 233 倍。
原文摘要(Abstract)

Multi-pattern matching is widely used in modern software for applications requiring high throughput such as protein search, network traffic inspection, virus or spam detection. Graphics Processor Units (GPUs) excel at executing massively parallel workloads. Regular expression (regex) matching is typically performed by simulating the execution of deterministic finite automata (DFAs) or nondeterministic finite automata (NFAs). The natural implementations of these automata simulation algorithms on GPUs are highly inefficient because they give rise to irregular memory access patterns. This paper presents HybridSA, a heterogeneous CPU-GPU parallel engine for multi-pattern matching. HybridSA uses bit parallelism to efficiently simulate NFAs on GPUs, thus reducing the number of memory accesses and increasing the throughput. Our bit-parallel algorithms extend the classical shift-and algorithm for string matching to a large class of regular expressions and reduce automata simulation to a small number of bitwise operations. We have developed a compiler to translate regular expressions into bit masks, perform optimizations, and choose the best algorithms to run on the GPU. The majority of the regular expressions are accelerated on the GPU, while the patterns that exhibit random memory accesses are executed on the CPU in parallel. We evaluate HybridSA against state-of-the-art CPU and GPU engines, as well as a hybrid combination of the two. HybridSA achieves between 4 and 60 times higher throughput than the state-of-the-art CPU engine and between 4 and 233 times better than the state-of-the-art GPU engine across a collection of real-world benchmarks.

链接与引用

DOI 原文 · PDF(开放获取) · DBLP

BibTeX
@article{GlaunecKM24,
  title = {HybridSA: GPU Acceleration of Multi-pattern Regex Matching using Bit Parallelism},
  author = {Alexis Le Glaunec and Lingkun Kong and Konstantinos Mamouras},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {OOPSLA2},
  year = {2024},
  doi = {10.1145/3689771}
}