This paper discusses our proposal and implementation of Distill, a domain-specific compilation tool based on LLVM to accelerate cognitive models. Cognitive models explain the process of cognitive function and offer a path to human-like artificial intelligence. However, cognitive modeling is laborious, requiring composition of many types of computational tasks, and suffers from poor performance as it relies on high-level languages like Python. In order to continue enjoying the flexibility of Python while achieving high performance, Distill uses domain-specific knowledge to compile Python-based cognitive models into LLVM IR, carefully stripping away features like dynamic typing and memory management that add overheads to the actual model. As we show, this permits significantly faster model execution. We also show that the code so generated enables using classical compiler data flow analysis passes to reveal properties about data flow in cognitive models that are useful to cognitive scientists. Distill is publicly available, is being used by researchers in cognitive science, and has led to patches that are currently being evaluated for integration into mainline LLVM.
翻译:本文讨论我们的提议和实施“蒸馏”这一基于LLVM的域名汇编工具,以加速认知模型。认知模型解释认知功能的过程,并提供人类类人工智能的途径。然而,认知模型是艰巨的,需要多种计算任务的组成,而且由于依赖Python等高层次语言,工作表现不佳。为了继续享有Python的灵活性,同时取得高性能,蒸馏利用域名特定知识将基于Python的认知模型编集成LLLVM IR, 仔细去除动态打字和记忆管理等功能,这些功能为实际模型添加了间接费用。正如我们所显示的那样,这可以大大加快模型执行速度。我们还表明,生成的代码有助于使用古典编纂数据流分析,以揭示对认知科学家有用的认知模型中数据流的属性。 蒸馏正在公开提供,研究人员正在使用,并导致目前正在被评估的补齐,以便纳入LLLVM主线。