Lines Matching refs:MLIR

1 # MLIR: Incremental Application to Graph Algorithms in ML Frameworks
3 The existing documentation about MLIR focuses on long term vision, how its
10 This document explains that adoption of MLIR to solve graph based problems
15 One note: even though a major advantage of MLIR is that it can span the full
17 focuses on the use of MLIR for **graph-level algorithms**. MLIR will also unlock
20 MLIR's relationship to XLA, Eigen, etc, are out of scope for this particular
26 MLIR in the future.
28 ### How is MLIR relevant?
30 MLIR is an overloaded acronym which unpacks as "Multi-Level Intermediate
44 MLIR infrastructure, but that isn't a focus of this doc.))
46 A key observation that MLIR makes is that these subsystems often have two things
52 MLIR uses a standard IR (i.e., a set of data structures) for representing these
54 problem domains. MLIR then allows the definition of domain-specific "dialects"
61 MLIR's design is directly informed by the experience of building (and then
75 we use those as examples to concretely describe the benefits that MLIR provides
84 the future, and would definitely benefit from the MLIR framework, but there
88 Adopting MLIR for these works the same way - and, in fact, the work to support
94 MLIR supports converting from TensorFlow Graphs to MLIR and back, which means
95 that we can start by putting in a no-op translation to MLIR and back into the
101 uses MLIR for a single pass. In practice, we'll have the MLIR flag gated under
106 ## What benefit does MLIR provide?
113 of the benefits that MLIR provides, in no particular order:
117 The MLIR in-memory data structure has a human readable and writable format, as
120 compact, easy to read, and lossless. You can dump an MLIR program out to disk
130 Like many other popular compiler infrastructures, MLIR provides infrastructure
132 MLIR verifier is a simple framework that makes it easy to provide a single
142 While MLIR provides a well-considered infrastructure for IR verification, and
148 There are many aspects of this in MLIR, but we'll focus on compiler
178 MLIR has been pervasively designed with this sort of design by testability,
186 MLIR benefits from the lessons learned from building other compilers - including
190 experience (and fixing mistakes in LLVM), MLIR requires that operations and
203 that it is easy to write good tests for this: the testing tools for MLIR capture
224 Note that a major limitation of this is that MLIR suffers from a problem of
225 "garbage in, garbage out": if the input locations to MLIR are imprecise, then
241 The [MLIR Tensor Type](../Dialects/Builtin.md/#rankedtensortype) directly
282 One of our major goals for the TensorFlow dialect of MLIR is to sort out these
288 or important for MLIR to succeed (because of its "meta" nature, the abstraction
291 expect these issues to get nailed down in the next couple of months when MLIR
297 A minor-in-theory, but important-in-practice point is that MLIR is designed to
308 lots of ideas about further improvements in the future, we are happy that MLIR
314 MLIR has been designed to be memory and compile-time efficient in its algorithms
317 allocations, and allow simple and safe multithreaded optimization of MLIR
318 programs. There are other reasons to believe that the MLIR implementations of
331 ### Isn't MLIR a big dependency to take on?
333 We've heard that at least some people are concerned that MLIR is a "big"
335 points MLIR:
337 1. The entire MLIR codebase is a pretty small C++ code base in absolute terms
339 1. Like LLVM, MLIR is designed as a set of libraries that clients can link in
340 or ignore as they wish. For example, the transformations in MLIR kept
346 1. MLIR's only third party dependency is on LLVM, but it doesn't depend on LLVM
352 great for MLIR as well as other LLVM subprojects.
353 1. TensorFlow and many other frameworks already use LLVM - if so, MLIR would
356 ### How does MLIR represent {control flow, concurrency, …} semantics in TensorFlow?
358 MLIR provides a dialect that is an isomorphic 1-1 mapping between TensorFlow
359 graphs and MLIR, as well as a pretty complete translator back and forth (the
360 only known gap is that a few TF_DataType enums aren't handled yet). MLIR is a
366 raise the abstraction level for working with TensorFlow graphs in MLIR. Doing so
369 world. For example, because MLIR has an extensible type system, we can directly
384 * How should MLIR represent async vs sync operations, what invariants are
392 "Multi-Level" part of MLIR) because doing so will make it much much easier to
397 It is important to point out things that MLIR does not aim to do. For example,
398 there is no runtime component to MLIR: the TensorFlow executor, the TF Lite
401 Another non-goal is that MLIR currently doesn't support a stable binary