References

The official MLIR documentation:
https://mlir.llvm.org/docs

Some useful MLIR tutorials:
https://mlir.llvm.org/docs/Tutorials/

Simplified overview of the code generation capabilities available in MLIR:
https://discourse.llvm.org/t/codegen-dialect-overview

Linalg is one of the most fundamental dialects in MLIR and IREE:
https://iree.dev/community/blog/2024-01-29-iree-mlir-linalg-tutorial/#iree-mlir-linalg-tutorial

A real full-fledged course on compiler technology:
https://www.cs.cornell.edu/courses/cs6120/2020fa/self-guided/

Glossary

dialect
: dialects are the mechanism used in MLIR to define new attributes, operations, and types
and allow to model different levels of abstractions in an uniform way in the same IR\
https://mlir.llvm.org/docs/LangRef/#dialects
IR
: Intermediate Representation
IREE
: Intermediate Representation Execution Environment, based on MLIR\
https://iree.dev
LLVM
: originally an acronym for Low Level Virtual Machine, it has broadened in scope and
is now a toolkit for building compilers\
https://en.wikipedia.org/wiki/LLVM
lower
: in compiler technology to lower means to rewrite complex operations in term of simpler ones
HW API
: Application Programming Interface to create binary code for the Torq HW.
This API provides a more abstract interface than accessing HW registers directly.
kernel
: in this context the code that implements a given layer or operation in a model. The words
kernel, layer and operation are often used as synonims.
ML
: Machine Learning
MLIR
: Multi-Level Intermediate Representation project, based on LLVM\
https://mlir.llvm.org/
NDL
: N-Dimensional Loop: an NDL agent is an HW block able to generate an address sequence
corresponding to multiple levels of nested for-loops, each specified with a counter and a stride.
pass
: In MLIR passes represent the basic infrastructure for transformation and optimization of
{term}IRs\
https://mlir.llvm.org/docs/PassManagement/
SSA
: Static Single Assignment form, is a common representation used in compilers where each variable
is assigned exactly once\
https://en.wikipedia.org/wiki/Static_single-assignment_form
Torq
: Proprietary Synaptics NPU
TOSA
: Tensor Operator Set Architecture: introduced by ARM, it is a standard specifying a set of
tensor operations commonly employed by Neural Networks\
https://www.mlplatform.org/tosa/
VM
: IREE Virtual Machine executed at runtime to run the compiled VMFB\
https://iree.dev/developers/design-docs/vm/#virtual-machine-vm
VMFB
: Virtual Machine FlatBuffer: this is the default output format of files generated
by the IREE compiler.
VMFB files have .vmfb extension and can be executed on the IREE runtime VM