Automated code generation can systematically exceed expert hand-optimization for recurrence relations--computational primitives ubiquitous in orthogonal polynomials, special functions, numerical integration, and molecular integral evaluation. We present RECURSUM, a Python DSL generating optimized C++ for arbitrary recurrence relations via three backends--template metaprogramming, a novel LayeredCodegen backend, and runtime loop-based evaluation--specifying recurrences in 10--30 lines of Python that generate 650+ lines of production C++. LayeredCodegen achieves 9.8$\times$ speedup over expert hand-written code and 1.9$\times$ over template metaprogramming for McMurchie-Davidson Hermite coefficients, through zero-copy output parameters, guaranteed inlining, and exact-sized stack buffers. A DAG-topological generalization of this architecture--built to express the four-center electron-repulsion integral that LayeredCodegen's tower model cannot--beats libint2, a mature, two-decade-refined production library, on 12 of 14 Cartesian integral classes, with $\sim$2$\times$ faster contracted Coulomb/exchange (J/K) matrix construction (alkanes and 3-D DNA fragments alike) and 1.1--2.7$\times$ faster one-electron integrals, completing the full Hartree-Fock integral set from one DAG framework. We validate 24 recurrence types spanning pure mathematics, numerical analysis, and quantum chemistry; production benchmarks confirm these speedups propagate to complete algorithms, matching expert baselines within 3.3\%. By eliminating the dual expertise barrier of domain knowledge and C++ metaprogramming, RECURSUM establishes systematic code generation--not hand-tuning--as the performance ceiling for recurrence algorithms.


翻译:暂无翻译

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
专知会员服务
37+阅读 · 2021年10月16日
专知会员服务
16+阅读 · 2021年1月23日
【反馈循环自编码器】FEEDBACK RECURRENT AUTOENCODER
专知会员服务
23+阅读 · 2020年1月28日
【资源】领域自适应相关论文、代码分享
专知
32+阅读 · 2019年10月12日
A Technical Overview of AI & ML in 2018 & Trends for 2019
待字闺中
18+阅读 · 2018年12月24日
【干货】深入理解自编码器(附代码实现)
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 11月11日
VIP会员
最新内容
《美空军2026条令文件:对海压制作战》
专知会员服务
25+阅读 · 11月9日
人工智能与战争的未来
专知会员服务
10+阅读 · 11月8日
《Agent Mosaic:识别智能体LLM系统中的机密泄露》
专知会员服务
12+阅读 · 11月8日
人工智能在军事教育中的应用:若干视角与经验
专知会员服务
12+阅读 · 11月6日
“星链”减速与不断适应的乌克兰
专知会员服务
10+阅读 · 11月6日
美国中期选举之后:帕兰提尔面临不确定性?
专知会员服务
7+阅读 · 11月6日
相关VIP内容
专知会员服务
37+阅读 · 2021年10月16日
专知会员服务
16+阅读 · 2021年1月23日
【反馈循环自编码器】FEEDBACK RECURRENT AUTOENCODER
专知会员服务
23+阅读 · 2020年1月28日
相关基金
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
3+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员