Automatic differentiation (AD) is a technique for computing the derivative of a function represented by a program. This technique is considered as the de-facto standard for computing the differentiation in many machine learning and optimisation software tools. Despite the practicality of this technique, the performance of the differentiated programs, especially for functional languages and in the presence of vectors, is suboptimal. We present an AD system for a higher-order functional array-processing language. The core functional language underlying this system simultaneously supports both source-to-source forward-mode AD and global optimisations such as loop transformations. In combination, gradient computation with forward-mode AD can be as efficient as reverse mode, and the Jacobian matrices required for numerical algorithms such as Gauss-Newton and Levenberg-Marquardt can be efficiently computed.
translated by 谷歌翻译
Derivatives, mostly in the form of gradients and Hessians, are ubiquitous in machine learning. Automatic differentiation (AD), also called algorithmic differentiation or simply "autodiff", is a family of techniques similar to but more general than backpropagation for efficiently and accurately evaluating derivatives of numeric functions expressed as computer programs. AD is a small but established field with applications in areas including computational fluid dynamics, atmospheric sciences, and engineering design optimization. Until very recently, the fields of machine learning and AD have largely been unaware of each other and, in some cases, have independently discovered each other's results. Despite its relevance, general-purpose AD has been missing from the machine learning toolbox, a situation slowly changing with its ongoing adoption under the names "dynamic computational graphs" and "differentiable programming". We survey the intersection of AD and machine learning, cover applications where AD has direct relevance, and address the main implementation techniques. By precisely defining the main differentiation techniques and their interrelationships, we aim to bring clarity to the usage of the terms "autodiff", "automatic differentiation", and "symbolic differentiation" as these are encountered more and more in machine learning settings.
translated by 谷歌翻译
我们基于功能分析中的分类结构开发了一种自动和符号分化的组成方法,其中衍生物是抽象向量上的线性函数,而不是限于标量,向量,矩阵或张力器,表示为多维阵列。我们表明,可以使用差分计算来实现符号和自动分化,以生成基于原始,恒定,线性和双线性函数的规则以及其顺序和并行组成的线性函数。线性函数以组合域特异性语言表示。最后,我们提供了一个微积分,用于象征性地计算衍生物的伴随,而无需使用矩阵,而矩阵过于效率低,无法在高维空间上使用。衍生物的最终符号表示保留了输入程序的数据并行操作。组合分化和计算形式的伴随的组合在行为上等同于反向模式自动分化。特别是,它为矩阵过于效率而无法表示线性功能的优化提供了机会。
translated by 谷歌翻译
一般矩阵乘法或GEMM内核在高性能计算和机器学习中占据中心位置。最近的NVIDIA GPU包括Gemm加速器,如Nvidia的张量核心。他们的剥削受到双语言问题的阻碍:它需要低级编程,这意味着低程序员的工作效率或使用只提供有限组件集的库。由于建立的组件方面的REPRASING算法经常引入开销,因此图书馆缺乏灵活性限制了探索新算法的自由。因此,使用GEMMS的研究人员无法立即享受编程生产力,高性能和研究灵活性。在本文中,我们解决了这个问题。我们在科学朱莉娅编程语言中展示了三组抽象和接口来编程宝石。界面和抽象共同设计用于研究人员的需求和朱莉娅的特征,以实现足够的担忧和灵活性的充分分离,以便在不支付性能价格的情况下轻松地扩展基本宝石。将我们的Gemms与最先进的图书馆Cublas和Cutlass进行比较,我们证明我们的性能在图书馆的相同球场中,并且在某些情况下甚至超过它,而无需在CUDA C ++中编写单行代码或者组装,而不面临灵活限制。
translated by 谷歌翻译
本文介绍了正向和反向模式的校正和高效自动分化的校正和高效自动化。自动差异是获得数值节目梯度的方法,这对于优化,不确定量化和机器学习至关重要。计算渐变的计算成本是实践中的常见瓶颈。对于使用OpenMP为多核CPU或GPU并行化的应用程序,还希望并行计算渐变。我们提出了一个框架,原因是生成的衍生代码的正确性,我们向差异化模型证明了我们的OpenMP扩展。我们在自动差异化工具磁带上实施此模型,并在我们的扩展差异化过程之后差异化的目前的测试用例。生成的衍生程序的性能在前进和反向模式优于顺序,尽管我们的反向模式通常比输入程序更差。
translated by 谷歌翻译
Bridging cultures that have often been distant, Julia combines expertise from the diverse fields of computer science and computational science to create a new approach to numerical computing. Julia is designed to be easy and fast. Julia questions notions generally held as "laws of nature" by practitioners of numerical computing:1. High-level dynamic programs have to be slow, 2. One must prototype in one language and then rewrite in another language for speed or deployment, and 3. There are parts of a system for the programmer, and other parts best left untouched as they are built by the experts.We introduce the Julia programming language and its design -a dance between specialization and abstraction. Specialization allows for custom treatment. Multiple dispatch, a technique from computer science, picks the right algorithm for the right circumstance. Abstraction, what good computation is really about, recognizes what remains the same after differences are stripped away. Abstractions in mathematics are captured as code through another technique from computer science, generic programming.Julia shows that one can have machine performance without sacrificing human convenience.
translated by 谷歌翻译
我们介绍了Netket的版本3,机器学习工具箱适用于许多身体量子物理学。Netket围绕神经网络量子状态构建,并为其评估和优化提供有效的算法。这个新版本是基于JAX的顶部,一个用于Python编程语言的可差分编程和加速的线性代数框架。最重要的新功能是使用机器学习框架的简明符号来定义纯Python代码中的任意神经网络ANS \“凝固的可能性,这允许立即编译以及渐变的隐式生成自动化。Netket 3还带来了GPU和TPU加速器的支持,对离散对称组的高级支持,块以缩放多程度的自由度,Quantum动态应用程序的驱动程序,以及改进的模块化,允许用户仅使用部分工具箱是他们自己代码的基础。
translated by 谷歌翻译
在过去十年中,已经开发出新的深度学习(DL)算法,工作负载和硬件来解决各种问题。尽管工作量和硬件生态系统的进步,DL系统的编程方法是停滞不前的。 DL工作负载从DL库中的高度优化,特定于平台和不灵活的内核,或者在新颖的操作员的情况下,通过具有强大性能的DL框架基元建立参考实现。这项工作介绍了Tensor加工基元(TPP),一个编程抽象,用于高效的DL工作负载的高效,便携式实现。 TPPS定义了一组紧凑而多才多艺的2D张镜操作员(或虚拟张量ISA),随后可以用作构建块,以在高维张量上构建复杂的运算符。 TPP规范是平台 - 不可行的,因此通过TPPS表示的代码是便携式的,而TPP实现是高度优化的,并且特定于平台。我们展示了我们使用独立内核和端到端DL&HPC工作负载完全通过TPPS表达的方法的效力和生存性,这在多个平台上优于最先进的实现。
translated by 谷歌翻译
神经网络越来越依赖于复杂安全系统(例如自动驾驶汽车)的组成部分。对在更大的验证周期中嵌入神经网络验证的工具和方法的需求很高。但是,由于关注的广泛验证属性,很难进行神经网络验证,通常每个验证属性仅适用于专用求解器中的验证。在本文中,我们展示了最初设计用于验证,验证和仿真金融基础架构的功能编程语言的Imandra如何为神经网络验证提供整体基础架构。我们开发了一个新颖的图书馆Checkinn,该图书馆在Imandra的神经网络上形式化,并涵盖了神经网络验证的不同重要方面。
translated by 谷歌翻译
We present a new algorithm for automatically bounding the Taylor remainder series. In the special case of a scalar function $f: \mathbb{R} \mapsto \mathbb{R}$, our algorithm takes as input a reference point $x_0$, trust region $[a, b]$, and integer $k \ge 0$, and returns an interval $I$ such that $f(x) - \sum_{i=0}^k \frac {f^{(i)}(x_0)} {i!} (x - x_0)^i \in I (x - x_0)^{k+1}$ for all $x \in [a, b]$. As in automatic differentiation, the function $f$ is provided to the algorithm in symbolic form, and must be composed of known elementary functions. At a high level, our algorithm has two steps. First, for a variety of commonly-used elementary functions (e.g., $\exp$, $\log$), we derive sharp polynomial upper and lower bounds on the Taylor remainder series. We then recursively combine the bounds for the elementary functions using an interval arithmetic variant of Taylor-mode automatic differentiation. Our algorithm can make efficient use of machine learning hardware accelerators, and we provide an open source implementation in JAX. We then turn our attention to applications. Most notably, we use our new machinery to create the first universal majorization-minimization optimization algorithms: algorithms that iteratively minimize an arbitrary loss using a majorizer that is derived automatically, rather than by hand. Applied to machine learning, this leads to architecture-specific optimizers for training deep networks that converge from any starting point, without hyperparameter tuning. Our experiments show that for some optimization problems, these hyperparameter-free optimizers outperform tuned versions of gradient descent, Adam, and AdaGrad. We also show that our automatically-derived bounds can be used for verified global optimization and numerical integration, and to prove sharper versions of Jensen's inequality.
translated by 谷歌翻译
我们提供了静态分析,用于发现给定概率程序的可区分或更普遍的平滑部分,并展示如何使用分析来改善路径梯度估计器,这是后验推理和模型学习的最流行方法之一。我们的改进将估计器的范围从可区分模型到非差异性模型的范围,而无需用户手动干预;改进的估计器会使用我们的静态分析自动识别给定概率程序的可区分部分,并将路径梯度估计器应用于已识别的零件,同时使用程序的其余部分使用更通用但效率较低的估计器(称为得分估计器)。我们的分析具有令人惊讶的微妙的声音论点,部分原因是从程序分析设计师的角度看待某些目标平滑性属性的不当行为。例如,某些平滑度属性不能通过函数组成保留,这使得在不牺牲精度的情况下很难分析顺序组成。我们在目标平滑度属性上制定了五个假设,证明了我们在这些假设下的分析的健全性,并表明我们的主要示例满足了这些假设。我们还表明,通过使用分析中的信息,我们的改进梯度估计器满足了重要的可不同性要求,因此,在轻度的规律性条件下,平均计算正确的估计值,即,它返回无偏见的估计值。我们在Pyro语言中使用代表性概率程序进行的实验表明,我们的静态分析能够准确地识别这些程序的平滑部分,并使我们改进的路径梯度估计器利用这些程序中的所有高性能机会。
translated by 谷歌翻译
我们介绍了一个自动选择数据结构的框架,以支持分析工作负载的有效计算。我们的贡献是双重的。首先,我们介绍了一种新颖的低级中间语言,可以表达各种查询处理范例背后的算法,例如经典加入,GroupJoin和数据库内机器学习引擎。此语言围绕词典的概念设计,并允许更精细地选择其低级实现。其次,通过组合机器学习和程序推理,自动推断出替代实施的成本模型。使用在给定硬件架构上的字典操作的分析数据集上培训的回归模型来学习字典成本模型。使用静态程序分析推断出计划成本模型。我们的实验结果表明,训练有素的成本模型在微基准上的有效性。此外,我们表明,我们的框架生成的代码的性能要么擅长,要么与最先进的分析查询引擎和最近的数据库内机器学习框架相同。
translated by 谷歌翻译
深度学习的快速进步正在导致一系列快速变化的模型,对计算的需求急剧增长。但是,随着框架将性能优化专门针对流行网络的模式,它们隐含地限制了推动研究进展的新颖和多样化的模型。我们通过定义灵活和用户可定制的管道来优化基于数据运动最小化的任意深神经网络的培训来赋予深度学习研究人员的能力。管道始于Pytorch或ONNX中的标准网络,并通过逐步降低转换计算。我们定义了四个级别的通用转换级别,从局部操作员优化到全球数据运动减少。这些在以数据为中心的图形中间表示上运行,该表示在各个级别的抽象级别表达计算和数据移动,包括扩展基本运算符,例如其基础计算的卷积。设计的核心是管道的互动性和内省性质。每个部分都可以通过Python API扩展,并且可以使用GUI进行交互调整。我们在十个不同的网络上展示了竞争性能或加速性,交互式优化发现了高效网络中的新机会。
translated by 谷歌翻译
The emergence of variational quantum applications has led to the development of automatic differentiation techniques in quantum computing. Recently, Zhu et al. (PLDI 2020) have formulated differentiable quantum programming with bounded loops, providing a framework for scalable gradient calculation by quantum means for training quantum variational applications. However, promising parameterized quantum applications, e.g., quantum walk and unitary implementation, cannot be trained in the existing framework due to the natural involvement of unbounded loops. To fill in the gap, we provide the first differentiable quantum programming framework with unbounded loops, including a newly designed differentiation rule, code transformation, and their correctness proof. Technically, we introduce a randomized estimator for derivatives to deal with the infinite sum in the differentiation of unbounded loops, whose applicability in classical and probabilistic programming is also discussed. We implement our framework with Python and Q#, and demonstrate a reasonable sample efficiency. Through extensive case studies, we showcase an exciting application of our framework in automatically identifying close-to-optimal parameters for several parameterized quantum applications.
translated by 谷歌翻译
归纳逻辑编程(ILP)是一种机器学习的形式。ILP的目标是诱导推广培训示例的假设(一组逻辑规则)。随着ILP转30,我们提供了对该领域的新介绍。我们介绍了必要的逻辑符号和主要学习环境;描述ILP系统的构建块;比较几个维度的几个系统;描述四个系统(Aleph,Tilde,Aspal和Metagol);突出关键应用领域;最后,总结了未来研究的当前限制和方向。
translated by 谷歌翻译
现代大规模深度学习工作负载突出了在许多设备上并行执行的需要,以便将模型数据拟合到硬件加速器存储器中。在这些设置中,在计算期间可能需要数组再分配,但如果没有有效地完成,也可以成为瓶颈。在本文中,我们解决了在SPMD计算中重新分配多维阵列数据的问题,深度学习中最普遍的并行性形式。我们介绍了一种类型定向的方法来合成阵列再分配作为MPI式集体操作的序列。我们证明了我们的合成重新分发是内存高效的,并且不执行过多的数据传输。使用集体操作的SPMD计算的数组再分配也在XLA SPMD Partitioner的上下文中实现了一种用于跨加速器系统进行分区程序的生产级工具。我们评估我们对XLA实施的方法,并发现我们的方法提供了1.22美元的几何平均加速,最大加速度为高达5.7倍$,同时提供可提供的内存保证,使我们的系统特别吸引力 - 规模模型。
translated by 谷歌翻译
回答集编程(ASP)已成为一种流行的和相当复杂的声明问题解决方法。这是由于其具有吸引力的地址解决方案的工作流程,这是可以轻松解决问题解决的方法,即使对于计算机科学外的守护者而言。与此不同,底层技术的高度复杂性使得ASP专家越来越难以将想法付诸实践。有关解决此问题,本教程旨在使用户能够构建自己的基于ASP的系统。更确切地说,我们展示了ASP系统Clingo如何用于扩展ASP和实现定制的专用系统。为此,我们提出了两个替代方案。我们从传统的AI技术开始,并展示元编程如何用于扩展ASP。这是一种相当轻的方法,依赖于Clingo的reation特征来使用ASP本身表达新功能。与此不同,本教程的主要部分使用传统的编程(在Python中)来通过其应用程序编程接口操纵Clingo。这种方法允许改变和控制ASP的整个模型 - 地面解决工作流程。 COMENT of Clingo的新应用程序课程使我们能够通过自定义类似于Clingo中的进程来绘制Clingo的基础架构。例如,我们可能会互动到程序的抽象语法树,控制各种形式的多射击求解,并为外国推论设置理论传播者。另一种横截面结构,跨越元以及应用程序编程是Clingo的中间格式,即指定底层接地器和求解器之间的界面。我们通过示例和几个非琐碎的案例研究说明了本教程的前述概念和技术。
translated by 谷歌翻译
现代深度学习框架提供嵌入在Python中的必要的急切执行编程接口,以提供生产的开发体验。但是,深度学习从业者有时需要捕获和转换程序结构以进行性能优化,可视化,分析和硬件集成。我们研究了深度学习中使用的程序捕获和转型的不同设计。通过设计典型的深度学习用例而不是长尾部,可以为程序捕获和转换创建更简单的框架。我们在Torch.fx中应用了这一原理,是一个完全在Python写入的Pytorch的程序捕获和转换库,并通过ML从业者进行高开发人员生产力优化。我们存在案例研究,展示了Torch.fx如何实现先前在Pytorch生态系统中无法访问的工作流程。
translated by 谷歌翻译
This paper introduces corpus-guided top-down synthesis as a mechanism for synthesizing library functions that capture common functionality from a corpus of programs in a domain specific language (DSL). The algorithm builds abstractions directly from initial DSL primitives, using syntactic pattern matching of intermediate abstractions to intelligently prune the search space and guide the algorithm towards abstractions that maximally capture shared structures in the corpus. We present an implementation of the approach in a tool called Stitch and evaluate it against the state-of-the-art deductive library learning algorithm from DreamCoder. Our evaluation shows that Stitch is 3-4 orders of magnitude faster and uses 2 orders of magnitude less memory while maintaining comparable or better library quality (as measured by compressivity). We also demonstrate Stitch's scalability on corpora containing hundreds of complex programs that are intractable with prior deductive approaches and show empirically that it is robust to terminating the search procedure early -- further allowing it to scale to challenging datasets by means of early stopping.
translated by 谷歌翻译
我们提出了一个算法框架,用于近距离矩阵上的量子启发的经典算法,概括了Tang的突破性量子启发算法开始的一系列结果,用于推荐系统[STOC'19]。由量子线性代数算法和gily \'en,su,low和wiebe [stoc'19]的量子奇异值转换(SVT)框架[SVT)的动机[STOC'19],我们开发了SVT的经典算法合适的量子启发的采样假设。我们的结果提供了令人信服的证据,表明在相应的QRAM数据结构输入模型中,量子SVT不会产生指数量子加速。由于量子SVT框架基本上概括了量子线性代数的所有已知技术,因此我们的结果与先前工作的采样引理相结合,足以概括所有有关取消量子机器学习算法的最新结果。特别是,我们的经典SVT框架恢复并经常改善推荐系统,主成分分析,监督聚类,支持向量机器,低秩回归和半决赛程序解决方案的取消结果。我们还为汉密尔顿低级模拟和判别分析提供了其他取消化结果。我们的改进来自识别量子启发的输入模型的关键功能,该模型是所有先前量子启发的结果的核心:$ \ ell^2 $ -Norm采样可以及时近似于其尺寸近似矩阵产品。我们将所有主要结果减少到这一事实,使我们的简洁,独立和直观。
translated by 谷歌翻译