RECURSUM: Automated Code Generation for Recurrence Relations Exceeds Expert Optimization via LayeredCodegen
Rub\'en Dar\'io Guerrero

TL;DR
RECURSUM is a Python-based DSL that generates optimized C++ code for recurrence relations, surpassing expert hand-optimization through architectural enhancements and systematic code generation.
Contribution
Introduces RECURSUM, a novel framework that automates high-performance code generation for recurrence relations, outperforming manual expert implementations.
Findings
LayeredCodegen achieves 9.8x speedup over expert code.
Systematic code generation can surpass manual optimization.
Generated code matches expert baselines within 3.3%.
Abstract
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-based domain-specific language generating optimized C++ for arbitrary recurrence relations via three backends: template metaprogramming for compile-time evaluation, a novel LayeredCodegen backend with architectural optimizations, and runtime loop-based evaluation. The DSL uses einsum-inspired notation to specify recurrences, validity constraints, and base cases in 10-30 lines of Python, generating 650+ lines of production C++. LayeredCodegen achieves 9.8x speedup over expert hand-written implementations and 1.9x over template metaprogramming for McMurchie-Davidson Hermite coefficients. Architecture analysis reveals…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
