commit | 3765888e5b2ca8c826edad0d9c90261573af4fce | [log] [tgz] |
---|---|---|
author | Kevin Cheng <kevin.cheng@arm.com> | Tue Jan 04 16:06:07 2022 -0800 |
committer | Kevin Cheng <kevin.cheng@arm.com> | Tue Jan 04 16:06:57 2022 -0800 |
tree | a31464e57fdd3fc3546933117d3de87a5f046621 | |
parent | fd3b7acb794aa453f1d86c24852e22e996d8e21b [diff] |
Short-circuit output tensor name with input tensor name if they're the same mlir::Value Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: I578802841fbcacb67560b07b26170a9efa166d52
The TOSA MLIR Translator repository implements translators between the TOSA MLIR dialect and serialized representations.
The current implementation supports serialization from MLIR form to flatbuffers. A deserializer from flatbuffers to MLIR form is in development.
##TOSA serialization library https://review.mlplatform.org/plugins/gitiles/tosa/serialization_lib The library includes a FlatBuffers schema and a C++ API for reading and writing a TOSA graph as a flatbuffer.
This repository does not currently build standalone. It must be included within another MLIR repository with a pass manager registering the passes implemented within this repository.
The included CMake rules can be used to add this repository as a submodule. The include/SerializationPasses.h enables MLIR pass registration inclusion.
If target "tosa_serialize" is linked correctly, you should able to see "--tosa-serialize" and "--tosa-serialize-json" options available in your MLIR pass manager/MLIR optimizer.
To serialize a TOSA MLIR graph to TOSA flatbuffer binary file:
<YOUR_MLIR_OPTIMIZER> --tosa-serialize <TOSA_MLIR_GRAPH>
--tosa-flatbuffer-filename <TOSA_FLATBUFFER_FILENAME>
To serialize a TOSA MLIR graph to TOSA flatbuffer JSON file:
<YOUR_MLIR_OPTIMIZER> --tosa-serialize <TOSA_MLIR_GRAPH>
--tosa-flatbuffer-schema <PATH_TO_TOSA_FLATBUFFER_SCHEMA>
--tosa-flatbuffer-filename <TOSA_FLATBUFFER_FILENAME>
where <PATH_TO_TOSA_FLATBUFFER_SCHEMA> is provided within the serialization library submodule in third_party/serialization_lib/schema/tosa.fbs
The TOSA MLIR Translator is licensed under Apache-2.0 with LLVM Exceptions.