aboutsummaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
10 daysUpdate float8 code to support non-saturating modeWon Jeon
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: I786aca0a2f137cebd446a3a71c8d6fe186286957
2024-04-08Add conversions of U8 to/from BF16 and FP8Tai Ly
Adds type to PadAttribute and ClampAttribute so their pad_const and max_val/min_val can be deserialized according to type Adds conversion functions of U8 arrays to/from BF16/FP8 values Also, refactor and expose TosaSerializer.convertDataToUint8Vec for converting dtype/data to uint8 list for serialization And modify convertDataToUint8Vec to serialize bf16 values into 2 bytes each, and serialize fp8 values into single bytes each. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I05659e8187c76d359f1cc9f71c8c23cafd0e877f
2024-04-04Fix rank 0 support in serialization_libJeremy Johnson
Numpy rank 0 files correctly written as shape () instead of (1) Constant tensors of rank 0 now have data written out Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Ie4bad8f798674cdb0484955e9db684f7f4100145
2024-02-27Update ConvertU8toF16 to save outputs in F16 containersJerry Ge
- If we save FP16 in FP32 containers, it will change byte representation - which causes wrong values after deserialization - Update the code to store F16 values in F16 containers Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I2ddea67471997c596980faea1419422d96bad60d
2024-01-12[serialization_lib] Add tosa shape opsTai Ly
Added tosa shape ops to tosa.fbs also added convert I64 to and from U8 for storing const_shape data values Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I1e938dec7398fbcbe5be657dad65cdd61af5b597
2024-01-03Fix compiler warningsEric Kunze
No functional changes Change-Id: I938fecc941b14c065639e27a110ab1feb7c85ba9 Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2023-09-21Fix deserialization of variable_nameTai Ly
Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I6b3984fb3834d4ea82b38c54e30b0a59b23cef45
2023-09-19Add variable_name to tensorsTai Ly
Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Ia142c8b1a9e0869daefb3eef71100fd0c2a0effc
2023-09-07Add new signedness attributes to RESCALEEric Kunze
Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I96202b90bff833654735a2f2306eb782d202b6e6
2023-09-06Enable backward compatibilityv0.90a0Jerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I572ae70f8d693c89739ab892a31157235700c3f2
2023-08-23Add is_unranked flag to TensorsTai Ly
This adds a bool field, is_unranked to TosaTensor in tosa.fbs to indicate whether a tensor with shape = {} is an unranked tensor or an 0-D tensor. For older tosa files without this field, the default value is false. Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I86950050b522565509863c483cd3a3c1c50f8f69
2023-08-22[Serialization_lib] Support StatefulOps for TOSAJerry Ge
- Add variable in TosaTensor to schema file - Update TosaSerializationTensor regarding variable change - Rename internal zero_pad() and expose interface as ForceAlignTensorData() Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I36fa64eb0802cb5b8d3564ea7233460ef8c9f539
2023-08-10Add DIM operator to serialization libraryWon Jeon
Signed-off-by: Won Jeon <won.jeon@arm.com> Change-Id: I7c68f94a088e206c99d34d152601cf342bff5541
2023-08-02Simplify overloaded writeToNpyFiles and readFromNpyFilesTatWai Chong
templatize these functions instead to reduce redundant code. Signed-off-by: TatWai Chong <tatwai.chong@arm.com> Change-Id: Ie8b6f7d2b489c3508fea72481ce38f0db6d0c490
2023-07-18Update to use GenTextTai Ly
changed GenerateText to GenText, with reversed return polarity. updated flatbuffer to v23.5.26, and regenerated headers Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: I7278dfe9c7b55b9afbe2329e3058b63a1cdce586
2023-07-07Fix strcpy overflowJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I3be64f4e2b7bad57f2c9c0d946434daa5330bf2b
2023-07-05Support reading anydtype into a 32-bit bufferJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: Ic6b43539fcb2d75c5614d3addccd24a06e9f2a31
2023-05-19Support int16, uint16, int8, uint8 types numpy reader/writer for ↵Jerry Ge
serialization_lib Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I287fcda4e895ecfc35083d6cb02140a251c0deb5
2023-05-18Modify TOSA schema to force version to be writtenEric Kunze
Previously if the values were the default, they would not be written to the file Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Ibdf13d3ce672d3e8f062a7853d65a966ab5b0877
2023-05-08Fix empty shaped serialized tensorJerry Ge
Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I512181cca1a3b1ed5d9a5435dbf11d7efcdbc2a5
2023-04-06Fix serialize/deserialize bug when there are two or more regionsTai Ly
Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Icd865b03765f672e3aa28ddaf6a290617ec3f530
2023-04-04Add readFromNpyFile and writeToNpyFile for double dataTai Ly
Signed-off-by: Tai Ly <tai.ly@arm.com> Change-Id: Icc023cbe6aa8843cc37d25e740bc6ce05bb7abb2
2023-01-27Remove zero pad from float attrribute serializationJames Ward
* For Clamp/Pad float attributes * Necessary for the outputs from Python and C++ code to be consistent Signed-off-by: James Ward <james.ward@arm.com> Change-Id: I41530aa1805968becd861e4dee190a88d1973cec
2023-01-18Schema changes for CLAMP, PAD float attributesJames Ward
* Float attributes now serialized as uint8 vectors, but treated as floats at input/output to serialization Signed-off-by: James Ward <james.ward@arm.com> Change-Id: I417b0fabe0ef11fea263fe937b57d49bbfdb00da
2022-12-15[region] Add TosaSerializationRegion to serialization_libJerry Ge
- Rationale: add this fix to support constants access between multiple blocks by another layer of abstraction called Region - Changes: - flatbuffers schema update, regenerate header files - add TosaSerializationRegion for the handler - other relevant fixes Signed-off-by: Jerry Ge <jerry.ge@arm.com> Change-Id: I4bb72503abfd629ae017d2f905184efbab244aa8
2022-10-04FP16 support in serializationJames Ward
* Allow serialization of fp16 data * Add package to support integrated half data-type (half_float::half), independent of native float: http://half.sourceforge.net/ * Allow passing of accumulate data-type in serialization Signed-off-by: James Ward <james.ward@arm.com> Change-Id: I54357f02e3776d81958228f699ea5044f2014f4b
2022-07-11Fix bug in bool to u8 conversionEric Kunze
Can't assume that the boolean is represented as 8-bits. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: Ic7bbf6dc92f243f9c4cf0bb606dde127ba8684e3
2022-06-15Remove quantinfo typesEric Kunze
Any needed information has been moved into the attributes for each operator. This aligns with the structure of the attributes in the TOSA specification, and generally simplifies the code. Change-Id: I8243e91b09de1a9115f8af09c5e7def7e8f2866b Signed-off-by: Eric Kunze <eric.kunze@arm.com>
2022-06-13Increment version to 0.25Eric Kunze
Also insert the TOSA file identifier in the flatbuffer. Reports a warning if the identifier is not present when loading. Signed-off-by: Eric Kunze <eric.kunze@arm.com> Change-Id: I1cd4a9cc78e898ba5015e29be1c65cb640dd6a00
2022-02-17Cleanup code warningsEric Kunze
Change-Id: Ia2a68d8fa9de12f85353d4828a93b05367d86353
2021-11-18Add new interface to read flatbuffer from arrayAaron DeBattista
Change-Id: I2ed86545f457d55c919e3f47ef797e766d05334f Signed-off-by: Aaron DeBattista <aaron.debattista@arm.com>
2021-11-15Parse and check schema version when LoadSchemaFile()Kevin Cheng
- This is useful if user has two different copies of serialization_lib code, an incorrectly load the incompatible one. Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: I0f241d2ddbb7188df030cc5dddaa6a0b5dad7a45
2021-11-11Clean up constructor interfaceKevin Cheng
- replace string type constructor argument with "const string&" - replace vector type constructor argument with "const vector<T>&" - add rvalue reference constructor for TosaSerializationOperator and TosaSerializationBasicBlock - add SetData() for TosaSerializationTensor, so tensor can be constructed first and data can be linked later Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: I7c739df54c37b7ba69ebb6e5af118f660c7c0623
2021-10-26Bring back TosaVersion structKevin Cheng
- check fails only when major/minor mismatches - dump warning if major/minor matches but patch/draft mismatches Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: I0464f1018faa69b81fa93d42e51e1afd7412977a
2021-10-19Both serializer and schema carry version info nowKevin Cheng
- version number now encoded in serializer as well - rename experimental to draft - rename internal function from FreezeBuilder/InitWithBuf to Serialize/Deserialize Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: I70cb07832fdf66c6bde3d18aadf1f3646765887e
2021-08-02Support I4 weights pack/unpack.Kevin Cheng
Signed-off-by: Kevin Cheng <kevin.cheng@arm.com> Change-Id: Ia7d2bfaa473c8a92c71f075c86aca0a275245f83
2021-07-08Allow reading numpy files with up to 10 dimensions.Jeremy Johnson
Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Id6ee2aab2dd62b44e72b60218e4f03dc9a933d10
2021-06-24Constant data is embedded in flatbuffer as u8 array instead of saving out as ↵Kevin Cheng
separate numpy files now. Change-Id: I9d757ee3bdc637595732b06c5319d1dc957eaf96
2021-04-26Initial commit of serialization library codeEric Kunze
Change-Id: Ie09a7245176aa799e59622e5118b145833b23590 Signed-off-by: Eric Kunze <eric.kunze@arm.com>