<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hi, Chris, et al.,</p>
<p>I support adding MLIR as an LLVM subproject. Here are my thoughts:</p>
<p> 1. MLIR uses LLVM. LLVM is one of the MLIR dialects, MLIR is compiler infrastructure, and it fits as a natural part of our ecosystem.</p>
<p> 2. As a community, we have a lot of different LLVM frontends, many of which have their own IRs on which higher-level transformations are performed. We don't currently offer much, in terms of infrastructure, to support the development of these pre-LLVM transformations.
MLIR provides a base on which many of these kinds of implementations can be constructed, and I believe that will add value to the overall ecosystem.
<br>
</p>
<p> 3. As a specific example of the above, the current development of the new Flang compiler depends on MLIR. Flang is becoming a subproject of LLVM and MLIR should be part of LLVM.</p>
<p> 4. The MLIR project has developed capabilities, such as for the analysis of multidimensional loops, that can be moved into LLVM and used by both LLVM- and MLIR-level transformations. As we work to improve LLVM's capabilities in loop optimizations, leveraging
continuing work to improve MLIR's loop capabilities in LLVM as well will benefit many of us.</p>
<p> 5. As a community, we have been moving toward increasing support for heterogeneous computing and accelerators (and given industry trends, I expect this to continue), and MLIR can facilitate that support in many cases (although I expect we'll see further
enhancements in the core LLVM libraries as well).</p>
<p>That all having been said, I think that it's going to be very important to develop some documentation on how a frontend author looking to use LLVM backend technology, and a developer looking to implement different kinds of functionality, might reasonably
choose whether to target or enhance MLIR components, LLVM components, or both. I expect that this kind of advice will evolve over time, but I'm sure we'll need it sooner rather than later.</p>
<p>Thanks again,</p>
<p>Hal<br>
</p>
<div class="moz-cite-prefix">On 9/9/19 10:30 AM, Chris Lattner via llvm-dev wrote:<br>
</div>
<blockquote type="cite" cite="mid:3A65525F-82CA-403B-8F17-4C65C39970BB@google.com">
Hi all,<br class="">
<br class="">
The TensorFlow team at Google has been leading the charge to build a new set of compiler infrastructure, known as the <a href="https://github.com/tensorflow/mlir" class="" moz-do-not-send="true">MLIR project</a>. The initial focus has been on machine learning
infrastructure, high performance accelerators, heterogeneous compute, and HPC-style computations. That said, the implementation and design of this infrastructure is state of the art, is not specific to these applications, and is already being adopted (e.g.)
by <a href="https://llvm.org/devmtg/2019-10/talk-abstracts.html#tech19" class="" moz-do-not-send="true">the Flang compiler</a>. If you are interested in learning more about MLIR and the technical design, I’d encourage you to look at the MLIR Keynote and Tutorial
at the last <a href="http://llvm.org/devmtg/2019-04/" class="" moz-do-not-send="true">LLVM Developer Meeting</a>.<br class="">
<br class="">
MLIR is already <a href="https://medium.com/tensorflow/mlir-a-new-intermediate-representation-and-compiler-framework-beba999ed18d" class="" moz-do-not-send="true">open source on GitHub</a>, and includes a significant amount of code in two repositories. “MLIR
Core” is located in <a href="https://github.com/tensorflow/mlir" class="" moz-do-not-send="true">github/tensorflow/mlir</a>, including an application independent IR, the code generation infrastructure, common graph transformation infrastructure, declarative
operation definition and rewrite infrastructure, polyhedral transformations etc. The primary TensorFlow repository at <a href="https://github.com/tensorflow/tensorflow/" class="" moz-do-not-send="true">github/tensorflow/tensorflow</a> contains TensorFlow-specific
functionality built using MLIR Core infrastructure.<br class="">
<br class="">
In discussions with a <a href="https://blog.google/technology/ai/mlir-accelerating-ai-open-source-infrastructure/" class="" moz-do-not-send="true">large number of industry partners</a>, we’ve achieved consensus that it would be best to build a shared ML compiler
infrastructure under a common umbrella with well known neutral governance. As such, we’d like to propose that MLIR Core join the non-profit LLVM Foundation as a new subproject! We plan to follow the <a href="http://llvm.org/docs/DeveloperPolicy.html" class="" moz-do-not-send="true">LLVM
Developer Policy</a>, and have been following an LLVM-style development process from the beginning - including all relevant coding and testing styles, and we build on core LLVM infrastructure pervasively.<br class="">
<br class="">
We think that MLIR is a nice complement to existing LLVM functionality, providing common infrastructure for higher level optimization and transformation problems, and dovetails naturally with LLVM IR optimizations and code generation. Please let us know if
you have any thoughts, questions, or concerns!<br class="">
<br class="">
-Chris<br class="">
<br class="">
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<pre class="moz-quote-pre" wrap="">_______________________________________________
LLVM Developers mailing list
<a class="moz-txt-link-abbreviated" href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>
<a class="moz-txt-link-freetext" href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a>
</pre>
</blockquote>
<pre class="moz-signature" cols="72">--
Hal Finkel
Lead, Compiler Technology and Programming Languages
Leadership Computing Facility
Argonne National Laboratory</pre>
</body>
</html>