arXiv:2606.10937cs.DBcs.AI2026-06

用代数方法实现编译器中张量溯源,无需侵入性改造。

Provenance Tracking in AI Compilers through the Lens of Coalgebra

  • 基于可观测行为推导溯源,不依赖中间节点标识。
  • 在编译流程中保持张量与算子的溯源稳定,即使节点被删除。
  • 轻量实现,适合需要调试与验证变换的开发者使用。

AI 编译器通过规范化、降级和优化大幅重写计算图,导致张量和算子的溯源难以追踪。可靠溯源对于附加平台特定后处理、调试编译器行为以及验证变换至关重要,但现有方案在非单射图重写下要么侵入性强,要么临时应付。本文提出一种基于观测语义的轻量生成式溯源方法:不传递标识符,而是通过观察图变换来推理溯源。我们用代数模型与双模拟关系形式化该方法,在中间节点被消除时仍能保持溯源一致性。进一步在原型编译器 COVAN 中实现,证明其在编译流水线中具备稳定溯源能力,工程开销极小。

原文摘要 · Abstract (English)

AI compilers aggressively rewrite computation graphs through normalization, lowering, and optimization, making it difficult to track the provenance of tensors and operators across compilation. Reliable provenance is essential for attaching platform-specific postprocessing, debugging compiler behavior, and validating transformations, yet existing solutions are either invasive or ad hoc under non-injective graph rewrites. We present a lightweight, generative approach to provenance tracking based on observational semantics. Instead of propagating identifiers through compiler passes, we observe graph transformations and reason about provenance in terms of observable computational actions. We formalize this approach using a coalgebraic model and bisimulation, which preserves provenance even when intermediate nodes are eliminated. Furthermore, we implement this approach in a prototype AI compiler COVAN, demonstrating stable provenance across compilation pipelines with minimal engineering overhead.

编译器溯源代数

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。