arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2102.03681cs.MSstat.CO
收藏

FastAD:基于表达模板的C++库,用于快速且内存高效的自动微分

FastAD: Expression Template-Based C++ Library for Fast and Memory-Efficient Automatic Differentiation

James Yang

摘要:

自动微分是一组有效且准确地计算由计算机程序表示的函数的导数的技术。然而,用于自动微分的现有C++库(例如,Adept、Stan Math Library)表现出大的内存消耗和运行时性能问题。本文介绍了FastAD,一个新的C++模板库的自动微分,克服了所有这些挑战,在现有的图书馆使用向量化,更简单的存储管理使用完全表达式模板的设计,和其他编译时优化,以消除一些运行时开销。基准测试表明,FastAD在各种测试用例(包括一些真实示例)中的执行速度比Adept快2-10倍,比Stan快2-19倍。

英文摘要:

Automatic differentiation is a set of techniques to efficiently and accurately compute the derivative of a function represented by a computer program. Existing C++ libraries for automatic differentiation (e.g. Adept, Stan Math Library), however, exhibit large memory consumptions and runtime performance issues. This paper introduces FastAD, a new C++ template library for automatic differentiation, that overcomes all of these challenges in existing libraries by using vectorization, simpler memory management using a fully expression-template-based design, and other compile-time optimizations to remove some run-time overhead. Benchmarks show that FastAD performs 2-10 times faster than Adept and 2-19 times faster than Stan across various test cases including a few real-world examples.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑