

Paper: 2604.15272 Authors: Mengdi Wu, Xiaoyu Jiang, Oded Padon, Zhihao Jia Categories: cs.PL, cs.AI, cs.LG
The Gap
Existing tensor program optimizers fall into two camps. Compiler-based approaches (TVM, XLA) use heuristic search with hand-crafted rules — fast but miss optimal implementations. Superoptimizers (MetaFlow, TASO) exhaustively enumerate concrete programs — thorough but explode combinatorially for real workloads. The gap: no one bridges exhaustive rigor with practical scalability for modern LLM-scale tensor computations.
Problem: Optimize tensor ops for LLMs
|
v
Assumption: Can represent program families symbolically
|
+---> Method: Two-level search (symbolic + concrete)
| with provable pruning
|
+---> Evidence: 2.2x over superoptimizers, 4.9x over compilers
| on 5 LLM workloads
|
v
Conclusion: Symbolic reasoning enables exhaustive search at scale
The Increment
One sentence: Before Prism, you chose between fast-but-incomplete heuristics or slow-but-thorough enumeration; after Prism, symbolic reasoning lets you exhaustively search while pruning provably bad paths.
Core Mechanism
Prism operates in two levels. First, it generates symbolic graphs (sGraphs) where execution parameters like tile sizes and loop orders are symbolic variables, not concrete values. Each sGraph represents an entire family of implementations. Second, it instantiates these symbolic graphs into concrete programs by assigning specific values to parameters.
The key innovation is structured pruning during symbolic generation. Prism encodes operator semantics, algebraic identities (like matrix multiplication associativity), and hardware constraints (memory hierarchy, parallelism limits) as symbolic rules. When exploring the search space, it can prove entire families of programs are suboptimal without instantiating them. For example, if a symbolic graph violates memory bandwidth constraints for all possible tile sizes, Prism discards the whole family.
Input Tensor Program
|
v
[Symbolic Graph Generator]
|
(generates sGraphs with symbolic params)
|
+---> sGraph_1 (tile=T, order=O)
| sGraph_2 (tile=T', order=O')
| ...
|
v
[Symbolic Pruning Engine]
(uses operator semantics + algebra + HW constraints)
|
(prunes provably suboptimal families)
|
v
Surviving sGraphs
|
v
[Parameter Instantiation]
(auto-tuning: T=32, O=ijk)
|
v
Concrete Optimized Programs
Think of Prism like a chess engine with opening books. Traditional superoptimizers play out every possible game move-by-move (concrete enumeration) — exhausting. Compilers use opening heuristics but stop analyzing mid-game (incomplete). Prism maintains an opening book of symbolic positions (sGraphs) where each entry represents thousands of similar games. It prunes entire branches by proving “all games starting with this opening lose to this defense” (symbolic reasoning), then only plays out the promising openings with specific move sequences (instantiation). The opening book is the symbolic layer; the actual games played are the concrete layer.
Key Concepts
-
Symbolic Graph (sGraph): Instead of representing one program with concrete tile size 32 and loop order ijk, an sGraph represents all programs with tile size T (symbolic variable) and loop order O (symbolic variable). It’s a template with holes. The power: you can reason about properties that hold for all values of T and O without trying each combination. Example: “For any T
> memory_size, this sGraph will thrash cache” — proven once, eliminates infinite concrete programs. -
Two-Level Search: Most optimizers search a flat space of concrete programs. Prism searches a hierarchical space: first find good symbolic templates (families), then find good parameter values within each family. This is like first choosing “what kind of algorithm” (symbolic: divide-and-conquer vs dynamic programming) before tuning “how to implement it” (concrete: recursion depth, memoization table size). The levels interact: symbolic pruning uses hardware constraints that depend on parameters, but proves properties that hold across parameter ranges.
-
E-graph Rewriting for Equivalence: When Prism generates two sGraphs, it needs to know if they’re equivalent (compute the same result). Traditional approaches execute both and compare outputs — expensive and only checks one parameter assignment. Prism uses e-graphs (equality graphs) that compactly represent equivalent expressions. It rewrites sGraphs using algebraic identities (A×B×C = A×(B×C)) and checks if they land in the same equivalence class. This proves equivalence symbolically for all parameter values at once.
Framework Shift
Before (mainstream approach): After (this paper):
Concrete Program Space Symbolic Family Space
|
P1 P2 P3 P4 P5 ... sG1 ----+---- sG2
\ | | / / | |
\ | | / / (T=32,O=ijk) (T=64,O=ikj)
\ | | / / | |
Enumerate P1,P2 P3,P4
& Test | |
| Test Test
v | |
Best Program +------+------+
|
v
Best Program
(Try every program) (Try families, prune symbolically,
instantiate survivors)
From exhaustive concrete enumeration to hierarchical symbolic search, the core shift is: reason about program families before instantiating individuals.
Expert Assessment
Problem choice: Real gap. LLM inference is bottlenecked by tensor ops, and the optimization space genuinely explodes (tile sizes × loop orders × fusion strategies × parallelization schemes). Compilers leave 2-5× performance on the table; superoptimizers timeout on realistic workloads. This sits at the intersection of PL verification techniques and ML systems — timely and well-motivated.
Method maturity: Clever synthesis of existing ideas (symbolic execution, e-graphs, auto-tuning) rather than a single novel insight. The contribution is engineering them together effectively. The symbolic pruning rules are domain-specific (tensor algebra, memory hierarchy) — not a general framework. Could simpler approaches work? Possibly: learned cost models might prune similarly without symbolic reasoning, but the paper doesn’t compare against ML-guided search.
Experimental integrity: Baselines are fair (MetaFlow, TASO, TVM, XLA). Numbers look solid: 2.2× speedup is meaningful but not shocking given the exhaustive search. Red flag: only 5 workloads tested, all from LLM domain (attention, MLP, LayerNorm). Generalization to CNNs, graph neural nets, or scientific computing is unclear. The 3.4× optimization time reduction is impressive but measured on a single hardware setup (A100 GPU) — would be stronger with CPU/TPU results.
Writing quality: Section 3 (sGraph representation) is dense — the formalism obscures intuition. A running example traced through symbolic generation → pruning → instantiation would clarify. Section 5 (evaluation) front-loads speedup numbers but buries the search space reduction analysis (Table 3) — that’s the real story. The related work undersells how much this borrows from program synthesis (CEGIS, sketch-based synthesis).
Verdict: weak accept — Solid engineering contribution with real speedups, but incremental conceptually and narrow experimental scope. Would be stronger with broader workload coverage and ablation studies on which pruning rules matter most.
Takeaways
Hierarchical search with symbolic pruning: When your optimization space has structure (families of similar solutions), don’t search flat. Build a symbolic layer that represents families, prune at that level, then instantiate. Applies beyond tensor programs — database query optimization, circuit synthesis, configuration tuning all have this structure.
E-graphs for equivalence checking: If you’re generating many program variants and need to deduplicate, e-graphs are faster than execution-based comparison. They prove equivalence symbolically using rewrite rules. Steal this for any domain with algebraic identities (arithmetic, logic, relational algebra).
Two-phase auto-tuning: Separate “what to tune” (symbolic structure) from “how to tune it” (parameter values). Prism’s symbolic layer identifies promising structures; auto-tuning only runs on those. This avoids wasting tuning budget on bad structures. Useful for hyperparameter optimization, compiler flag tuning, system configuration.
Don’t over-generalize: Prism’s pruning rules are hand-crafted for tensor ops and GPU memory hierarchy. The paper doesn’t claim a general symbolic optimizer. If you’re in a different domain, you’ll need domain-specific rules. The framework (symbolic representation + pruning + instantiation) transfers; the rules don’t.
论文: 2604.15272 作者: Mengdi Wu, Xiaoyu Jiang, Oded Padon, Zhihao Jia 分类: cs.PL, cs.AI, cs.LG
缺口
现有张量程序优化器分两派。
编译器方法(TVM、XLA)用启发式搜索加手写规则——快但找不到最优实现。
超优化器(MetaFlow、TASO)穷举枚举具体程序——彻底但对真实工作负载组合爆炸。
缺口:没人能在现代LLM规模的张量计算上兼顾穷举的严谨性和实用的可扩展性。
问题:为LLM优化张量操作
|
v
假设:可以符号化表示程序族
|
+---> 方法:两层搜索(符号+具体)
| 配合可证明的剪枝
|
+---> 证据:比超优化器快2.2倍,比编译器快4.9倍
| 在5个LLM工作负载上
|
v
结论:符号推理让穷举搜索在规模上可行
增量
一句话: Prism之前,你在快但不完整的启发式和慢但彻底的枚举之间二选一;
Prism之后,符号推理让你能穷举搜索的同时剪掉可证明的坏路径。
核心机制
Prism分两层运作。
第一层,它生成符号图(sGraph),其中执行参数如分块大小、循环顺序是符号变量而非具体值。
每个sGraph代表一整族实现。
第二层,它把这些符号图实例化为具体程序,给参数赋具体值。
关键创新是符号生成期间的结构化剪枝。
Prism把算子语义、代数恒等式(如矩阵乘法结合律)、硬件约束(内存层次、并行限制)编码为符号规则。
探索搜索空间时,它能证明整族程序次优而无需实例化。
例如,如果一个符号图对所有可能的分块大小都违反内存带宽约束,Prism就丢弃整族。
输入张量程序
|
v
[符号图生成器]
|
(生成带符号参数的sGraph)
|
+---> sGraph_1 (tile=T, order=O)
| sGraph_2 (tile=T', order=O')
| ...
|
v
[符号剪枝引擎]
(用算子语义+代数+硬件约束)
|
(剪掉可证明次优的族)
|
v
幸存的sGraph
|
v
[参数实例化]
(自动调优:T=32, O=ijk)
|
v
具体优化程序
把Prism想象成带开局库的国际象棋引擎。
传统超优化器逐步下完每一盘可能的棋(具体枚举)——累死人。
编译器用开局启发式但中盘就停止分析(不完整)。
Prism维护一个符号局面的开局库(sGraph),每条记录代表数千盘相似的棋局。
它通过证明”所有以这个开局开始的棋局都输给这个防御”(符号推理)来剪掉整个分支,然后只用具体着法序列(实例化)下有希望的开局。
开局库是符号层;
实际下的棋是具体层。
关键概念
- 符号图(sGraph): 不是用具体分块大小32和循环顺序ijk表示一个程序,sGraph用分块大小T(符号变量)和循环顺序O(符号变量)表示所有程序。
它是带洞的模板。
威力在于:你能推理对所有T和O值都成立的性质,无需尝试每个组合。
例子:“对任何T > 内存大小,这个sGraph会抖动缓存”——证明一次,排除无限个具体程序。
- 两层搜索: 多数优化器搜索具体程序的平面空间。
Prism搜索分层空间:先找好的符号模板(族),再在每族内找好的参数值。
这就像先选”什么算法”(符号:分治vs动态规划),再调”怎么实现”(具体:递归深度、记忆表大小)。
两层交互:符号剪枝用依赖参数的硬件约束,但证明跨参数范围成立的性质。
- E-graph重写做等价性检查: Prism生成两个sGraph时,需要知道它们是否等价(算同样结果)。
传统方法执行两者并比较输出——昂贵且只检查一个参数赋值。
Prism用e-graph(等价图)紧凑表示等价表达式。
它用代数恒等式(A×B×C = A×(B×C))重写sGraph,检查是否落入同一等价类。
这对所有参数值一次性符号化证明等价性。
框架转变
之前(主流方法): 之后(本文方法):
具体程序空间 符号族空间
|
P1 P2 P3 P4 P5 ... sG1 ----+---- sG2
\ | | / / | |
\ | | / / (T=32,O=ijk) (T=64,O=ikj)
\ | | / / | |
枚举 P1,P2 P3,P4
并测试 | |
| 测试 测试
v | |
最佳程序 +------+------+
|
v
最佳程序
(尝试每个程序) (尝试族,符号剪枝,
实例化幸存者)
从穷举具体枚举到分层符号搜索,核心转变是:在实例化个体之前推理程序族。
专家评审
选题眼光: 真缺口。
LLM推理瓶颈在张量操作,优化空间确实爆炸(分块大小×循环顺序×融合策略×并行化方案)。
编译器留下2-5倍性能;
超优化器在现实工作负载上超时。
这处于PL验证技术和ML系统的交叉点——时机好,动机足。
方法成熟度: 巧妙综合现有想法(符号执行、e-graph、自动调优)而非单一新颖洞见。
贡献是有效地把它们工程化到一起。
符号剪枝规则是领域特定的(张量代数、内存层次)——不是通用框架。
有更简单的方法吗?
可能:学习的代价模型也许能类似剪枝而无需符号推理,但论文没比较ML引导的搜索。
实验诚意: 基线公平(MetaFlow、TASO、TVM、XLA)。
数字看起来扎实:2.2倍加速有意义但不震撼,考虑到穷举搜索。
红旗:只测了5个工作负载,全来自LLM领域(注意力、MLP、LayerNorm)。
泛化到CNN、图神经网络或科学计算不清楚。
3.4倍优化时间缩减令人印象深刻但只在单一硬件设置(A100 GPU)上测——有CPU/TPU结果会更强。
写作功力: 第3节(sGraph表示)密集——形式化掩盖直觉。
一个贯穿符号生成→剪枝→实例化的运行例子会更清晰。
第5节(评估)前置加速数字但埋藏搜索空间缩减分析(表3)——那才是真正的故事。
相关工作低估了从程序综合(CEGIS、基于sketch的综合)借鉴了多少。
判决: 弱接收——扎实的工程贡献和真实加速,但概念上渐进且实验范围窄。
更广的工作负载覆盖和消融研究(哪些剪枝规则最重要)会更强。
要点总结
带符号剪枝的分层搜索: 当你的优化空间有结构(相似解的族)时,别平面搜索。
构建代表族的符号层,在那层剪枝,然后实例化。
适用于张量程序之外——数据库查询优化、电路综合、配置调优都有这种结构。
用E-graph做等价性检查: 如果你生成很多程序变体需要去重,e-graph比基于执行的比较快。
它们用重写规则符号化证明等价性。
偷这招用于任何有代数恒等式的领域(算术、逻辑、关系代数)。
两阶段自动调优: 分离”调什么”(符号结构)和”怎么调”(参数值)。
Prism的符号层识别有希望的结构;
自动调优只在那些上跑。
这避免在坏结构上浪费调优预算。
对超参数优化、编译器标志调优、系统配置有用。
别过度泛化: Prism的剪枝规则是为张量操作和GPU内存层次手工制作的。
论文不声称通用符号优化器。
如果你在不同领域,需要领域特定规则。
框架(符号表示+剪枝+实例化)可迁移;
规则不行。