首页 > 最新文献

arXiv - CS - Programming Languages最新文献

英文 中文
The Semantics of Metapropramming in Prolog Prolog中的元成语语义学
Pub Date : 2024-08-14 DOI: arxiv-2408.07652
David S. Warren
This paper describes a semantics for pure Prolog programs with negation thatprovides meaning to metaprograms. Metaprograms are programs that construct anduse data structures as programs. In Prolog a primary mataprogramming constructis the use of a variable as a literal in the body of a clause. The traditionalProlog 3-line metainterpreter is another example of a metaprogram. The accountgiven here also supplies a meaning for clauses that have a variable as head,even though most Prolog systems do not support such clauses. This semanticsnaturally includes such programs, giving them their intuitive meaning. Ideas from M. Denecker and his colleagues form the basis of this approach.The key idea is to notice that if we give meanings to all propositionalprograms and treat Prolog rules with variables as the set of their groundinstances, then we can give meanings to all programs. We must treat Prologrules (which may be metarules) as templates for generating ground propositionalrules, and not as first-order formulas, which they may not be. We useparameterized inductive definitions to give propositional models to Prologprograms, in which the propositions are expressions. Then the set ofexpressions of a propositional model determine a first-order Herbrand Model,providing a first-order logical semantics for all (pure) Prolog programs,including metaprograms. We give examples to show the applicability of this theory. We alsodemonstrate how this theory makes proofs of some important properties ofmetaprograms very straightforward.
本文描述了纯 Prolog 程序的否定语义,它为元程序提供了意义。元程序是将数据结构作为程序来构造和使用的程序。在 Prolog 中,一个主要的元编程构造是在子句的主体中使用变量作为字面形式。传统的Prolog三行元解释器是元编程的另一个例子。尽管大多数 Prolog 系统都不支持以变量为首的子句,但这里给出的解释也为这种子句提供了一个含义。这种语义自然地包含了这类程序,赋予了它们直观的含义。来自德内克(M. Denecker)及其同事的想法构成了这一方法的基础。关键的想法是,如果我们给所有命题程序赋予意义,并将带有变量的 Prolog 规则视为其基础实例的集合,那么我们就能给所有程序赋予意义。我们必须把 Prolog 规则(可能是元规则)当作生成基础命题规则的模板,而不是一阶公式,因为它们可能不是一阶公式。我们使用参数化的归纳定义来给出 Prolog 程序的命题模型,其中的命题是表达式。然后,命题模型的表达式集决定了一阶 Herbrand 模型,为包括元程序在内的所有(纯)Prolog 程序提供了一阶逻辑语义。我们举例说明了这一理论的适用性。我们还演示了这一理论如何使元程序的一些重要属性的证明变得非常直接。
{"title":"The Semantics of Metapropramming in Prolog","authors":"David S. Warren","doi":"arxiv-2408.07652","DOIUrl":"https://doi.org/arxiv-2408.07652","url":null,"abstract":"This paper describes a semantics for pure Prolog programs with negation that\u0000provides meaning to metaprograms. Metaprograms are programs that construct and\u0000use data structures as programs. In Prolog a primary mataprogramming construct\u0000is the use of a variable as a literal in the body of a clause. The traditional\u0000Prolog 3-line metainterpreter is another example of a metaprogram. The account\u0000given here also supplies a meaning for clauses that have a variable as head,\u0000even though most Prolog systems do not support such clauses. This semantics\u0000naturally includes such programs, giving them their intuitive meaning. Ideas from M. Denecker and his colleagues form the basis of this approach.\u0000The key idea is to notice that if we give meanings to all propositional\u0000programs and treat Prolog rules with variables as the set of their ground\u0000instances, then we can give meanings to all programs. We must treat Prolog\u0000rules (which may be metarules) as templates for generating ground propositional\u0000rules, and not as first-order formulas, which they may not be. We use\u0000parameterized inductive definitions to give propositional models to Prolog\u0000programs, in which the propositions are expressions. Then the set of\u0000expressions of a propositional model determine a first-order Herbrand Model,\u0000providing a first-order logical semantics for all (pure) Prolog programs,\u0000including metaprograms. We give examples to show the applicability of this theory. We also\u0000demonstrate how this theory makes proofs of some important properties of\u0000metaprograms very straightforward.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179579","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Composing Automatic Differentiation with Custom Derivatives of Higher-Order Functions 用高阶函数的自定义导数组成自动微分法
Pub Date : 2024-08-14 DOI: arxiv-2408.07683
Sam Estep
Recent theoretical work on automatic differentiation (autodiff) has focusedon characteristics such as correctness and efficiency while assuming that allderivatives are automatically generated by autodiff using programtransformation, with the exception of a fixed set of derivatives for primitiveoperations. However, in practice this assumption is insufficient: theprogrammer often needs to provide custom derivatives for composite functions toachieve efficiency and numerical stability. In this work, we start from theuntyped lambda calculus with a reverse-mode autodiff operator, extend it withan operator to attach manual derivatives, and demonstrate its utility viaseveral examples.
最近关于自动微分(autodiff)的理论研究主要集中在正确性和效率等特性上,同时假设除了原始运算的一组固定导数外,所有导数都是由自动微分利用程序转换自动生成的。然而,在实践中,这一假设是不够的:程序员往往需要为复合函数提供自定义导数,以实现效率和数值稳定性。在这项工作中,我们从带有反向模式自动衍射算子的无类型 lambda 微积分出发,用一个附加手动导数的算子对其进行了扩展,并通过几个例子演示了它的实用性。
{"title":"Composing Automatic Differentiation with Custom Derivatives of Higher-Order Functions","authors":"Sam Estep","doi":"arxiv-2408.07683","DOIUrl":"https://doi.org/arxiv-2408.07683","url":null,"abstract":"Recent theoretical work on automatic differentiation (autodiff) has focused\u0000on characteristics such as correctness and efficiency while assuming that all\u0000derivatives are automatically generated by autodiff using program\u0000transformation, with the exception of a fixed set of derivatives for primitive\u0000operations. However, in practice this assumption is insufficient: the\u0000programmer often needs to provide custom derivatives for composite functions to\u0000achieve efficiency and numerical stability. In this work, we start from the\u0000untyped lambda calculus with a reverse-mode autodiff operator, extend it with\u0000an operator to attach manual derivatives, and demonstrate its utility via\u0000several examples.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179578","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Catamorphic Abstractions for Constrained Horn Clause Satisfiability 受限角句子可满足性的拟态抽象
Pub Date : 2024-08-13 DOI: arxiv-2408.06988
Emanuele De AngelisIASI-CNR, Rome, Italy, Fabio FioravantiDEc, University 'G. d'Annunzio', Chieti-Pescara, Italy, Alberto PettorossiDICII, University of Rome 'Tor Vergata', Italy, Maurizio ProiettiIASI-CNR, Rome, Italy
Catamorphisms are functions that are recursively defined on list and treesand, in general, on Algebraic Data Types (ADTs), and are often used to computesuitable abstractions of programs that manipulate ADTs. Examples ofcatamorphisms include functions that compute size of lists, orderedness oflists, and height of trees. It is well known that program properties specifiedthrough catamorphisms can be proved by showing the satisfiability of suitablesets of Constrained Horn Clauses (CHCs). We address the problem of checking thesatisfiability of those sets of CHCs, and we propose a method for transformingsets of CHCs into equisatisfiable sets where catamorphisms are no longerpresent. As a consequence, clauses with catamorphisms can be handled withoutextending the satisfiability algorithms used by existing CHC solvers. Throughan experimental evaluation on a non-trivial benchmark consisting of many listand tree processing algorithms expressed as sets of CHCs, we show that ourtechnique is indeed effective and significantly enhances the performance ofstate-of-the-art CHC solvers.
类变形是对列表和树以及一般的代数数据类型(ADT)进行递归定义的函数,通常用于计算操作 ADT 的程序的合适抽象。变形的例子包括计算列表大小、列表有序性和树高度的函数。众所周知,通过变形指定的程序属性可以通过证明约束角子句(CHC)的合适集合的可满足性来证明。我们解决了检查这些 CHCs 集的可满足性的问题,并提出了一种方法,用于将 CHCs 集转化为不再存在 catamorphism 的等可满足集。因此,我们可以在不改变现有 CHC 求解器所使用的可满足性算法的情况下,处理具有猫态性的子句。通过在一个由许多以 CHC 集表示的列表和树处理算法组成的非难基准上进行实验评估,我们证明了我们的技术确实有效,并显著提高了最先进的 CHC 求解器的性能。
{"title":"Catamorphic Abstractions for Constrained Horn Clause Satisfiability","authors":"Emanuele De AngelisIASI-CNR, Rome, Italy, Fabio FioravantiDEc, University 'G. d'Annunzio', Chieti-Pescara, Italy, Alberto PettorossiDICII, University of Rome 'Tor Vergata', Italy, Maurizio ProiettiIASI-CNR, Rome, Italy","doi":"arxiv-2408.06988","DOIUrl":"https://doi.org/arxiv-2408.06988","url":null,"abstract":"Catamorphisms are functions that are recursively defined on list and trees\u0000and, in general, on Algebraic Data Types (ADTs), and are often used to compute\u0000suitable abstractions of programs that manipulate ADTs. Examples of\u0000catamorphisms include functions that compute size of lists, orderedness of\u0000lists, and height of trees. It is well known that program properties specified\u0000through catamorphisms can be proved by showing the satisfiability of suitable\u0000sets of Constrained Horn Clauses (CHCs). We address the problem of checking the\u0000satisfiability of those sets of CHCs, and we propose a method for transforming\u0000sets of CHCs into equisatisfiable sets where catamorphisms are no longer\u0000present. As a consequence, clauses with catamorphisms can be handled without\u0000extending the satisfiability algorithms used by existing CHC solvers. Through\u0000an experimental evaluation on a non-trivial benchmark consisting of many list\u0000and tree processing algorithms expressed as sets of CHCs, we show that our\u0000technique is indeed effective and significantly enhances the performance of\u0000state-of-the-art CHC solvers.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-13","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179582","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Theorem-Carrying-Transaction: Runtime Certification to Ensure Safety for Smart Contract Transactions 定理携带交易:确保智能合约交易安全的运行时认证
Pub Date : 2024-08-12 DOI: arxiv-2408.06478
Nikolaj S. BjørnerMicrosoft Research, Ashley J. ChenNew York University Shanghai, Shuo ChenMicrosoft Research, Yang ChenMicrosoft Research, Zhongxin GuoMicrosoft Research, Tzu-Han HsuMichigan State University, Peng LiuPennsylvania State University, Nanqing LuoPennsylvania State University
Security bugs and trapdoors in smart contracts have been impacting theEthereum community since its inception. Conceptually, the 1.45-millionEthereum's contracts form a single "gigantic program" whose behaviors aredetermined by the complex reference-topology between the contracts. Can theEthereum community be assured that this gigantic program conforms to itsdesign-level safety properties, despite unforeseeable code-level intricacies?Static code verification is inadequate due to the program's gigantic scale andhigh polymorphism. In this paper, we present a viable technological roadmap forthe community toward this ambitious goal. Our technology, calledTheorem-Carrying-Transaction (TCT), combines the benefits of concrete executionand symbolic proofs. Under the TCT protocol, every transaction carries atheorem that proves its adherence to the specified properties in the invokedcontracts, and the runtime system checks the theorem before executing thetransaction. Once a property is specified in a contract, it can be treatedconfidently as an unconditional guarantee made by the contract. As casestudies, we demonstrate that TCT secures token contracts without foreseeingcode-level intricacies like integer overflow and reentrancy. TCT is alsosuccessfully applied to a Uniswap codebase, showcasing a complex decentralizedfinance (DeFi) scenario. Our prototype incurs a negligible runtime overhead,two orders of magnitude lower than a state-of-the-art approach.
自以太坊社区成立以来,智能合约中的安全漏洞和陷阱一直在影响着它。从概念上讲,以太坊的 145 万个合约组成了一个单一的 "巨型程序",其行为由合约之间复杂的参考拓扑结构决定。尽管存在不可预见的代码级错综复杂性,但以太坊社区能否确保这个巨型程序符合其设计级安全属性?在本文中,我们为业界提出了实现这一宏伟目标的可行技术路线图。我们的技术被称为定理携带事务(TCT),它结合了具体执行和符号证明的优点。在 TCT 协议下,每个事务都会携带一个定理,证明其符合所调用合约中的指定属性,运行时系统会在执行事务之前检查该定理。一旦在合同中指定了属性,就可以将其视为合同的无条件保证。通过案例研究,我们证明了 TCT 无需预见代码级的复杂性(如整数溢出和重入)就能保证令牌合约的安全。我们还将 TCT 成功应用于 Uniswap 代码库,展示了复杂的去中心化金融(DeFi)场景。我们的原型产生的运行时开销可以忽略不计,比最先进的方法低两个数量级。
{"title":"Theorem-Carrying-Transaction: Runtime Certification to Ensure Safety for Smart Contract Transactions","authors":"Nikolaj S. BjørnerMicrosoft Research, Ashley J. ChenNew York University Shanghai, Shuo ChenMicrosoft Research, Yang ChenMicrosoft Research, Zhongxin GuoMicrosoft Research, Tzu-Han HsuMichigan State University, Peng LiuPennsylvania State University, Nanqing LuoPennsylvania State University","doi":"arxiv-2408.06478","DOIUrl":"https://doi.org/arxiv-2408.06478","url":null,"abstract":"Security bugs and trapdoors in smart contracts have been impacting the\u0000Ethereum community since its inception. Conceptually, the 1.45-million\u0000Ethereum's contracts form a single \"gigantic program\" whose behaviors are\u0000determined by the complex reference-topology between the contracts. Can the\u0000Ethereum community be assured that this gigantic program conforms to its\u0000design-level safety properties, despite unforeseeable code-level intricacies?\u0000Static code verification is inadequate due to the program's gigantic scale and\u0000high polymorphism. In this paper, we present a viable technological roadmap for\u0000the community toward this ambitious goal. Our technology, called\u0000Theorem-Carrying-Transaction (TCT), combines the benefits of concrete execution\u0000and symbolic proofs. Under the TCT protocol, every transaction carries a\u0000theorem that proves its adherence to the specified properties in the invoked\u0000contracts, and the runtime system checks the theorem before executing the\u0000transaction. Once a property is specified in a contract, it can be treated\u0000confidently as an unconditional guarantee made by the contract. As case\u0000studies, we demonstrate that TCT secures token contracts without foreseeing\u0000code-level intricacies like integer overflow and reentrancy. TCT is also\u0000successfully applied to a Uniswap codebase, showcasing a complex decentralized\u0000finance (DeFi) scenario. Our prototype incurs a negligible runtime overhead,\u0000two orders of magnitude lower than a state-of-the-art approach.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179580","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Syntax-Guided Automated Program Repair for Hyperproperties 语法引导的超属性自动程序修复
Pub Date : 2024-08-12 DOI: arxiv-2408.06035
Raven Beutner, Tzu-Han Hsu, Borzoo Bonakdarpour, Bernd Finkbeiner
We study the problem of automatically repairing infinite-state softwareprograms w.r.t. temporal hyperproperties. As a first step, we present a repairapproach for the temporal logic HyperLTL based on symbolic execution,constraint generation, and syntax-guided synthesis of repair expression(SyGuS). To improve the repair quality, we introduce the notation of atransparent repair that aims to find a patch that is as close as possible tothe original program. As a practical realization, we develop an iterativerepair approach. Here, we search for a sequence of repairs that are closer andcloser to the original program's behavior. We implement our method in aprototype and report on encouraging experimental results using off-the-shelfSyGuS solvers.
我们研究了根据时态超属性自动修复无限态软件程序的问题。首先,我们提出了一种基于符号执行、约束生成和语法引导的修复表达式合成(SyGuS)的时态逻辑 HyperLTL 的修复方法。为了提高修复质量,我们引入了透明修复的概念,目的是找到一个尽可能接近原始程序的补丁。在实际应用中,我们开发了一种迭代修复方法。在这里,我们寻找一连串越来越接近原始程序行为的修补程序。我们在一个原型中实现了我们的方法,并报告了使用现成SyGuS求解器取得的令人鼓舞的实验结果。
{"title":"Syntax-Guided Automated Program Repair for Hyperproperties","authors":"Raven Beutner, Tzu-Han Hsu, Borzoo Bonakdarpour, Bernd Finkbeiner","doi":"arxiv-2408.06035","DOIUrl":"https://doi.org/arxiv-2408.06035","url":null,"abstract":"We study the problem of automatically repairing infinite-state software\u0000programs w.r.t. temporal hyperproperties. As a first step, we present a repair\u0000approach for the temporal logic HyperLTL based on symbolic execution,\u0000constraint generation, and syntax-guided synthesis of repair expression\u0000(SyGuS). To improve the repair quality, we introduce the notation of a\u0000transparent repair that aims to find a patch that is as close as possible to\u0000the original program. As a practical realization, we develop an iterative\u0000repair approach. Here, we search for a sequence of repairs that are closer and\u0000closer to the original program's behavior. We implement our method in a\u0000prototype and report on encouraging experimental results using off-the-shelf\u0000SyGuS solvers.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-12","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"142179581","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Modelling Probabilistic FPC in Guarded Type Theory 在守护类型理论中模拟概率 FPC
Pub Date : 2024-08-08 DOI: arxiv-2408.04455
Philipp Jan Andries Stassen, Rasmus Ejlers Møgelberg, Maaike Zwart, Alejandro Aguirre, Lars Birkedal
Constructive type theory combines logic and programming in one language. Thisis useful both for reasoning about programs written in type theory, as well asfor reasoning about other programming languages inside type theory. It iswell-known that it is challenging to extend these applications to languageswith recursion and computational effects such as probabilistic choice, becausethese features are not easily represented in constructive type theory. We showhow to define and reason about a programming language with probabilistic choiceand recursive types, in guarded type theory. We use higher inductive types torepresent finite distributions and guarded recursion to model recursion. Wedefine both operational and denotational semantics, as well as a relationbetween the two. The relation can be used to prove adequacy, but we also showhow to use it to reason about programs up to contextual equivalence. To thebest of our knowledge, this is the first model of a programming language withprobabilistic choice and recursive types in a constructive type theory.
构造型理论将逻辑和编程结合在一种语言中。这既有助于推理用类型理论编写的程序,也有助于推理类型理论中的其他编程语言。众所周知,将这些应用扩展到具有递归和计算效应(如概率选择)的语言是一项挑战,因为这些特征在构造类型论中不易表示。我们展示了如何在防护类型理论中定义和推理具有概率选择和递归类型的编程语言。我们用高级归纳类型来表示有限分布,用保护递归来模拟递归。我们定义了操作语义和指称语义,以及两者之间的关系。这种关系可以用来证明充分性,但我们也展示了如何用它来推理程序,直至上下文等价。据我们所知,这是第一个在构造型理论中使用概率选择和递归类型的编程语言模型。
{"title":"Modelling Probabilistic FPC in Guarded Type Theory","authors":"Philipp Jan Andries Stassen, Rasmus Ejlers Møgelberg, Maaike Zwart, Alejandro Aguirre, Lars Birkedal","doi":"arxiv-2408.04455","DOIUrl":"https://doi.org/arxiv-2408.04455","url":null,"abstract":"Constructive type theory combines logic and programming in one language. This\u0000is useful both for reasoning about programs written in type theory, as well as\u0000for reasoning about other programming languages inside type theory. It is\u0000well-known that it is challenging to extend these applications to languages\u0000with recursion and computational effects such as probabilistic choice, because\u0000these features are not easily represented in constructive type theory. We show\u0000how to define and reason about a programming language with probabilistic choice\u0000and recursive types, in guarded type theory. We use higher inductive types to\u0000represent finite distributions and guarded recursion to model recursion. We\u0000define both operational and denotational semantics, as well as a relation\u0000between the two. The relation can be used to prove adequacy, but we also show\u0000how to use it to reason about programs up to contextual equivalence. To the\u0000best of our knowledge, this is the first model of a programming language with\u0000probabilistic choice and recursive types in a constructive type theory.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-08","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141941288","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Combining Neural Architecture Search and Automatic Code Optimization: A Survey 神经架构搜索与自动代码优化的结合:调查
Pub Date : 2024-08-07 DOI: arxiv-2408.04116
Inas Bachiri, Hadjer Benmeziane, Smail Niar, Riyadh Baghdadi, Hamza Ouarnoughi, Abdelkrime Aries
Deep Learning models have experienced exponential growth in complexity andresource demands in recent years. Accelerating these models for efficientexecution on resource-constrained devices has become more crucial than ever.Two notable techniques employed to achieve this goal are Hardware-aware NeuralArchitecture Search (HW-NAS) and Automatic Code Optimization (ACO). HW-NASautomatically designs accurate yet hardware-friendly neural networks, while ACOinvolves searching for the best compiler optimizations to apply on neuralnetworks for efficient mapping and inference on the target hardware. Thissurvey explores recent works that combine these two techniques within a singleframework. We present the fundamental principles of both domains anddemonstrate their sub-optimality when performed independently. We theninvestigate their integration into a joint optimization process that we callHardware Aware-Neural Architecture and Compiler Optimizations co-Search(NACOS).
近年来,深度学习模型的复杂性和资源需求呈指数级增长。为实现这一目标,我们采用了两种著名的技术:硬件感知神经架构搜索(HW-NAS)和自动代码优化(ACO)。HW-NAS 自动设计精确且硬件友好的神经网络,而 ACO 则涉及搜索最佳编译器优化,以应用于神经网络,从而在目标硬件上实现高效映射和推理。本研究探讨了将这两种技术结合到单一框架中的最新研究成果。我们介绍了这两个领域的基本原理,并展示了它们在独立运行时的次优化性。然后,我们研究了将这两种技术整合到一个联合优化过程中的方法,我们称之为 "硬件感知-神经架构和编译器优化联合搜索(NACOS)"。
{"title":"Combining Neural Architecture Search and Automatic Code Optimization: A Survey","authors":"Inas Bachiri, Hadjer Benmeziane, Smail Niar, Riyadh Baghdadi, Hamza Ouarnoughi, Abdelkrime Aries","doi":"arxiv-2408.04116","DOIUrl":"https://doi.org/arxiv-2408.04116","url":null,"abstract":"Deep Learning models have experienced exponential growth in complexity and\u0000resource demands in recent years. Accelerating these models for efficient\u0000execution on resource-constrained devices has become more crucial than ever.\u0000Two notable techniques employed to achieve this goal are Hardware-aware Neural\u0000Architecture Search (HW-NAS) and Automatic Code Optimization (ACO). HW-NAS\u0000automatically designs accurate yet hardware-friendly neural networks, while ACO\u0000involves searching for the best compiler optimizations to apply on neural\u0000networks for efficient mapping and inference on the target hardware. This\u0000survey explores recent works that combine these two techniques within a single\u0000framework. We present the fundamental principles of both domains and\u0000demonstrate their sub-optimality when performed independently. We then\u0000investigate their integration into a joint optimization process that we call\u0000Hardware Aware-Neural Architecture and Compiler Optimizations co-Search\u0000(NACOS).","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141941289","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
Synthesizing Abstract Transformers for Reduced-Product Domains 为还原产品领域合成抽象变压器
Pub Date : 2024-08-07 DOI: arxiv-2408.04040
Pankaj Kumar Kalita, Thomas Reps, Subhajit Roy
Recently, we showed how to apply program-synthesis techniques to createabstract transformers in a user-provided domain-specific language (DSL) L(i.e., ''L-transformers"). However, we found that the algorithm of Kalita etal. does not succeed when applied to reduced-product domains: the need tosynthesize transformers for all of the domains simultaneously blows up thesearch space. Because reduced-product domains are an important device for improving theprecision of abstract interpretation, in this paper, we propose an algorithm tosynthesize reduced L-transformers $langle f_1^{sharp R}, f_2^{sharp R},...,f_n^{sharp R}rangle$ for a product domain $A_1 times A_2 times ldotstimes A_n$ , using multiple DSLs: $mathcal{L} = langle mathcal{L}_1 ,mathcal{L}_2, ... , mathcal{L}_n rangle$. Synthesis of reduced-producttransformers is quite challenging: first, the synthesis task has to tackle anincreased ''feature set" because each component transformer now has access tothe abstract inputs from all component domains in the product. Second, toensure that the product transformer is maximally precise, the synthesis taskneeds to arrange for the component transformers to cooperate with each other. We implemented our algorithm in a tool, Amurth2, and used it to synthesizeabstract transformers for two product domains -- SAFE and JSAI -- availablewithin the SAFEstr framework for JavaScript program analysis. For four of thesix operations supported by SAFEstr, Amurth2 synthesizes more precise abstracttransformers than the manually written ones available in SAFEstr.
最近,我们展示了如何应用程序合成技术,在用户提供的特定领域语言(DSL)L 中创建抽象变换器(即 "L-变换器")。然而,我们发现,Kalita 等人的算法在应用于减积域时并不成功:因为需要同时合成所有域的变换器,这就压缩了arch 空间。因为还原积域是提高抽象解释精确度的重要工具,所以在本文中,我们提出了一种算法,使用多个 DSL 为积域 $A_1 times A_2 times ldotstimes A_n$ 合成还原 L 变换器 $langle f_1^{sharp R}, f_2^{sharp R},...,f_n^{sharp R}rangle$ :$mathcal{L} = langle mathcal{L}_1 ,mathcal{L}_2, ..., mathcal{L}_n rangle$。简化产品变换器的合成具有相当大的挑战性:首先,合成任务必须处理增加的 "特征集",因为每个组件变换器现在都可以访问产品中所有组件域的抽象输入。其次,为了确保产品变换器达到最高精度,合成任务需要安排组件变换器相互合作。我们在 Amurth2 工具中实现了我们的算法,并用它合成了两个产品域(SAFE 和 JSAI)的抽象变换器,这两个产品域可在用于 JavaScript 程序分析的 SAFEstr 框架中找到。对于SAFEstr支持的六种操作中的四种,Amurth2合成的抽象变换器比SAFEstr中手动编写的更为精确。
{"title":"Synthesizing Abstract Transformers for Reduced-Product Domains","authors":"Pankaj Kumar Kalita, Thomas Reps, Subhajit Roy","doi":"arxiv-2408.04040","DOIUrl":"https://doi.org/arxiv-2408.04040","url":null,"abstract":"Recently, we showed how to apply program-synthesis techniques to create\u0000abstract transformers in a user-provided domain-specific language (DSL) L\u0000(i.e., ''L-transformers\"). However, we found that the algorithm of Kalita et\u0000al. does not succeed when applied to reduced-product domains: the need to\u0000synthesize transformers for all of the domains simultaneously blows up the\u0000search space. Because reduced-product domains are an important device for improving the\u0000precision of abstract interpretation, in this paper, we propose an algorithm to\u0000synthesize reduced L-transformers $langle f_1^{sharp R}, f_2^{sharp R},...,\u0000f_n^{sharp R}rangle$ for a product domain $A_1 times A_2 times ldots\u0000times A_n$ , using multiple DSLs: $mathcal{L} = langle mathcal{L}_1 ,\u0000mathcal{L}_2, ... , mathcal{L}_n rangle$. Synthesis of reduced-product\u0000transformers is quite challenging: first, the synthesis task has to tackle an\u0000increased ''feature set\" because each component transformer now has access to\u0000the abstract inputs from all component domains in the product. Second, to\u0000ensure that the product transformer is maximally precise, the synthesis task\u0000needs to arrange for the component transformers to cooperate with each other. We implemented our algorithm in a tool, Amurth2, and used it to synthesize\u0000abstract transformers for two product domains -- SAFE and JSAI -- available\u0000within the SAFEstr framework for JavaScript program analysis. For four of the\u0000six operations supported by SAFEstr, Amurth2 synthesizes more precise abstract\u0000transformers than the manually written ones available in SAFEstr.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141941293","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
PolyHorn: A Polynomial Horn Clause Solver PolyHorn:多项式角条款求解器
Pub Date : 2024-08-07 DOI: arxiv-2408.03796
Krishnendu Chatterjee, Amir Kafshdar Goharshady, Ehsan Kafshdar Goharshady, Mehrdad Karrabi, Milad Saadat, Đorđe Žikelić
Polynomial Horn clauses with existentially and universally quantifiedvariables arise in many problems of verification and program analysis. Wepresent PolyHorn which is a tool for solving polynomial Horn clauses in whichvariables on both sides of the implication are real valued. Our tool provides aunified framework for polynomial Horn clause solving problems that arise inseveral papers in the literature. Our experimental evaluation over a wide rangeof benchmarks show the applicability of the tool as well as its benefits asopposed to simply using existing SMT solvers to solve such constraints.
在许多验证和程序分析问题中,都会出现存在和普遍量化变量的多项式 Horn 子句。我们提出的 PolyHorn 是一种解决多项式 Horn 子句的工具,其中蕴涵的两边变量都是实值。我们的工具为文献中出现的多项式 Horn 子句求解问题提供了一个统一的框架。我们在大量基准上进行的实验评估表明了该工具的适用性,以及与简单使用现有 SMT 求解器求解此类约束相比的优势。
{"title":"PolyHorn: A Polynomial Horn Clause Solver","authors":"Krishnendu Chatterjee, Amir Kafshdar Goharshady, Ehsan Kafshdar Goharshady, Mehrdad Karrabi, Milad Saadat, Đorđe Žikelić","doi":"arxiv-2408.03796","DOIUrl":"https://doi.org/arxiv-2408.03796","url":null,"abstract":"Polynomial Horn clauses with existentially and universally quantified\u0000variables arise in many problems of verification and program analysis. We\u0000present PolyHorn which is a tool for solving polynomial Horn clauses in which\u0000variables on both sides of the implication are real valued. Our tool provides a\u0000unified framework for polynomial Horn clause solving problems that arise in\u0000several papers in the literature. Our experimental evaluation over a wide range\u0000of benchmarks show the applicability of the tool as well as its benefits as\u0000opposed to simply using existing SMT solvers to solve such constraints.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141941290","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
LLM-Aided Compilation for Tensor Accelerators 张量加速器的 LLM 辅助编译
Pub Date : 2024-08-06 DOI: arxiv-2408.03408
Charles Hong, Sahil Bhatia, Altan Haan, Shengjun Kris Dong, Dima Nikiforov, Alvin Cheung, Yakun Sophia Shao
Hardware accelerators, in particular accelerators for tensor processing, havemany potential application domains. However, they currently lack the softwareinfrastructure to support the majority of domains outside of deep learning.Furthermore, a compiler that can easily be updated to reflect changes at bothapplication and hardware levels would enable more agile development and designspace exploration of accelerators, allowing hardware designers to realizecloser-to-optimal performance. In this work, we discuss how large languagemodels (LLMs) could be leveraged to build such a compiler. Specifically, wedemonstrate the ability of GPT-4 to achieve high pass rates in translating codeto the Gemmini accelerator, and prototype a technique for decomposingtranslation into smaller, more LLM-friendly steps. Additionally, we propose a2-phase workflow for utilizing LLMs to generate hardware-optimized code.
硬件加速器,特别是用于张量处理的加速器,有许多潜在的应用领域。此外,一个可以轻松更新以反映应用和硬件层面变化的编译器,将使加速器的开发和设计空间探索更加灵活,从而让硬件设计人员实现更接近最优的性能。在这项工作中,我们讨论了如何利用大型语言模型(LLM)来构建这样的编译器。具体来说,我们演示了 GPT-4 在将代码翻译到 Gemmini 加速器时实现高通过率的能力,并展示了一种将翻译分解为更小、对 LLM 更友好的步骤的技术原型。此外,我们还提出了利用 LLM 生成硬件优化代码的两阶段工作流程。
{"title":"LLM-Aided Compilation for Tensor Accelerators","authors":"Charles Hong, Sahil Bhatia, Altan Haan, Shengjun Kris Dong, Dima Nikiforov, Alvin Cheung, Yakun Sophia Shao","doi":"arxiv-2408.03408","DOIUrl":"https://doi.org/arxiv-2408.03408","url":null,"abstract":"Hardware accelerators, in particular accelerators for tensor processing, have\u0000many potential application domains. However, they currently lack the software\u0000infrastructure to support the majority of domains outside of deep learning.\u0000Furthermore, a compiler that can easily be updated to reflect changes at both\u0000application and hardware levels would enable more agile development and design\u0000space exploration of accelerators, allowing hardware designers to realize\u0000closer-to-optimal performance. In this work, we discuss how large language\u0000models (LLMs) could be leveraged to build such a compiler. Specifically, we\u0000demonstrate the ability of GPT-4 to achieve high pass rates in translating code\u0000to the Gemmini accelerator, and prototype a technique for decomposing\u0000translation into smaller, more LLM-friendly steps. Additionally, we propose a\u00002-phase workflow for utilizing LLMs to generate hardware-optimized code.","PeriodicalId":501197,"journal":{"name":"arXiv - CS - Programming Languages","volume":null,"pages":null},"PeriodicalIF":0.0,"publicationDate":"2024-08-06","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"141941292","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}
引用次数: 0
期刊
arXiv - CS - Programming Languages
全部 Acc. Chem. Res. ACS Applied Bio Materials ACS Appl. Electron. Mater. ACS Appl. Energy Mater. ACS Appl. Mater. Interfaces ACS Appl. Nano Mater. ACS Appl. Polym. Mater. ACS BIOMATER-SCI ENG ACS Catal. ACS Cent. Sci. ACS Chem. Biol. ACS Chemical Health & Safety ACS Chem. Neurosci. ACS Comb. Sci. ACS Earth Space Chem. ACS Energy Lett. ACS Infect. Dis. ACS Macro Lett. ACS Mater. Lett. ACS Med. Chem. Lett. ACS Nano ACS Omega ACS Photonics ACS Sens. ACS Sustainable Chem. Eng. ACS Synth. Biol. Anal. Chem. BIOCHEMISTRY-US Bioconjugate Chem. BIOMACROMOLECULES Chem. Res. Toxicol. Chem. Rev. Chem. Mater. CRYST GROWTH DES ENERG FUEL Environ. Sci. Technol. Environ. Sci. Technol. Lett. Eur. J. Inorg. Chem. IND ENG CHEM RES Inorg. Chem. J. Agric. Food. Chem. J. Chem. Eng. Data J. Chem. Educ. J. Chem. Inf. Model. J. Chem. Theory Comput. J. Med. Chem. J. Nat. Prod. J PROTEOME RES J. Am. Chem. Soc. LANGMUIR MACROMOLECULES Mol. Pharmaceutics Nano Lett. Org. Lett. ORG PROCESS RES DEV ORGANOMETALLICS J. Org. Chem. J. Phys. Chem. J. Phys. Chem. A J. Phys. Chem. B J. Phys. Chem. C J. Phys. Chem. Lett. Analyst Anal. Methods Biomater. Sci. Catal. Sci. Technol. Chem. Commun. Chem. Soc. Rev. CHEM EDUC RES PRACT CRYSTENGCOMM Dalton Trans. Energy Environ. Sci. ENVIRON SCI-NANO ENVIRON SCI-PROC IMP ENVIRON SCI-WAT RES Faraday Discuss. Food Funct. Green Chem. Inorg. Chem. Front. Integr. Biol. J. Anal. At. Spectrom. J. Mater. Chem. A J. Mater. Chem. B J. Mater. Chem. C Lab Chip Mater. Chem. Front. Mater. Horiz. MEDCHEMCOMM Metallomics Mol. Biosyst. Mol. Syst. Des. Eng. Nanoscale Nanoscale Horiz. Nat. Prod. Rep. New J. Chem. Org. Biomol. Chem. Org. Chem. Front. PHOTOCH PHOTOBIO SCI PCCP Polym. Chem.
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
0
微信
客服QQ
Book学术公众号 扫码关注我们
反馈
×
意见反馈
请填写您的意见或建议
请填写您的手机或邮箱
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
现在去查看 取消
×
提示
确定
Book学术官方微信
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术
文献互助 智能选刊 最新文献 互助须知 联系我们:info@booksci.cn
Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。
Copyright © 2023 Book学术 All rights reserved.
ghs 京公网安备 11010802042870号 京ICP备2023020795号-1