Age | Commit message (Collapse) | Author |
|
This BuildMlirFromTosaFile API deserializes a tosa fbs or
json file and returns a mlir module as OwningOpRef<ModuleOp>
This also refactors the existing deserialization passes
to use the new API, and then copy the deserialized module's
main function into the existing function, and copy all
attributes of the new function and new module into the
existing function and module.
This allows testing of the new API by running deserialization
passes.
Here is an example showing the attributes on the deserialized
module and functions:
module attributes {tf_saved_model.semantics, tosa.description = "Tosa FBS Converted", tosa.fbs_version = "0.70.0d"} {
func.func @main(%arg0: tensor<1x256x256x3xui8> {tf_saved_model.index_path = ["input_0"]}) -> (tensor<1x1x17x3xf32> {tf_saved_model.index_path = ["output_0"]}) attributes {tf.entry_function = {inputs = "tosa_de
serialized_input_0:0", outputs = "tosa_deserialized_output_0:0"}, tf_saved_model.exported_names = ["tosa_deserialized"]} {
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: Ia6c0202ef43ce5d37788cd459ed7c3f8424dd619
|
|
This changes serialization and deserialization of while and if ops
to use regions instead of blocks.
also changed deserialization to preserve original ordering such that:
tosa1->deserialize->serialize->tosa2 => tosa1 == tosa2 most of the time.
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I539076788bdc466ba1881d955af349e6b4924ed8
|
|
Pad constant attribute requires scalar values (instead of 1D tensor)
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: Iae0bf49b1b404c7b93d515a10b182c3906054e70
|
|
Signed-off-by: Luke Hutton <luke.hutton@arm.com>
Change-Id: I4aae94438380d394b9c13015aa69ac52f9b73f74
|
|
Signed-off-by: Tai Ly <tai.ly@arm.com>
Change-Id: I8b0220a8465e75b1accf6b0854e911a425730da6
|
|
Added support of unranked tensors
to TosaSerializationBlockBuilder::BuildTosaSerializationTensor
method
Signed-off-by: Dmitriy Smirnov <dmitriy.smirnov@arm.com>
Change-Id: Ia691437b7571f01a4b964a286c6d844eed80af75
|
|
Signed-off-by: Luke Hutton <luke.hutton@arm.com>
Change-Id: Ic69e006fb9369414f4174e5bb24adadae531775d
|
|
The op builder didn't read the value from operand but only set the
pad_const attribute to zero.
Change-Id: Ia6f16490c3fad42200884a9d3a5118fa5c152b53
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
|
|
This reverts commit e1dcee57d8f89cd192411bbec9e8a97b26833bb7.
Change-Id: I7b4c1b12da6530514f9cf09ff7b1e463834fa008
|
|
* Remove zero pad from float attribute serialization
* Remove accum-dtype from tensor ops to match specification
Signed-off-by: James Ward <james.ward@arm.com>
Change-Id: I36e179fa0736f34f2c34309d8372d1cf3ab3c763
|
|
Align with mlir commits:
9e1a344155c0b78be46348b94cae635b7305326c
11030c7d67a7ac0b469e3fbc53dd7a09b47792c9
Change-Id: I5be0fc084fabc1057a39127b67a1ee9a55e5079f
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
|
|
switch padding and pad_const to attribute type.
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Change-Id: Ic179034d290cca3b3d857a84744da96c485098ba
|
|
Requires updated serialization_lib submodule
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: I149680f51242bd45b9a10f7c021f15a59f0ef9c4
|
|
Rationale for making this change:
- The original design only supports a single basicBlock which is no
longer functionaly enough to support Control Flow operators like WhileOp
or IFOp
- Added another layer of abstraction of Region to support multiple
basicBlocks + other corresponding fixes
- There are other companion patches to make the above proposal work
- Serialization Lib: Add TosaSerializationRegion to serialization_lib
- Reference Model: Reference model update for control flow
Signed-off-by: Jerry Ge <jerry.ge@arm.com>
Change-Id: Ic7eec3c32da87d409819365ba2dc7ef8b9619db4
|
|
Report an error instead during serialization.
Change-Id: Ib53b1c76079909aaf84f643655939d024d7eec0c
|
|
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com>
Change-Id: I5e45381c8b573d18c2e3241742c663623961c4d6
|
|
Adds accumulator data type where needed, and incorporates the new submodule
Change-Id: Ice1d5508bd94812b0092e6a6238abb14f1bbc399
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
|
|
Also includes fixes for more recent LLVM
(verified with LLVM commit 72142fbac496)
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: I00a2cc4360731d5e63f129dfff9228e30aeedb36
|
|
Change-Id: If77423cbdb354a213677139d6cf4641db2bd6fcd
|
|
Attribute stride and shift are removed, and has new scale and border.
Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
Change-Id: Id34072deb46ffce642530cc7499eb777cf9b82fc
|
|
This adapts the mlir-translator to the updated serialization library
which does not have quantization attributes in the schema.
Change-Id: I321845c735426b2325590e0241e67242c31064a5
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
|
|
It does not exist in the specification, removing from serialized form
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: I496e1d4906b3ba1b9e00a1adef4ff3e7bab3d8ba
|
|
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
Change-Id: If42a1c861fd9e811124d3f878fa1b38f5acac006
|
|
Now works with LLVM hash 1cb299165c85
Primarily changes to match the upstream FuncOp move to the func dialect
Change-Id: Ibc5c81c9f10d86d42970e2ec4885844826cd4868
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
|
|
Remove FunctionPass
Simplify getValues code
Change-Id: I054466ccb480148b82d81d900e1e9ffb4560e8af
Signed-off-by: Eric Kunze <eric.kunze@arm.com>
|
|
The existing getValue is removed in the latest LLVM changes
Change-Id: Idb5e6e8a5f24bc6f76771ace8e5a8eddf6ee1a6f
|
|
Pull out of DenseElementAttr as APInt and extract uint64 for
serializing
Change-Id: Ib261c0e306bd4461b7ce9df21f90db966a1d0faf
|
|
mlir::Value
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com>
Change-Id: I578802841fbcacb67560b07b26170a9efa166d52
|
|
- Tensors are stored in an unordered_map from mlir::Value::hash_value
to tensor name.
- Before serialization, sort the tensor list alphabetically by name
so that tensors always appear in a determinstic (and logical) order.
Signed-off-by: Jared Smolens <jared.smolens@arm.com>
Change-Id: I21c0e2ec04b7520e6a753b8bf62572a702002d5b
|
|
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com>
Change-Id: I1551017706f6e8af604792f48cdeb49b4da7ef0d
|