aboutsummaryrefslogtreecommitdiff
path: root/src/TosaSerialize.cpp
AgeCommit message (Collapse)Author
9 days[tosa-mlir-translator] Remove TRANSPOSE_CONV2D out_shape argumentSuraj Sudhir
Change-Id: I0a96662eed0466cc2220f88522fb97d3ad221559 Signed-off-by: Suraj Sudhir <suraj.sudhir@arm.com>
12 days[tosa_mlir_translator] Fix fp16, bf16 and fp8 serializationTai Ly
Fix serialization and deserialization of fp16, bf16 and fp8 for pad_const, clamp min_val/max_val, and const values Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Ia39a17d2f395584d5555d2c86cdae7113cf14e3f
2024-03-19[tosa_mlir_translator] Add acc_type to conv opsTai Ly
Add serializing/deserializing acc_type to/from ConvAttribute Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I20780056f467952eb8baf6f5e80d242df6f0b33f
2024-03-17[tosa_mlir_translator] Use new Clamp and Pad fbs attributesTai Ly
This implements changes required for new Tosa Flatbuffer schema where Clamp and Pad attributes have changed to use ubyte arrays to store int or float values. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I2aa2025422fda4aacaf6d80727060a01a30cee89
2024-03-07[tosa_mlir_translator] ClampOp attributes changesTai Ly
This patch adjusts serialization/deserialization for ClampOp's new min_val/max_val attributes Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I67f275334fdc8996142b0c4541d55ef65ea66274
2024-03-06[tosa_mlir_translator] change rescale attrs to inputsTai Ly
This patch is for RescaleOp multiplier/shift changing from attributes to inputs Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I2fe3aa3cd37134f36873240c92b387b9610e3f9d
2024-03-01Change the shift operand of mul to be available to all data types.TatWai Chong
Change-Id: I436912af95e4aef1b67b140079070168d158ff49 Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
2024-02-27[tosa_mlir_translator] tosa.fb name changesTai Ly
This patch implements attribute name changes in tosa serialization library to align with tosa spec. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I575e4601f12aee67ec6e3114c68a428b8db9d232
2024-02-23[tosa_mlir_translator] Change resize attrs to inputsTai Ly
This patch changes tosa resize op's scale/offset/border from attributes to inputs of tosa.shape type Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I04750e25f4b01067418eb6123201e845c00ce8d8
2024-02-22Add Tosa Sin/Cos operatorsJerry Ge
- Add Tosa Sin/Cos operators to the tosa_mlir_translator - Update thirdparty/serialization_lib hash Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Iea24913d3b295f5ca9fc50488b963e0ab54b11bd
2024-02-22[tosa_mlir_translator] Refactor QuantizationAttrTai Ly
changes to serialization/deserialization due to removal of quantization attr in TOSA dialect Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I0903d2c1c62bc50822e6c08bb869ec135c986ff3
2024-02-22Change the shift of mul to the tensor typeTatWai Chong
Note that the shift value only apply to i32 data tensor. Change-Id: I4368146d9e0cdc2243ff822f59489ef5b78148ec Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
2024-02-21[tosa_mlir_translator] Add FP8 supportTai Ly
Add serialization and deserialization support for FP8 data types. Also, added deserialization support for BF16 constants. BF16 and FP8 constants are serialized and deserialized as F32 values. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I919acd82dc5e0b85024b6403d9623eaa26151aef
2024-01-31Change the start and size of slice to tosa shape typeTatWai Chong
Change-Id: Ifcb33a238ae3acdab9c33e039fb05f45aeb4df1c Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
2024-01-30Change PadOp's padding to TOSA ShapeTai Ly
PadOp's padding input is now a tosa.shape type. Changed serialization of PadOp to not store padding as attribute. Changed deserialization of PadOp to not restore padding from attribute. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I8a622978ea184b8d2779d311adba629c1a0d1fbd
2024-01-18[tosa_mlir_translator] Add Shape Ops SupportTai Ly
- Add serialization/deserialization of tosa shape ops. - Changed TileOp's multiples from attribute to shape input. - Change 'shape' attribute of RESHAPE to an input Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I4329e621fd7637b1a3491c195fbda77d2a0ad23a
2023-12-02[tosa_mlir_translator] Add FP16 supportTai Ly
serialize/deserialize FP16 tensors and constants Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Iab75aeda45983f328796f9463a57c69e86ab8f3e
2023-11-27Add Rescale Attribute changesJames Ward
Signed-off-by: James Ward <james.ward@arm.com> Change-Id: I8ac71800d922526aad0a7c351ad1943481208cc2
2023-11-15Update CustomOp's attribute nameJerry Ge
- CustomOp's two attribute names have been changed to - domain to domain_name - operator to operator_name Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Ib9d032ed9c1a25e3740d9fc8e854369a71736329
2023-11-14[tosa_mlir_translator] Add local_bound supportTai Ly
Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I19b86b954574bebdcac42205c65a23e7e43acb72
2023-10-16Implement deserialization of stateful opsTai Ly
This patch implements deserialization of variable, variable.read and variable.write ops. The variable ops are deserialized before the function. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I029bdf087576e97cacab469386863e6d1baf855c
2023-10-11Adjust to revised Stateful opsTai Ly
Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I86c2d39ff9e3f88dd25d5044f1d2d679e163cc1a
2023-09-11Update to handle unsigned attributes for RESCALEEric Kunze
Check the operand data types to determine whether the RESCALE is operating on signed or unsigned values for the signless type. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Ie6fb4f4c128598dccefdded10774a0af0238eede
2023-09-07[tosa_mlir_translator] Support Tosa StatefulOpsv0.90a0Jerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I6ce5a917cada436f6a80e6d85e670d6cd44e01e9
2023-08-28[tosa_mlir_translator] Support dynamic tensorsTai Ly
This adds serialization and deserialization support for: - unranked tensors (eg, *xi32) and - tensors with dynamic shapes (eg, ?x?xi32) Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Ib2943333d8e3a199cf8a909b6db7197150666700
2023-08-16Add DIM operator and its serialization/deserialization to TOSA MLIR translatorWon Jeon
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: Idf45f0a68f551039cc40a69d90aa5c53098bc238
2023-08-01[tosa_mlir_translator] Rename Div Op to IntDivTai Ly
Rename Tosa Div Op to IntDiv Op in serialization and deserialization Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Iec2d1c4f91a77485f2a61984962872a386f131cb
2023-07-24Add Erf to tosa_mlir_translatorJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I5d173daf4330d4c4761175a7bd2362cd0bf4b420
2023-07-18Add deserialization of AccumTypeTai Ly
Added deserialize accum_type attribute for AvgPool2D Op also fixed serialization of accum_type attribute for AvgPool2D Op also updated third_party/serialization_lib hash LLVM_REFSPEC: refs/changes/23/532123/2 TF_REFSPEC: refs/changes/34/699334/5 Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I2084f33e60d1bf8f76958b320a96fc1f3a94d95c
2023-07-14Fix PadOp serialization for input_zpTai Ly
This fixes previously introduced bug where the input_zp was dropped from the PadOp serialization. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I42fec4a2cdad0ab1ea3cc2f188c4f4c4467583b0
2023-07-12[tosa_mlir_translator] Fix Pad const attr typeTai Ly
This fixes serialization and deserialization of Pad Operator's constant value attributes that is integer data types other than I32 also fixed serialization of F16 constants to not crash, found in testing Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Ic3987aad0e11b612de591eaeecd308d599d174e1
2023-07-12[tosa_mlir_translator] Fix Rescale shift data typeTai Ly
Changed to support new data type of Rescale shift attr: DenseI8ArrayAttr (instead of DenseI32ArrayAttr) LLVM_REFSPEC: refs/changes/55/532955/1 TF_REFSPEC: refs/changes/50/700450/3 Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I8f176ab95e167a8c4a0d3da605384509cf083d5e
2023-06-20Run clang-format for TosaDeserialize.cpp and TosaSerialize.cppJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Ia42e457222b1c81732bfcec2b729f295b17d4e81
2023-04-26serialize/deserialize while/if ops using regionsTai Ly
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
2023-04-22Support translation of FFT2dLuke Hutton
Signed-off-by: Luke Hutton <luke.hutton@arm.com> Change-Id: I4aae94438380d394b9c13015aa69ac52f9b73f74
2023-03-02Added support of unranked tensorsDmitriy Smirnov
Added support of unranked tensors to TosaSerializationBlockBuilder::BuildTosaSerializationTensor method Signed-off-by: Dmitriy Smirnov <dmitriy.smirnov@arm.com> Change-Id: Ia691437b7571f01a4b964a286c6d844eed80af75
2023-02-27Support translation of RFFT2dLuke Hutton
Signed-off-by: Luke Hutton <luke.hutton@arm.com> Change-Id: Ic69e006fb9369414f4174e5bb24adadae531775d
2023-02-24[Fix] Explicit pad const hasn't been read during pad op constructionTatWai Chong
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>
2023-02-14Revert "Align the type of padding and pad_const with the spec"TatWai Chong
This reverts commit e1dcee57d8f89cd192411bbec9e8a97b26833bb7. Change-Id: I7b4c1b12da6530514f9cf09ff7b1e463834fa008
2023-02-08Remove accum-dtype from all but avg_pool2d & remove zero padJames Ward
* 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
2023-02-02Switch ArrayAttr to DenseArrayAttrTatWai Chong
Align with mlir commits: 9e1a344155c0b78be46348b94cae635b7305326c 11030c7d67a7ac0b469e3fbc53dd7a09b47792c9 Change-Id: I5be0fc084fabc1057a39127b67a1ee9a55e5079f Signed-off-by: TatWai Chong <tatwai.chong@arm.com>
2023-01-27Align the type of padding and pad_const with the specTatWai Chong
switch padding and pad_const to attribute type. Signed-off-by: TatWai Chong <tatwai.chong@arm.com> Change-Id: Ic179034d290cca3b3d857a84744da96c485098ba
2023-01-13Add serialization of custom op attributesEric Kunze
Requires updated serialization_lib submodule Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I149680f51242bd45b9a10f7c021f15a59f0ef9c4
2023-01-12Add RegionBuilder to TOSA MLIR TranslatorJerry Ge
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
2022-10-24Avoid crash when serializing unranked tensorEric Kunze
Report an error instead during serialization. Change-Id: Ib53b1c76079909aaf84f643655939d024d7eec0c
2022-10-13Rename FLOAT type to FP32Jeremy Johnson
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: I5e45381c8b573d18c2e3241742c663623961c4d6
2022-10-11Updates to work with the new FP16 serialization codeEric Kunze
Adds accumulator data type where needed, and incorporates the new submodule Change-Id: Ice1d5508bd94812b0092e6a6238abb14f1bbc399 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2022-09-14Update to new serialization libEric Kunze
Also includes fixes for more recent LLVM (verified with LLVM commit 72142fbac496) Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I00a2cc4360731d5e63f129dfff9228e30aeedb36
2022-08-29Add conv3d supportTatWai Chong
Change-Id: If77423cbdb354a213677139d6cf4641db2bd6fcd
2022-08-04Update TOSA resize to match specificationTatWai Chong
Attribute stride and shift are removed, and has new scale and border. Signed-off-by: TatWai Chong <tatwai.chong@arm.com> Change-Id: Id34072deb46ffce642530cc7499eb777cf9b82fc