commit | ab3c0ac54166fa953ddcde846689393d6b9635a5 | [log] [tgz] |
---|---|---|
author | Stella Laurenzo <stellaraccident@gmail.com> | Thu Sep 02 21:44:49 2021 -0700 |
committer | GitHub <noreply@github.com> | Thu Sep 02 21:44:49 2021 -0700 |
tree | d244e311afc59e50c16a84e3f2450e5c1d221498 | |
parent | 406e3976003e567a748ad1fb48d63e0982688f2a [diff] |
Initial commit: Add new iree_pydm dialect and supporting code to compile to it. (#6907) * Initial commit: Add new iree_pydm dialect and supporting code to compile to it. * Short for "python data-model", which is the closest thing to an authoritative spec as exists. * Attempts to be a faithful modeling of Python (currently incomplete) which also has been engineered to be realized on the IREE VM. * Aim is for Python program extraction which can preserve full generality while also benefiting (greatly) from any present type information. * Trying to be a counter-balance to previous approaches which tended to make "not quite Python" uncanny valleys: it will be a while before this is complete but it attempts to model the dynamism of the language. * Inspired by my previous work on npcomp but a complete rewrite with lessons learned incorporated. Conceptually builds on the npcomp version in several key ways: * Models the Python type system with both generality and specialization in mind (npcomp required specialization just making a "not quite Python"). * Leverages knowledge of the types and constraints of the IREE VM, paying attention to having an IR which should lower without much fuss. * Aims to be self-contained, not mixing and matching unrelated MLIR dialects and types (currently just incorporates parts of SCF and CFG operations). * More general Python importer bridge, with an interop model based on intrinsics and supporting a runtime library largely authored in the language itself. * Implements general flow control. * I am landing this here, as an IREE public dialect because: * It is already setup for other LLVM projects to take a source dep on it (allowing others to compile their Python DSLs to IREE). NPComp already does this. * This is the only place that also allows the IREE compiler to lower it to run on its VM. * It is already plumbed through to IREE's (new) public C and Python compiler API distributables. * There are three forks of work from here: 1. Finish modeling the dialect and importer (needs for/while support, type/op support for containers and iterators). 2. Implement first pass source dialect optimizations, namely type propagation, and simplification away from dynamic forms where possible. 3. Lowerings to IREE VM. The types and ops are laid out so that this can hopefully be a mostly 1:1, relatively simple lowering. * I expect getting everything to connect is roughly a week of coding on each category. * Requires upstream: https://reviews.llvm.org/D108898
IREE (Intermediate Representation Execution Environment, pronounced as “eerie”) is an MLIR-based end-to-end compiler and runtime that lowers Machine Learning (ML) models to a unified IR that scales up to meet the needs of the datacenter and down to satisfy the constraints and special considerations of mobile and edge deployments.
See our website for project details, user guides, and instructions on building from source.
IREE is still in its early phase. We have settled down on the overarching infrastructure and are actively improving various software components as well as project logistics. It is still quite far from ready for everyday use and is made available without any support at the moment. With that said, we welcome any kind of feedback on any communication channels!
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.