[论文解读] ParEVO: Synthesizing Code for Irregular Data: High-Performance Parallelism through Agentic Evolution
ParEVO 通过专门化的大语言模型并使用 Evolutionary Coding Agent 来合成和优化针对不规则数据的并行代码,达到大幅度加速并匹配人类基线。
The transition from sequential to parallel computing is essential for modern high-performance applications but is hindered by the steep learning curve of concurrent programming. This challenge is magnified for irregular data structures (such as sparse graphs, unbalanced trees, and non-uniform meshes) where static scheduling fails and data dependencies are unpredictable. Current Large Language Models (LLMs) often fail catastrophically on these tasks, generating code plagued by subtle race conditions, deadlocks, and sub-optimal scaling. We bridge this gap with ParEVO, a framework designed to synthesize high-performance parallel algorithms for irregular data. Our contributions include: (1) The Parlay-Instruct Corpus, a curated dataset of 13,820 tasks synthesized via a "Critic-Refine" pipeline that explicitly filters for empirically performant algorithms that effectively utilize Work-Span parallel primitives; (2) specialized DeepSeek, Qwen, and Gemini models fine-tuned to align probabilistic generation with the rigorous semantics of the ParlayLib library; and (3) an Evolutionary Coding Agent (ECA) that improves the "last mile" of correctness by iteratively repairing code using feedback from compilers, dynamic race detectors, and performance profilers. On the ParEval benchmark, ParEVO achieves an average 106x speedup (with a maximum of 1103x) across the suite, and a robust 13.6x speedup specifically on complex irregular graph problems, outperforming state-of-the-art commercial models. Furthermore, our evolutionary approach matches state-of-the-art expert human baselines, achieving up to a 4.1x speedup on specific highly-irregular kernels. Source code and datasets are available at https://github.com/WildAlg/ParEVO.
研究动机与目标
- 激励并解决对不规则数据工作负载(图、稀疏结构)进行并行化的挑战,其中静态调度失效且序列偏差阻碍 LLM 效能。
- 提出一种以数据为中心的综合流水线,使用 ParlayLib 原语生成正确性优先的并行代码。
- 引入一个进化编码代理(ECA),通过编译器、竞争条件检测与分析器等反馈不断迭代改进代码。
- 针对 ParlayLib/Rust 原语进行多型号 LLM 逐步微调,以使生成结果与并行原语的正确语义保持一致。
- 在 C++ 与 Rust 基准测评中,与商业模型及专家人类基线相比,展示出显著的经验收益与强鲁棒性。
提出的方法
- 通过教师-学生-评审循环并以严格的编译与测试验证来创建 Parlay-Instruct 语料库。
- 使用 LoRA 与多阶段对齐流水线,在 ParlayLib 与 Rust 原语上微调 DeepSeek、Qwen 与 Gemini 模型。
- 将代码生成形式化为一个对 AST 的进化搜索,包含候选群体和基于编译、测试、竞态检测与性能的适应度评估。
- 使用 MAP-Elites 选择来维持代码长度、圈复杂度与同步频率等方面的多样性。
- 使用外部确定性工具(编译器、动态竞态检测器)作为基准真相评判,而非单纯依赖 LLM 的正确性评估。
- 在 ParEval、PBBS/RPB 基线以及 DMOJ 的未见问题上进行评估,测量 Build@1、Pass@1 与 Speedup@1。
实验结果
研究问题
- RQ1对 ParlayLib 原语进行微调的 LLM 是否能够产生可编译且语义正确的针对不规则数据的并行代码?
- RQ2利用运行时反馈的进化编码代理是否能在正确性与性能方面超越一次性生成?
- RQ3在更强语义基础与峰值运行时加速之间,存在怎样的性能权衡(对齐成本)?
- RQ4ParEVO 是否能将不局限于训练数据的 Rust 与 C++ 不规则并行工作负载也良好泛化?
- RQ5与专家人类基线相比,ParEVO 生成的解在复杂不规则内核中的表现如何?
主要发现
| Model/Method | Language | Runtime (s) | Speedup (1T) | Speedup (Base) |
|---|---|---|---|---|
| Baseline code (PBBS) | C++ | 1.24 | – | – |
| PAREVO (GEMINI) | Rust | 0.07728 | 0.938x | 4.125x |
| PAREVO (GEMINI) | Rust | 0.1928 | 21.43286835x | 1.0708x |
| PAREVO (GEMINI) | C++ | 1.169 | 23.689x | 1.061x |
| PAREVO (GEMINI) | C++ | 0.019 | >13.94x | 2.68421x |
| PAREVO (GEMINI) | Rust | 0.08865 | 15.482x | 1.305x |
| PAREVO (GEMINI) | C++ | 6.627 | >1.814x | 2.68421x |
| DeepSeek-Parlay | Parlay | 0.33 | – | – |
| Gemini-2.5-Parlay | Parlay | 0.33 | 106.87x | 0.84x |
| Qwen3-Parlay | Parlay | 0.33 | 8.63x | 0.50x |
| DeepSeek-6.7B-Base | Parlay | 0.11 | 3.65x | 0.89x |
- Gemini-2.5-Parlay 在 ParEval 任务上相对于基线平均实现 106x 的加速,最高达到 1103x。
- 微调后的模型在 Build@1 上接近完美,在 Pass@1 与 Speedup@1 上显著高于基础模型。
- ParEVO 的语义对齐使模型能够正确使用 ParlayLib 原语(如使用带通用自动参数的 sort_inplace 处理复杂类型),并提升运行时加速(如在一个复杂排序任务中达到 17.5x)。
- 进化编码代理在包含 30 次迭代的消融实验中相对于单次生成带来 2.2x 的性能提升。
- ParEVO 在多个问题(如最大独立集、最大匹配)上与专家 PBBS/RPB 基线相当或超越,并在 Rust 内核上实现显著的加速(最高约 4.1x)。
- 强标尺结果显示在若干不规则内核中可近线性扩展至 64 核心(例如 FFT DFT 的扩展约达到 40x)。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。