[Stream] Attach layouts to tensor ops in encoding specialization pass. (#19649)
The revision attaches the layouts to Stream tensor ops, e.g.,
stream.tensor.sizeof, etc. Each layout is wrapped with an attribute
where the attribute should implement the `calculateStorageSizeInBytes`
interface method. Because only the device/target knows the details. It
provides a way to materialize the serialized layouts into actual storage
size.
To teach the pass about layouts, there are few core changes happening in
the revision.
1. The revision introduces `cloneWithSimplifiedConfig` interface method
to EncodingLayoutAttrInterface. Each backend encoding attribute can
filter needed configurations when making layout resolvers in
HALAffinityAnalysisDialectInterface. This is needed because attributes
are not mutable. We always need to create a new attribute if we want to
update the parameters. The main benifit is that it makes the IR dump
much less verbose.
2. The revision also introduces `getLayout` interface method, which
returns the encoded layouts into encoding attributes. The CPU and VMVX
encoding attributes implement it in the revision, and it returns the
serialized MaterializeEncodingInfo struct as a dictionary attribute. See
below example for more details.
```
... layouts = [#iree_cpu.vmvx_encoding_layout<configuration =
{encoding_info =
{innerDimsPos = [0, 1],
innerTileSizes = [8, 4],
outerDimsPerm = [0, 1]}}>
]
```
---------
Signed-off-by: hanhanW <hanhan0912@gmail.com>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.
Releases notes are published on GitHub releases.
| Package | Release status |
|---|---|
| GitHub release (stable) | |
| GitHub release (nightly) | |
| Python iree-base-compiler | |
| Python iree-base-runtime |
| Operating system | Build status |
|---|---|
| Linux | |
| macOS | |
| Windows |
For the full list of workflows see https://iree.dev/developers/general/github-actions/.
See our website for more information.
Community meeting recordings: IREE YouTube channel
| Date | Title | Recording | Slides |
|---|---|---|---|
| 2021-06-09 | IREE Runtime Design Tech Talk | recording | slides |
| 2020-08-20 | IREE CodeGen (MLIR Open Design Meeting) | recording | slides |
| 2020-03-18 | Interactive HAL IR Walkthrough | recording | |
| 2020-01-31 | End-to-end MLIR Workflow in IREE (MLIR Open Design Meeting) | recording | slides |
IREE is licensed under the terms of the Apache 2.0 License with LLVM Exceptions. See LICENSE for more information.